etcd

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: 9 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 Etcd backend

Types

type ByEtcdServiceID

type ByEtcdServiceID []EtcdServiceNode

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

func (ByEtcdServiceID) Len

func (se ByEtcdServiceID) Len() int

func (ByEtcdServiceID) Less

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

func (ByEtcdServiceID) Swap

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

type Etcd

type Etcd struct {
	Client client.Client
	API    client.KeysAPI
	Prefix string
}

Etcd is a service discovery backend for CoreOS etcd

func NewEtcdConfig

func NewEtcdConfig(raw interface{}) (*Etcd, error)

NewEtcdConfig creates a new service discovery backend for etcd

func (*Etcd) CheckForUpstreamChanges

func (c *Etcd) CheckForUpstreamChanges(backendName, backendTag string) bool

CheckForUpstreamChanges checks another etcd node for changes

func (*Etcd) Deregister

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

Deregister removes this instance from the registry

func (*Etcd) MarkForMaintenance

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

MarkForMaintenance removes this instance from the registry

func (*Etcd) SendHeartbeat

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

SendHeartbeat refreshes the TTL of this associated etcd node

type EtcdServiceNode

type EtcdServiceNode struct {
	ID      string   `json:"id"`
	Name    string   `json:"name"`
	Address string   `json:"address"`
	Port    int      `json:"port"`
	Tags    []string `json:"tags"`
}

EtcdServiceNode is an instance of a service

Jump to

Keyboard shortcuts

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