consul

package
v0.0.0-...-355bd2f Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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

func New

func New(endpoints []string, options *registry.Config) (registry.Registry, error)

New creates a new Consul client given a list of endpoints and optional tls config

func Register

func Register()

Register registers consul to libreg

Types

type Consul

type Consul struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Consul is the receiver type for the Store interface

func (*Consul) Datacenters

func (s *Consul) Datacenters() ([]string, error)

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

func (s *Consul) Nodes(options *registry.QueryOptions) ([]*registry.Node, error)

Nodes lists all nodes in a given DC

func (*Consul) Register

func (s *Consul) Register(reg *registry.CatalogRegistration, options *registry.WriteOptions) error

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

func (s *Consul) Services(options *registry.QueryOptions) (map[string][]string, error)

Services lists all services in a given DC

Jump to

Keyboard shortcuts

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