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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GJJ.Keystone.AspNetCore.Gateway" Version="6.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GJJ.Keystone.AspNetCore.Gateway" Version="6.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GJJ.Keystone.AspNetCore.Gateway" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GJJ.Keystone.AspNetCore.Gateway --version 6.0.0
                    
#r "nuget: GJJ.Keystone.AspNetCore.Gateway, 6.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GJJ.Keystone.AspNetCore.Gateway@6.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GJJ.Keystone.AspNetCore.Gateway&version=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GJJ.Keystone.AspNetCore.Gateway&version=6.0.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0 121 10/14/2026
5.0.0 153 7/20/2026
4.4.0 134 7/6/2026
4.3.9 148 7/3/2026