Documentation ¶
Index ¶
- func New(addrs []string, options *store.Config) (store.Store, error)
- type Etcd
- func (s *Etcd) AtomicDelete(key string, previous *store.KVPair) (bool, error)
- func (s *Etcd) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
- func (s *Etcd) Close()
- func (s *Etcd) Delete(key string) error
- func (s *Etcd) DeleteTree(directory string) error
- func (s *Etcd) Exists(key string) (bool, error)
- func (s *Etcd) Get(key string) (pair *store.KVPair, err error)
- func (s *Etcd) List(directory string) ([]*store.KVPair, error)
- func (s *Etcd) NewLock(key string, options *store.LockOptions) (lock store.Locker, err error)
- func (s *Etcd) Put(key string, value []byte, opts *store.WriteOptions) error
- func (s *Etcd) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error)
- func (s *Etcd) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
Etcd is the receiver type for the Store interface
func (*Etcd) AtomicDelete ¶
AtomicDelete deletes a value at "key" if the key has not been modified in the meantime, throws an error if this is the case
func (*Etcd) AtomicPut ¶
func (s *Etcd) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
AtomicPut put a value at "key" if the key has not been modified in the meantime, throws an error if this is the case
func (*Etcd) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory
func (*Etcd) Get ¶
Get the value at "key", returns the last modified index to use in conjunction to Atomic calls
func (*Etcd) NewLock ¶
NewLock returns a handle to a lock struct which can be used to provide mutual exclusion on a key
func (*Etcd) Watch ¶
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.