Class ConsulServiceRegistry
An implementation of a Consul service registry
Inheritance
System.Object
ConsulServiceRegistry
Namespace: Steeltoe.Discovery.Consul.Registry
Assembly: Steeltoe.Discovery.Consul.dll
Syntax
public class ConsulServiceRegistry : object, IConsulServiceRegistry
Constructors
| Edit this page View SourceConsulServiceRegistry(IConsulClient, IOptionsMonitor<ConsulDiscoveryOptions>, IScheduler, ILogger<ConsulServiceRegistry>)
Initializes a new instance of the ConsulServiceRegistry class.
Declaration
public ConsulServiceRegistry(IConsulClient client, IOptionsMonitor<ConsulDiscoveryOptions> optionsMonitor, IScheduler scheduler = null, ILogger<ConsulServiceRegistry> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulClient | client | the Consul client to use |
IOptionsMonitor<ConsulDiscoveryOptions> | optionsMonitor | the configuration options |
IScheduler | scheduler | a scheduler to use for heart beats |
ILogger<ConsulServiceRegistry> | logger | an optional logger |
ConsulServiceRegistry(IConsulClient, ConsulDiscoveryOptions, IScheduler, ILogger<ConsulServiceRegistry>)
Initializes a new instance of the ConsulServiceRegistry class.
Declaration
public ConsulServiceRegistry(IConsulClient client, ConsulDiscoveryOptions options, IScheduler scheduler = null, ILogger<ConsulServiceRegistry> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulClient | client | the Consul client to use |
ConsulDiscoveryOptions | options | the configuration options |
IScheduler | scheduler | a scheduler to use for heart beats |
ILogger<ConsulServiceRegistry> | logger | an optional logger |
Methods
| Edit this page View SourceDeregister(IConsulRegistration)
Declaration
public void Deregister(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration |
DeregisterAsync(IConsulRegistration)
Deregister the provided registration in Consul
Declaration
public Task DeregisterAsync(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration | the registration to register |
Returns
Type | Description |
---|---|
Task | the task |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Declaration
protected void Finalize()
GetStatus<S>(IConsulRegistration)
Declaration
public S GetStatus<S>(IConsulRegistration registration)
where S : class
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration |
Returns
Type | Description |
---|---|
S |
Type Parameters
Name | Description |
---|---|
S |
GetStatusAsync(IConsulRegistration)
Get the status of the registration in Consul
Declaration
public Task<object> GetStatusAsync(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration | the registration to register |
Returns
Type | Description |
---|---|
Task<System.Object> | the status value |
GetStatusAsyncInternal(IConsulRegistration)
Declaration
public async Task<object> GetStatusAsyncInternal(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration |
Returns
Type | Description |
---|---|
Task<System.Object> |
Register(IConsulRegistration)
Declaration
public void Register(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration |
RegisterAsync(IConsulRegistration)
Register the provided registration in Consul
Declaration
public Task RegisterAsync(IConsulRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration | the registration to register |
Returns
Type | Description |
---|---|
Task | the task |
SetStatus(IConsulRegistration, String)
Declaration
public void SetStatus(IConsulRegistration registration, string status)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration | |
System.String | status |
SetStatusAsync(IConsulRegistration, String)
Set the status of the registration in Consul
Declaration
public Task SetStatusAsync(IConsulRegistration registration, string status)
Parameters
Type | Name | Description |
---|---|---|
IConsulRegistration | registration | the registration to register |
System.String | status | the status value to set |
Returns
Type | Description |
---|---|
Task | the task |
Implements
IServiceRegistry<>