Versions in this module Expand all Collapse all v0 v0.1.0 Jul 8, 2015 Changes in this version + var ErrCannotLock = errors.New("Error acquiring the lock") + var ErrKeyModified = errors.New("Unable to complete atomic operation, key modified") + var ErrKeyNotFound = errors.New("Key not found in store") + var ErrNotImplemented = errors.New("Call not implemented in current backend") + var ErrNotReachable = errors.New("Api not reachable") + var ErrNotSupported = errors.New("Backend storage not supported yet, please choose another one") + var ErrPreviousNotSpecified = errors.New("Previous K/V pair should be provided for the Atomic operation") + func CreateEndpoints(addrs []string, scheme string) (entries []string) + func GetDirectory(key string) string + func Normalize(key string) string + func SplitKey(key string) (path []string) + type Backend string + const CONSUL + const ETCD + const ZK + type Config struct + ConnectionTimeout time.Duration + EphemeralTTL time.Duration + TLS *tls.Config + type KVPair struct + Key string + LastIndex uint64 + Value []byte + type LockOptions struct + TTL time.Duration + Value []byte + type Locker interface + Lock func() (<-chan struct{}, error) + Unlock func() error + type Store interface + AtomicDelete func(key string, previous *KVPair) (bool, error) + AtomicPut func(key string, value []byte, previous *KVPair, options *WriteOptions) (bool, *KVPair, error) + Close func() + Delete func(key string) error + DeleteTree func(directory string) error + Exists func(key string) (bool, error) + Get func(key string) (*KVPair, error) + List func(directory string) ([]*KVPair, error) + NewLock func(key string, options *LockOptions) (Locker, error) + Put func(key string, value []byte, options *WriteOptions) error + Watch func(key string, stopCh <-chan struct{}) (<-chan *KVPair, error) + WatchTree func(directory string, stopCh <-chan struct{}) (<-chan []*KVPair, error) + type WatchCallback func(entries ...*KVPair) + type WriteOptions struct + Ephemeral bool + Heartbeat time.Duration