GJJ.Keystone.AspNetCore.Gateway
6.0.0
dotnet add package GJJ.Keystone.AspNetCore.Gateway --version 6.0.0
NuGet\Install-Package GJJ.Keystone.AspNetCore.Gateway -Version 6.0.0
<PackageReference Include="GJJ.Keystone.AspNetCore.Gateway" Version="6.0.0" />
<PackageVersion Include="GJJ.Keystone.AspNetCore.Gateway" Version="6.0.0" />
<PackageReference Include="GJJ.Keystone.AspNetCore.Gateway" />
paket add GJJ.Keystone.AspNetCore.Gateway --version 6.0.0
#r "nuget: GJJ.Keystone.AspNetCore.Gateway, 6.0.0"
#:package GJJ.Keystone.AspNetCore.Gateway@6.0.0
#addin nuget:?package=GJJ.Keystone.AspNetCore.Gateway&version=6.0.0
#tool nuget:?package=GJJ.Keystone.AspNetCore.Gateway&version=6.0.0
GJJ.Keystone.AspNetCore.Gateway
6.0.0 实例 IP 启动规则
项目入口通过 defaultIp 声明测试默认 IP(当前为 192.168.1.165),不传参数也能启动。需要覆盖时使用中立参数 --ip=<节点IP>;Web 监听地址 / 端口仍用 --urls,Worker 健康端口仍用 --Keystone:Worker:HealthEndpoint:Port。IP 在加载远端配置前固定;注册、心跳、注销与日志共用最终地址。网关和只查询服务的 Worker 不要求 IP。
删除 LocalIP、Nacos:Ip、Nacos:PreferredNetworks 和 Worker 专属 IP 配置,不提供旧键回退。远端 DataId 不能保存根级 ip。本地显式关闭注册不会被远端重新开启。
完整规则见服务启动监听端口与实例 IP 统一规范。
GJJ 网关宿主专用轻量基础设施包。
定位
- 只给 网关/Gateway Host 使用(如 GJJApiGateway),不给业务服务使用;业务服务继续用
GJJ.Keystone.AspNetCore主包。 - 提供:Nacos/TongNCS 配置中心(
AddNacosConfiguration)、服务发现查询(AddNacosServiceDiscovery,只查询不注册当前进程)、统一 Redis 基础设施(AddGjjKvInfrastructure)。 - 不含:JWT、SM/AES 加解密、ApiCatalog、AuthCenter 客户端、服务注册 HostedService、Serilog/OTel/Kestrel/CORS 封装。
与主包的关系(重要)
本包与 GJJ.Keystone.AspNetCore 共享同一份源码与命名空间(GJJ.Keystone.AspNetCore.Infrastructure.*,经 csproj Compile Include 链接),因此:
- 网关从主包切到本包时 不需要改任何 using;
- 同一项目禁止同时引用两个包(相同命名空间类型会 CS0433 冲突),ArchitectureGuard 已有规则守护;
- 修改共享源文件(文件头有 ⚠ 标注)会同时影响两个包,改动时按业务服务 + 网关双视角评审。
用法(网关 Program.cs)
builder.Services.AddNacosConfiguration(builder.Configuration, builder.Configuration);
builder.Services.AddNacosServiceDiscovery(builder.Configuration, "GJJApiGateway.Gateway");
builder.Services.AddGjjKvInfrastructure(builder.Configuration, "GJJApiGateway.Gateway");
KvStore 高层能力(AddKeystoneKvStore / AddKeystoneStorage / AddRedisJson)仍在 GJJ.Keystone.AspNetCore.KvStore 包,网关按需另行引用。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- GJJ.Keystone.Abstractions (>= 4.5.3)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- nacos-sdk-csharp.Extensions.Configuration (>= 1.3.10)
- StackExchange.Redis (>= 2.8.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.