etcd

package
v0.0.0-...-fa06ddb Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetEntries will query the given prefix in etcd and returns a set of entries.
	GetEntries(prefix string) ([]string, error)
	// WatchPrefix starts watching every change for given prefix in etcd. When an
	// change is detected it will populate the responseChan when an *etcd.Response.
	WatchPrefix(prefix string, responseChan chan *etcd.Response)
}

Client is a wrapper arround the etcd client.

func NewClient

func NewClient(machines []string, cert, key, caCert string) (Client, error)

NewClient returns an *etcd.Client with a connection to the named machines. It will return an error if a connection to the cluster cannot be made. The parameter machines needs to be a full URL with schemas. e.g. "http://localhost:4001" will work, but "localhost:4001" will not.

type Publisher

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

Publisher yield endpoints stored in a certain etcd keyspace. Any kind of change in that keyspace is watched and will update the Publisher endpoints.

func NewPublisher

func NewPublisher(c Client, prefix string, f loadbalancer.Factory, logger log.Logger) (*Publisher, error)

NewPublisher returs a etcd publisher. Etcd will start watching the given prefix for changes and update the Publisher endpoints.

func (*Publisher) Endpoints

func (p *Publisher) Endpoints() ([]endpoint.Endpoint, error)

Endpoints implements the Publisher interface.

func (*Publisher) Stop

func (p *Publisher) Stop()

Stop terminates the Publisher.

Jump to

Keyboard shortcuts

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