Class ConsulHealthContributor
A Health contributor which provides the health of the Consul server connection
Inheritance
System.Object
ConsulHealthContributor
Namespace: Steeltoe.Discovery.Consul.Discovery
Assembly: Steeltoe.Discovery.Consul.dll
Syntax
public class ConsulHealthContributor : IHealthContributor
Constructors
| Edit this page View SourceConsulHealthContributor(IConsulClient, IOptionsMonitor<ConsulDiscoveryOptions>, ILogger<ConsulHealthContributor>)
Initializes a new instance of the ConsulHealthContributor class.
Declaration
public ConsulHealthContributor(IConsulClient client, IOptionsMonitor<ConsulDiscoveryOptions> optionsMonitor, ILogger<ConsulHealthContributor> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulClient | client | a Consul client to use for health checks |
IOptionsMonitor<ConsulDiscoveryOptions> | optionsMonitor | configuration options |
ILogger<ConsulHealthContributor> | logger | optional logger |
ConsulHealthContributor(IConsulClient, ConsulDiscoveryOptions, ILogger<ConsulHealthContributor>)
Initializes a new instance of the ConsulHealthContributor class.
Declaration
public ConsulHealthContributor(IConsulClient client, ConsulDiscoveryOptions options, ILogger<ConsulHealthContributor> logger = null)
Parameters
Type | Name | Description |
---|---|---|
IConsulClient | client | a Consul client to use for health checks |
ConsulDiscoveryOptions | options | configuration options |
ILogger<ConsulHealthContributor> | logger | optional logger |
Properties
| Edit this page View SourceId
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Edit this page View SourceHealth()
Compute the health of the Consul server connection
Declaration
public HealthCheckResult Health()
Returns
Type | Description |
---|---|
HealthCheckResult | the health check result |