Etcd.Register
1.0.2
dotnet add package Etcd.Register --version 1.0.2
NuGet\Install-Package Etcd.Register -Version 1.0.2
<PackageReference Include="Etcd.Register" Version="1.0.2" />
paket add Etcd.Register --version 1.0.2
#r "nuget: Etcd.Register, 1.0.2"
// Install Etcd.Register as a Cake Addin #addin nuget:?package=Etcd.Register&version=1.0.2 // Install Etcd.Register as a Cake Tool #tool nuget:?package=Etcd.Register&version=1.0.2
Etcd.Register
Etcd.Register
Install-Package Etcd.Register
#Etcd.Register 服务注册
例如:
一般服务注册:
//设置心跳包
var httpCheck = new AgentCheckRegistration()
{
ServiceID= Guid.NewGuid().ToString(),
TTL=10,
};
//配置服务信息
var regist = new AgentServiceRegistration
{
Address = "127.0.0.1",
Port = 22222,
Name = "dddd",
ID = "444444",
Check=httpCheck,
Tags = new[] { $"urlprefix-/{"dddd"}" }
};
EtcdClient etcdClient = new EtcdClient("127.0.0.1", 2379);
Agent agent=new Agent(etcdClient);
agent.ServiceRegister(regist);//注册服务!
WebApi服务注册:
builder.Services.AddSingleton<EtcdClientConfiguration>(new EtcdClientConfiguration("127.0.0.1", 2379, "etcdid"));
builder.Services.AddEtcd().AddEtcdServiceRegistration(p ⇒
{
p.Port = 2222;
p.Address = "127.0.0.1";
p.Check = new AgentCheckRegistration();
p.Check.TTL = 10;
p.Check.ServiceID = "etcdid";
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- dotnet-etcd (>= 6.0.1)
- etcd.Provider.Cluster.Extensions (>= 1.3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.