Documentation ¶
Index ¶
- func CopyService(service *servicediscovery.Service) *servicediscovery.Service
- func NewServerDiscovery(option Option) servicediscovery.IServiceDiscovery
- func NewServerDiscoveryWithDI(configuration abstractions.IConfiguration, env *abstractions.HostEnvironment) servicediscovery.IServiceDiscovery
- func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)
- type Client
- func (c *Client) Deregister(r *consul.AgentServiceRegistration) error
- func (c *Client) GetService(service, tag string, passingOnly bool, queryOpts *consul.QueryOptions) ([]*consul.ServiceEntry, *consul.QueryMeta, error)
- func (c *Client) GetServices(queryOpts *consul.QueryOptions) []string
- func (c *Client) Register(r *consul.AgentServiceRegistration) error
- type Option
- type Registrar
- func (registrar *Registrar) Destroy() error
- func (registrar *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
- func (registrar *Registrar) GetAllServices() ([]*servicediscovery.Service, error)
- func (registrar *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
- func (registrar *Registrar) GetName() string
- func (registrar *Registrar) Register() error
- func (registrar *Registrar) Unregister() error
- func (registrar *Registrar) Update() error
- func (registrar *Registrar) Watch(opts ...servicediscovery.WatchOption) (servicediscovery.Watcher, error)
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyService ¶ added in v1.6.6
func CopyService(service *servicediscovery.Service) *servicediscovery.Service
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)
func (*Client) GetServices ¶ added in v1.6.6
func (c *Client) GetServices(queryOpts *consul.QueryOptions) []string
type Option ¶
type Option struct { ENV *abstractions.HostEnvironment Address string `mapstructure:"address"` Token string `mapstructure:"token"` Tags []string `mapstructure:"tags"` Health string `mapstructure:"health_check"` }
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func (*Registrar) GetAllInstances ¶
func (registrar *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
func (*Registrar) GetAllServices ¶ added in v1.6.6
func (registrar *Registrar) GetAllServices() ([]*servicediscovery.Service, error)
func (*Registrar) GetHealthyInstances ¶
func (registrar *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
func (*Registrar) Unregister ¶
func (*Registrar) Watch ¶ added in v1.6.6
func (registrar *Registrar) Watch(opts ...servicediscovery.WatchOption) (servicediscovery.Watcher, error)
Click to show internal directories.
Click to hide internal directories.