consul

package
v1.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerDiscovery

func NewServerDiscovery(option Option) servicediscovery.IServiceDiscovery

func UseServiceDiscovery

func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(op Option) *Client

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) Register

func (c *Client) Register(r *consul.AgentServiceRegistration) 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) Destroy

func (register Registrar) Destroy() error

func (Registrar) GetAllInstances

func (register Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance

func (Registrar) GetHealthyInstances

func (register Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance

func (Registrar) GetName

func (register Registrar) GetName() string

func (*Registrar) Register

func (register *Registrar) Register() error

func (Registrar) Unregister

func (register Registrar) Unregister() error

func (Registrar) Update

func (register Registrar) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL