Documentation ¶
Index ¶
- func NewServerDiscovery(option Option) servicediscovery.IServiceDiscovery
- func NewServerDiscoveryWithDI(configuration abstractions.IConfiguration, env *abstractions.HostEnvironment) servicediscovery.IServiceDiscovery
- func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)
- type Client
- type Option
- type Registrar
- func (register Registrar) Destroy() error
- func (register Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
- func (register Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
- func (register Registrar) GetName() string
- func (register *Registrar) Register() error
- func (register Registrar) Unregister() error
- func (register Registrar) Update() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServerDiscovery ¶
func NewServerDiscovery(option Option) servicediscovery.IServiceDiscovery
func NewServerDiscoveryWithDI ¶
func NewServerDiscoveryWithDI(configuration abstractions.IConfiguration, env *abstractions.HostEnvironment) servicediscovery.IServiceDiscovery
func UseServiceDiscovery ¶
func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns an implementation of the Client interface, wrapping a concrete consul client.
func (*Client) Deregister ¶
func (c *Client) Deregister(r *consul.AgentServiceRegistration) error
func (*Client) GetService ¶
func (c *Client) GetService(service, tag string, passingOnly bool, queryOpts *consul.QueryOptions) ([]*consul.ServiceEntry, *consul.QueryMeta, error)
type Option ¶
type Option struct { ENV *abstractions.HostEnvironment Address string `mapstructure:"address"` Token string `mapstructure:"token"` Tags []string `mapstructure:"tags"` }
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func (Registrar) GetAllInstances ¶
func (register Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
func (Registrar) GetHealthyInstances ¶
func (register Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
func (Registrar) Unregister ¶
Click to show internal directories.
Click to hide internal directories.