etcd

package
v2.4.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(addrs []string) (store.Store, error)

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

Types

type Etcd

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

Etcd is the receiver type for the Store interface

func (*Etcd) Close

func (s *Etcd) Close()

Close closes the client connection

func (*Etcd) Delete

func (s *Etcd) Delete(key string, recursive bool) error

Delete a value by given key

func (*Etcd) Exists

func (s *Etcd) Exists(key string) (bool, error)

Exists checks if the key exists inside the store

func (*Etcd) Get

func (s *Etcd) Get(key string) (pair *store.KVPair, err error)

Get the value, returns the last modified

func (*Etcd) GetTree

func (s *Etcd) GetTree(directory string) ([]*store.KVPair, error)

GetTree get child nodes of a given directory

func (*Etcd) List

func (s *Etcd) List(dir string) ([]string, error)

List all the node's name in a directory

func (*Etcd) Put

func (s *Etcd) Put(key string, value []byte) error

Put a value

func (*Etcd) Watch

func (s *Etcd) Watch(key string, ctx context.Context, recursive bool, index uint64) (<-chan *store.Event, error)

Watch for changes on a "key" It returns a channel that will receive changes or pass on errors. Upon creation, the current value will first be sent to the channel. Providing a non-nil stopCh can be used to stop watching.

func (*Etcd) WatchTree

func (s *Etcd) WatchTree(directory string, ctx context.Context, index uint64) (<-chan *store.Event, error)

WatchTree watches for changes on a "directory" It returns a channel that will receive changes or pass on errors. Upon creating a watch, the current childs values will be sent to the channel.

Jump to

Keyboard shortcuts

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