Table of Contents

Class ConsulRegistration

Namespace
Steeltoe.Discovery.Consul.Registry
Assembly
Steeltoe.Discovery.Consul.dll

The registration to be used when registering with the Consul server

public class ConsulRegistration : IConsulRegistration, IServiceInstance
Inheritance
ConsulRegistration
Implements
Inherited Members

Constructors

ConsulRegistration(AgentServiceRegistration, IOptionsMonitor<ConsulDiscoveryOptions>)

Initializes a new instance of the ConsulRegistration class.

public ConsulRegistration(AgentServiceRegistration agentServiceRegistration, IOptionsMonitor<ConsulDiscoveryOptions> optionsMonitor)

Parameters

agentServiceRegistration AgentServiceRegistration

a Consul service registration to use

optionsMonitor IOptionsMonitor<ConsulDiscoveryOptions>

configuration options

ConsulRegistration(AgentServiceRegistration, ConsulDiscoveryOptions)

Initializes a new instance of the ConsulRegistration class.

public ConsulRegistration(AgentServiceRegistration agentServiceRegistration, ConsulDiscoveryOptions options)

Parameters

agentServiceRegistration AgentServiceRegistration

a Consul service registration to use

options ConsulDiscoveryOptions

configuration options

Properties

Host

Gets the hostname of the registered ServiceInstance

public string Host { get; }

Property Value

string

InstanceId

Gets the instance id to use for registration

public string InstanceId { get; }

Property Value

string

IsSecure

Gets a value indicating whether if the port of the registered ServiceInstance is https or not

public bool IsSecure { get; }

Property Value

bool

Metadata

Gets the key value pair metadata associated with the service instance

public IDictionary<string, string> Metadata { get; }

Property Value

IDictionary<string, string>

Port

Gets the port of the registered ServiceInstance

public int Port { get; }

Property Value

int

Service

Gets the Consul service registration

public AgentServiceRegistration Service { get; }

Property Value

AgentServiceRegistration

ServiceId

Gets the service id as register by the DiscoveryClient

public string ServiceId { get; }

Property Value

string

Tags

public string[] Tags { get; }

Property Value

string[]

Uri

Gets the service uri address

public Uri Uri { get; }

Property Value

Uri

Methods

CreateRegistration(ConsulDiscoveryOptions, IApplicationInstanceInfo)

Create a Consul registration

public static ConsulRegistration CreateRegistration(ConsulDiscoveryOptions options, IApplicationInstanceInfo applicationInfo)

Parameters

options ConsulDiscoveryOptions

configuration options to use

applicationInfo IApplicationInstanceInfo

Info about this app instance

Returns

ConsulRegistration

a registration