Documentation ¶
Index ¶
- Constants
- func New(endpoints []string, options *store.Config) (store.Store, error)
- func Register()
- type Zookeeper
- func (s *Zookeeper) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) error
- func (s *Zookeeper) AtomicPut(ctx context.Context, key, value string, previous *store.KVPair, ...) error
- func (s *Zookeeper) Close()
- func (s *Zookeeper) Compact(ctx context.Context, rev uint64, wait bool) error
- func (s *Zookeeper) Create(ctx context.Context, key, value string, opts *store.WriteOptions) error
- func (s *Zookeeper) Delete(ctx context.Context, key string) error
- func (s *Zookeeper) DeleteTree(ctx context.Context, directory string) error
- func (s *Zookeeper) Exists(ctx context.Context, key string) (bool, error)
- func (s *Zookeeper) Get(ctx context.Context, key string) (pair *store.KVPair, err error)
- func (s *Zookeeper) List(ctx context.Context, directory string) ([]*store.KVPair, error)
- func (s *Zookeeper) NewLock(key string, options *store.LockOptions) store.Locker
- func (s *Zookeeper) NewTxn(ctx context.Context) (store.Txn, error)
- func (s *Zookeeper) Put(ctx context.Context, key, value string, opts *store.WriteOptions) error
- func (s *Zookeeper) Update(ctx context.Context, key, value string, opts *store.WriteOptions) error
- func (s *Zookeeper) Watch(ctx context.Context, key string, opt *store.WatchOptions) (<-chan *store.WatchResponse, error)
- func (s *Zookeeper) WatchTree(ctx context.Context, dir string, opt *store.WatchOptions) (<-chan *store.WatchResponse, error)
Constants ¶
const (
// SOH control character
SOH = "\x01"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Zookeeper ¶
type Zookeeper struct {
// contains filtered or unexported fields
}
Zookeeper is the receiver type for the Store interface
func (*Zookeeper) 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 (*Zookeeper) AtomicPut ¶
func (s *Zookeeper) AtomicPut(ctx context.Context, key, value string, previous *store.KVPair, _ *store.WriteOptions) 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 (*Zookeeper) Compact ¶
Compact compacts etcd KV history before the given rev. But not support in zookeeper.
func (*Zookeeper) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory
func (*Zookeeper) Get ¶
Get the value at "key", returns the last modified index to use in conjunction to Atomic calls
func (*Zookeeper) NewLock ¶
NewLock returns a handle to a lock struct which can be used to provide mutual exclusion on a key
func (*Zookeeper) Watch ¶
func (s *Zookeeper) Watch(ctx context.Context, key string, opt *store.WatchOptions) (<-chan *store.WatchResponse, 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 (*Zookeeper) WatchTree ¶
func (s *Zookeeper) WatchTree(ctx context.Context, dir string, opt *store.WatchOptions) (<-chan *store.WatchResponse, 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 .Providing a non-nil stopCh can be used to stop watching.