Class ConsulServiceRegistrar
A registrar used to register a service in a Consul server
Inheritance
System.Object
ConsulServiceRegistrar
Namespace: Steeltoe.Discovery.Consul.Registry
Assembly: Steeltoe.Discovery.Consul.dll
Syntax
public class ConsulServiceRegistrar : object, IConsulServiceRegistrar, IServiceRegistrar
Constructors
| Edit this page View SourceConsulServiceRegistrar(IConsulServiceRegistry, IOptionsMonitor<ConsulDiscoveryOptions>, IConsulRegistration, ILogger<ConsulServiceRegistrar>)
Initializes a new instance of the ConsulServiceRegistrar class.
Declaration
public ConsulServiceRegistrar(IConsulServiceRegistry registry, IOptionsMonitor<ConsulDiscoveryOptions> optionsMonitor, IConsulRegistration registration, ILogger<ConsulServiceRegistrar> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulServiceRegistry | registry | the Consul service registry to use when doing registrations |
IOptionsMonitor<ConsulDiscoveryOptions> | optionsMonitor | configuration options to use |
IConsulRegistration | registration | the registration to register with Consul |
ILogger<ConsulServiceRegistrar> | logger | optional logger |
ConsulServiceRegistrar(IConsulServiceRegistry, ConsulDiscoveryOptions, IConsulRegistration, ILogger<ConsulServiceRegistrar>)
Initializes a new instance of the ConsulServiceRegistrar class.
Declaration
public ConsulServiceRegistrar(IConsulServiceRegistry registry, ConsulDiscoveryOptions options, IConsulRegistration registration, ILogger<ConsulServiceRegistrar> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulServiceRegistry | registry | the Consul service registry to use when doing registrations |
ConsulDiscoveryOptions | options | configuration options to use |
IConsulRegistration | registration | the registration to register with Consul |
ILogger<ConsulServiceRegistrar> | logger | optional logger |
Properties
| Edit this page View SourceRegistration
Gets the registration that the registrar is to register with Consul
Declaration
public IConsulRegistration Registration { get; }
Property Value
Type | Description |
---|---|
IConsulRegistration |
Methods
| Edit this page View SourceDeregister()
Deregister any registrations configured
Declaration
public void Deregister()
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()
Register()
Register any registrations configured
Declaration
public void Register()
Start()
Start the service registrar
Declaration
public void Start()
Implements
IDisposable