Compare commits
	
		
			2 Commits
		
	
	
		
			fc6cee17d7
			...
			e78858b7b4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e78858b7b4 | |||
| 636b674229 | 
| @@ -12,7 +12,8 @@ | ||||
|   "ConnectionStrings": { | ||||
|     "App": "Host=localhost;Port=5432;Database=dyson_network_dev;Username=postgres;Password=postgres;Include Error Detail=True;Maximum Pool Size=20;Connection Idle Lifetime=60", | ||||
|     "FastRetrieve": "localhost:6379", | ||||
|     "Etcd": "etcd.orb.local:2379" | ||||
|     "Etcd": "etcd.orb.local:2379", | ||||
|     "Stream": "nats.orb.local:4222" | ||||
|   }, | ||||
|   "KnownProxies": [ | ||||
|     "127.0.0.1", | ||||
|   | ||||
| @@ -12,7 +12,8 @@ | ||||
|   "ConnectionStrings": { | ||||
|     "App": "Host=localhost;Port=5432;Database=dyson_drive;Username=postgres;Password=postgres;Include Error Detail=True;Maximum Pool Size=20;Connection Idle Lifetime=60", | ||||
|     "FastRetrieve": "localhost:6379", | ||||
|     "Etcd": "etcd.orb.local:2379" | ||||
|     "Etcd": "etcd.orb.local:2379", | ||||
|     "Stream": "nats.orb.local:4222" | ||||
|   }, | ||||
|   "Authentication": { | ||||
|     "Schemes": { | ||||
|   | ||||
| @@ -76,6 +76,26 @@ public class RegistryProxyConfigProvider : IProxyConfigProvider, IDisposable | ||||
|  | ||||
|         var gatewayServiceName = _configuration["Service:Name"]; | ||||
|  | ||||
|         // Add direct route for /cgi to Gateway | ||||
|         var gatewayCluster = new ClusterConfig | ||||
|         { | ||||
|             ClusterId = "gateway-self", | ||||
|             Destinations = new Dictionary<string, DestinationConfig> | ||||
|             { | ||||
|                 { "self", new DestinationConfig { Address = _configuration["Kestrel:Endpoints:Http:Url"] ?? "http://localhost:5000" } } | ||||
|             } | ||||
|         }; | ||||
|         clusters.Add(gatewayCluster); | ||||
|  | ||||
|         var cgiRoute = new RouteConfig | ||||
|         { | ||||
|             RouteId = "gateway-cgi-route", | ||||
|             ClusterId = "gateway-self", | ||||
|             Match = new RouteMatch { Path = "/cgi/{**catch-all}" } | ||||
|         }; | ||||
|         routes.Add(cgiRoute); | ||||
|         _logger.LogInformation("    Added CGI Route: /cgi/** -> Gateway"); | ||||
|  | ||||
|         // Add direct routes | ||||
|         foreach (var directRoute in directRoutes) | ||||
|         { | ||||
|   | ||||
| @@ -13,6 +13,7 @@ | ||||
|             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|             <PrivateAssets>all</PrivateAssets> | ||||
|         </PackageReference> | ||||
|         <PackageReference Include="NATS.Client.Core" Version="2.6.6" /> | ||||
|         <PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115"> | ||||
|             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|             <PrivateAssets>all</PrivateAssets> | ||||
|   | ||||
| @@ -12,7 +12,8 @@ | ||||
|   "ConnectionStrings": { | ||||
|     "App": "Host=localhost;Port=5432;Database=dyson_pass;Username=postgres;Password=postgres;Include Error Detail=True;Maximum Pool Size=20;Connection Idle Lifetime=60", | ||||
|     "FastRetrieve": "localhost:6379", | ||||
|     "Etcd": "etcd.orb.local:2379" | ||||
|     "Etcd": "etcd.orb.local:2379", | ||||
|     "Stream": "nats.orb.local:4222" | ||||
|   }, | ||||
|   "Authentication": { | ||||
|     "Schemes": { | ||||
|   | ||||
| @@ -11,7 +11,8 @@ | ||||
|   "ConnectionStrings": { | ||||
|     "App": "Host=localhost;Port=5432;Database=dyson_pusher;Username=postgres;Password=postgres;Include Error Detail=True;Maximum Pool Size=20;Connection Idle Lifetime=60", | ||||
|     "FastRetrieve": "localhost:6379", | ||||
|     "Etcd": "etcd.orb.local:2379" | ||||
|     "Etcd": "etcd.orb.local:2379", | ||||
|     "Stream": "nats.orb.local:4222" | ||||
|   }, | ||||
|   "Notifications": { | ||||
|     "Push": { | ||||
|   | ||||
| @@ -21,6 +21,7 @@ | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.7" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" /> | ||||
|         <PackageReference Include="NATS.Client.Core" Version="2.6.6" /> | ||||
|         <PackageReference Include="NetTopologySuite" Version="2.6.0" /> | ||||
|         <PackageReference Include="NodaTime" Version="3.2.2" /> | ||||
|         <PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.2.0" /> | ||||
|   | ||||
							
								
								
									
										9
									
								
								DysonNetwork.Shared/Stream/AccountEvent.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								DysonNetwork.Shared/Stream/AccountEvent.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| using NodaTime; | ||||
|  | ||||
| namespace DysonNetwork.Shared.Stream; | ||||
|  | ||||
| public class AccountDeletedEvent | ||||
| { | ||||
|     public Guid AccountId { get; set; } = Guid.NewGuid(); | ||||
|     public Instant DeletedAt { get; set; } = SystemClock.Instance.GetCurrentInstant(); | ||||
| } | ||||
							
								
								
									
										21
									
								
								DysonNetwork.Shared/Stream/Connector.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								DysonNetwork.Shared/Stream/Connector.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using NATS.Client.Core; | ||||
|  | ||||
| namespace DysonNetwork.Shared.Stream; | ||||
|  | ||||
| public static class Connector | ||||
| { | ||||
|     public static IServiceCollection AddStreamConnection(this IServiceCollection services, IConfiguration configuration) | ||||
|     { | ||||
|         var connectionString = configuration.GetConnectionString("Stream"); | ||||
|         if (connectionString is null) | ||||
|             throw new ArgumentNullException(nameof(connectionString)); | ||||
|         services.AddSingleton<INatsConnection>(_ => new NatsConnection(new NatsOpts() | ||||
|         { | ||||
|             Url = connectionString | ||||
|         })); | ||||
|          | ||||
|         return services; | ||||
|     } | ||||
| } | ||||
| @@ -30,6 +30,7 @@ | ||||
|             <PrivateAssets>all</PrivateAssets> | ||||
|             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|         </PackageReference> | ||||
|         <PackageReference Include="NATS.Client.Core" Version="2.6.6" /> | ||||
|         <PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115"> | ||||
|             <PrivateAssets>all</PrivateAssets> | ||||
|             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|   | ||||
| @@ -12,7 +12,8 @@ | ||||
|   "ConnectionStrings": { | ||||
|     "App": "Host=localhost;Port=5432;Database=dyson_network;Username=postgres;Password=postgres;Include Error Detail=True;Maximum Pool Size=20;Connection Idle Lifetime=60", | ||||
|     "FastRetrieve": "localhost:6379", | ||||
|     "Etcd": "etcd.orb.local:2379" | ||||
|     "Etcd": "etcd.orb.local:2379", | ||||
|     "Stream": "nats.orb.local:4222" | ||||
|   }, | ||||
|   "GeoIp": { | ||||
|     "DatabasePath": "./Keys/GeoLite2-City.mmdb" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user