Documentation
¶
Index ¶
- Constants
- Variables
- func New(endpoints []string, options *registry.Config) (registry.Registry, error)
- func Register()
- type Consul
- func (s *Consul) Datacenters() ([]string, error)
- func (s *Consul) Deregister(dereg *registry.CatalogDeregistration, options *registry.WriteOptions) error
- func (s *Consul) Leader() (string, error)
- func (s *Consul) Node(node string, options *registry.QueryOptions) (*registry.CatalogNode, error)
- func (s *Consul) Nodes(options *registry.QueryOptions) ([]*registry.Node, error)
- func (s *Consul) NodesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.Node, error)
- func (s *Consul) Register(reg *registry.CatalogRegistration, options *registry.WriteOptions) error
- func (s *Consul) Service(service, tag string, options *registry.QueryOptions) ([]*registry.CatalogService, error)
- func (s *Consul) ServiceRegister(serv *registry.AgentServiceRegistration) error
- func (s *Consul) ServiceWatch(service, tag string, options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.CatalogService, error)
- func (s *Consul) Services(options *registry.QueryOptions) (map[string][]string, error)
- func (s *Consul) ServicesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan map[string][]string, error)
Constants ¶
View Source
const ( // DefaultWatchWaitTime is how long we will block when watching // for services or nodes to change/update DefaultWatchWaitTime = 15 * time.Second )
Variables ¶
View Source
var ( // ErrMultipleEndpointsUnsupported is thrown when there are // multiple endpoints specified for Consul ErrMultipleEndpointsUnsupported = errors.New("consul does not support multiple endpoints") // ErrSessionRenew is thrown when the session can't be // renewed because the Consul version does not support sessions ErrSessionRenew = errors.New("cannot set or renew session for ttl, unable to operate on sessions") )
Functions ¶
Types ¶
type Consul ¶
Consul is the receiver type for the Store interface
func (*Consul) Datacenters ¶
Datacenters lists known datacenters
func (*Consul) Deregister ¶
func (s *Consul) Deregister(dereg *registry.CatalogDeregistration, options *registry.WriteOptions) error
Deregister removes a node, service or check
func (*Consul) Node ¶
func (s *Consul) Node(node string, options *registry.QueryOptions) (*registry.CatalogNode, error)
Node lists the services provided by a given node
func (*Consul) NodesWatch ¶
func (s *Consul) NodesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.Node, error)
NodesWatch watches for changes to the nodes in a given DC
func (*Consul) Register ¶
func (s *Consul) Register(reg *registry.CatalogRegistration, options *registry.WriteOptions) error
Register adds an entry into the consul backend
func (*Consul) Service ¶
func (s *Consul) Service(service, tag string, options *registry.QueryOptions) ([]*registry.CatalogService, error)
Service lists the nodes in a given service
func (*Consul) ServiceRegister ¶
func (s *Consul) ServiceRegister(serv *registry.AgentServiceRegistration) error
ServiceRegister add a local agent service and its check
func (*Consul) ServiceWatch ¶
func (s *Consul) ServiceWatch(service, tag string, options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan []*registry.CatalogService, error)
ServiceWatch watches for changes to the list of nodes under a given service
func (*Consul) ServicesWatch ¶
func (s *Consul) ServicesWatch(options *registry.QueryOptions, stopChan <-chan struct{}) (<-chan map[string][]string, error)
ServicesWatch watches for changes to the list of services in a given DC
Click to show internal directories.
Click to hide internal directories.