consul

package
v0.0.0-...-8e8583c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigHook

func ConfigHook(raw interface{}) (discovery.DiscoveryService, error)

ConfigHook is the hook to register with the Consul backend

Types

type ByServiceID

type ByServiceID []*consul.ServiceEntry

ByServiceID implements the Sort interface because Go can't sort without it.

func (ByServiceID) Len

func (se ByServiceID) Len() int

func (ByServiceID) Less

func (se ByServiceID) Less(i, j int) bool

func (ByServiceID) Swap

func (se ByServiceID) Swap(i, j int)

type Consul

type Consul struct{ consul.Client }

Consul is a service discovery backend for Hashicorp Consul

func NewConsulConfig

func NewConsulConfig(config interface{}) (*Consul, error)

NewConsulConfig creates a new service discovery backend for Consul

func (Consul) CheckForUpstreamChanges

func (c Consul) CheckForUpstreamChanges(backendName, backendTag string) bool

CheckForUpstreamChanges runs the health check

func (*Consul) Deregister

func (c *Consul) Deregister(service *discovery.ServiceDefinition)

Deregister removes the node from Consul.

func (*Consul) MarkForMaintenance

func (c *Consul) MarkForMaintenance(service *discovery.ServiceDefinition)

MarkForMaintenance removes the node from Consul.

func (*Consul) SendHeartbeat

func (c *Consul) SendHeartbeat(service *discovery.ServiceDefinition)

SendHeartbeat writes a TTL check status=ok to the consul store. If consul has never seen this service, we register the service and its TTL check.

Jump to

Keyboard shortcuts

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