mirror of https://github.com/dotnet/tye.git
committed by
GitHub
22 changed files with 435 additions and 156 deletions
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class ConfigurationSource |
|||
{ |
|||
public ConfigurationSource(string name, string value) |
|||
{ |
|||
Name = name; |
|||
Value = value; |
|||
} |
|||
|
|||
public string Name { get; } |
|||
public string Value { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class DockerStatus : ReplicaStatus |
|||
{ |
|||
public DockerStatus(Service service, string name) : base(service, name) |
|||
{ |
|||
} |
|||
|
|||
public string? DockerCommand { get; set; } |
|||
|
|||
public string? ContainerId { get; set; } |
|||
|
|||
public int? DockerLogsPid { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class PortMapping |
|||
{ |
|||
public int ExternalPort { get; set; } |
|||
|
|||
public List<int> InternalPorts { get; set; } = new List<int>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class ProcessStatus : ReplicaStatus |
|||
{ |
|||
public ProcessStatus(Service service, string name) |
|||
: base(service, name) |
|||
{ |
|||
} |
|||
|
|||
public int? ExitCode { get; set; } |
|||
public int? Pid { get; set; } |
|||
public IDictionary<string, string>? Environment { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public readonly struct ReplicaEvent |
|||
{ |
|||
public ReplicaState State { get; } |
|||
public ReplicaStatus Replica { get; } |
|||
|
|||
public ReplicaEvent(ReplicaState state, ReplicaStatus replica) |
|||
{ |
|||
State = state; |
|||
Replica = replica; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public enum ReplicaState |
|||
{ |
|||
Removed, |
|||
Added, |
|||
Started, |
|||
Stopped, |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class ReplicaStatus |
|||
{ |
|||
public ReplicaStatus(Service service, string name) |
|||
{ |
|||
Service = service; |
|||
Name = name; |
|||
} |
|||
|
|||
public string Name { get; } |
|||
|
|||
public IEnumerable<int>? Ports { get; set; } |
|||
|
|||
public Service Service { get; } |
|||
|
|||
public Dictionary<object, object> Items { get; } = new Dictionary<object, object>(); |
|||
|
|||
public Dictionary<string, string> Metrics { get; set; } = new Dictionary<string, string>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public class ServiceStatus |
|||
{ |
|||
public string? ProjectFilePath { get; set; } |
|||
public string? ExecutablePath { get; set; } |
|||
public string? Args { get; set; } |
|||
public string? WorkingDirectory { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model |
|||
{ |
|||
public enum ServiceType |
|||
{ |
|||
External, |
|||
Project, |
|||
Executable, |
|||
Container |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1ConfigurationSource |
|||
{ |
|||
public string? Name { get; set; } |
|||
public string? Value { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text.Json; |
|||
using System.Text.Json.Serialization; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1ReplicaStatus |
|||
{ |
|||
public V1ReplicaType Type { get; set; } |
|||
public string? DockerCommand { get; set; } |
|||
public string? ContainerId { get; set; } |
|||
public int? DockerLogsPid { get; set; } |
|||
public string? Name { get; set; } |
|||
public IEnumerable<int>? Ports { get; set; } |
|||
public int? ExitCode { get; set; } |
|||
public int? Pid { get; set; } |
|||
public IDictionary<string, string>? Environment { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public enum V1ReplicaType |
|||
{ |
|||
Process, |
|||
Docker |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1RunInfo |
|||
{ |
|||
public V1RunInfoType Type { get; set; } |
|||
public string? Args { get; set; } |
|||
public bool Build { get; set; } |
|||
public string? Project { get; set; } |
|||
public string? WorkingDirectory { get; set; } |
|||
public Dictionary<string, string>? VolumeMappings { get; set; } |
|||
public string? Image { get; set; } |
|||
public string? Executable { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public enum V1RunInfoType |
|||
{ |
|||
Project, |
|||
Executable, |
|||
Docker |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1Service |
|||
{ |
|||
public V1ServiceDescription? Description { get; set; } |
|||
public ServiceType ServiceType { get; set; } |
|||
public int Restarts { get; set; } |
|||
public V1ServiceStatus? Status { get; set; } |
|||
public Dictionary<string, V1ReplicaStatus>? Replicas { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1ServiceBinding |
|||
{ |
|||
public string? Name { get; set; } |
|||
public string? ConnectionString { get; set; } |
|||
public bool AutoAssignPort { get; set; } |
|||
public int? Port { get; set; } |
|||
public int? InternalPort { get; set; } |
|||
public string? Host { get; set; } |
|||
public string? Protocol { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1ServiceDescription |
|||
{ |
|||
public string? Name { get; set; } |
|||
public int Replicas { get; set; } |
|||
public V1RunInfo? RunInfo { get; set; } |
|||
public List<V1ServiceBinding>? Bindings { get; set; } |
|||
public List<V1ConfigurationSource>? Configuration { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
// Licensed to the .NET Foundation under one or more agreements.
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
|||
// See the LICENSE file in the project root for more information.
|
|||
|
|||
namespace Microsoft.Tye.Hosting.Model.V1 |
|||
{ |
|||
public class V1ServiceStatus |
|||
{ |
|||
public string? ProjectFilePath { get; set; } |
|||
public string? ExecutablePath { get; set; } |
|||
public string? Args { get; set; } |
|||
public string? WorkingDirectory { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue