etcd

package
v0.0.0-...-df3db6e Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

a cluster implementation backed by etcd

func Init

func Init(machines []string) (*Cluster, error)

Create the cluster by using the etcd-members

func InitTLS

func InitTLS(machines []string, key, cert, cacert string) (*Cluster, error)

Create the cluster with TLS and client cert

func (*Cluster) NewConfigurator

func (cc *Cluster) NewConfigurator(base string) (Configurator, error)

create a configurator for a subtree path.

func (*Cluster) NewJsonPersister

func (cc *Cluster) NewJsonPersister(pt string) (Persister, error)

Create a new JsonPersister at the given basepath.

func (*Cluster) NewManager

func (cc *Cluster) NewManager() (Configurator, error)

Returns the Configurator for the manager path

type Configurator

type Configurator interface {
	Register(pt, value string, ttl int) error
	Unregister(pt string)
	GetValues(pt string) ([]string, error)
}

A configurator supports operations on a subtree inside of etcd

type Persister

type Persister interface {
	Path(s string) string
	Put(k string, v interface{}) error
	PutTtl(k string, ttl uint64, v interface{}) error
	Get(k string, v interface{}) error
	GetAll(sorted, recursive bool, v interface{}) error
	Remove(k string) error
	RemoveDir(k string) error
	Chdir(p string) Persister
	Ls(p string) ([]string, error)
	RawClient() *etcd.Client
}

A persister can read/write values from/to etcd

Jump to

Keyboard shortcuts

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