mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
Add microservices scaffold
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace DorkNet.Contracts;
|
||||
|
||||
public sealed class DorkNetServiceMapOptions
|
||||
{
|
||||
public string Identity { get; set; } = "http://localhost:8081";
|
||||
public string Rooms { get; set; } = "http://localhost:8082";
|
||||
public string Notify { get; set; } = "http://localhost:8083";
|
||||
public string Monolith { get; set; } = "http://localhost:8084";
|
||||
|
||||
public IReadOnlyList<DorkNetServiceEndpoint> Endpoints()
|
||||
{
|
||||
DorkNetServiceEndpoint[] endpoints =
|
||||
[
|
||||
new(ServiceNames.Identity, Identity),
|
||||
new(ServiceNames.Rooms, Rooms),
|
||||
new(ServiceNames.Notify, Notify),
|
||||
new(ServiceNames.Monolith, Monolith),
|
||||
];
|
||||
|
||||
return endpoints
|
||||
.Where(endpoint => !string.IsNullOrWhiteSpace(endpoint.BaseUrl))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed record DorkNetServiceEndpoint(string Name, string BaseUrl);
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace DorkNet.Contracts;
|
||||
|
||||
public sealed record ServiceHealthResponse(
|
||||
string Service,
|
||||
string Status,
|
||||
DateTimeOffset CheckedAtUtc);
|
||||
|
||||
public sealed record ServiceCapabilityResponse(
|
||||
string Service,
|
||||
string[] Owns,
|
||||
string[] PlannedPublicRoutes);
|
||||
|
||||
public sealed record ServiceProbeResponse(
|
||||
string Service,
|
||||
string BaseUrl,
|
||||
string Status,
|
||||
int? StatusCode,
|
||||
string? Error,
|
||||
DateTimeOffset CheckedAtUtc);
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace DorkNet.Contracts;
|
||||
|
||||
public static class ServiceNames
|
||||
{
|
||||
public const string Gateway = "gateway";
|
||||
public const string Identity = "identity";
|
||||
public const string Rooms = "rooms";
|
||||
public const string Notify = "notify";
|
||||
public const string Monolith = "monolith";
|
||||
}
|
||||
Reference in New Issue
Block a user