MinGo.ServiceRegistry.Client 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MinGo.ServiceRegistry.Client --version 0.1.0
                    
NuGet\Install-Package MinGo.ServiceRegistry.Client -Version 0.1.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="MinGo.ServiceRegistry.Client" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinGo.ServiceRegistry.Client" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MinGo.ServiceRegistry.Client" />
                    
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 MinGo.ServiceRegistry.Client --version 0.1.0
                    
#r "nuget: MinGo.ServiceRegistry.Client, 0.1.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 MinGo.ServiceRegistry.Client@0.1.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=MinGo.ServiceRegistry.Client&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MinGo.ServiceRegistry.Client&version=0.1.0
                    
Install as a Cake Tool

MinGo Service Registry SDK

核心抽象 + 客户端 SDK。本仓库只产出 NuGet 包,不包含可独立运行的 Registry Server(见 service-registry 仓库)。

包划分

包 职责
MinGo.ServiceRegistry.Abstractions 领域模型、协议 DTO、IServiceRegistryClient 抽象、JSON 源生成上下文
MinGo.ServiceRegistry.Client 基于 HttpClient 的 Registry 协议客户端实现
MinGo.ServiceRegistry.AspNetCore AddServiceRegistry(...) + 注册/心跳/注销的 IHostedService
MinGo.ServiceRegistry.ServiceDiscovery 对接 Microsoft.Extensions.ServiceDiscovery 的终结点 Provider
MinGo.ServiceRegistry 聚合上述四包的元包,业务服务一键安装

依赖方向

Abstractions  <-  Client  <-  AspNetCore
                        \-  ServiceDiscovery

快速开始

var builder = WebApplication.CreateBuilder(args);

// 1. 作为服务提供方:注册自身 + 心跳
builder.Services.AddServiceRegistry(o =>
{
    o.ServiceName = "user-service";
    o.RegistryEndpoint = new Uri("https://registry:8500");
});

// 2. 作为服务消费方:通过服务名调用(生产用 Registry Provider)
builder.Services.AddRegistryServiceDiscovery();
builder.Services.AddHttpClient<UserServiceClient>(c => c.BaseAddress = new Uri("https://user-service"))
    .AddServiceDiscovery();

本地开发可改用官方 Configuration Provider(builder.Services.AddServiceDiscovery(); + appsettings.json 的 Services 节点),业务代码不变。详见 docs/local-development.md。

构建

dotnet build ServiceRegistry.Sdk.slnx
dotnet test  ServiceRegistry.Sdk.slnx
dotnet pack  ServiceRegistry.Sdk.slnx -c Release -o ./artifacts

目标框架

net10.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (2)

Showing the top 2 NuGet packages that depend on MinGo.ServiceRegistry.Client:

Package Downloads
MinGo.ServiceRegistry

Meta package that installs the full MinGo Service Registry SDK (Abstractions, Client, AspNetCore, ServiceDiscovery).

MinGo.ServiceRegistry.AspNetCore

ASP.NET Core host integration for MinGo Service Registry: automatic registration, heartbeat and deregistration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 93 9/22/2026
0.1.0 90 9/22/2026