libkv: github.com/docker/libkv/store/zookeeper Index | Files

package zookeeper

import "github.com/docker/libkv/store/zookeeper"

Index

Package Files

zookeeper.go

Constants

const (
    // SOH control character
    SOH = "\x01"
)

func New Uses

func New(endpoints []string, options *store.Config) (store.Store, error)

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

func Register Uses

func Register()

Register registers zookeeper to libkv

type Zookeeper Uses

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

Zookeeper is the receiver type for the Store interface

func (*Zookeeper) AtomicDelete Uses

func (s *Zookeeper) AtomicDelete(key string, previous *store.KVPair) (bool, error)

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 Uses

func (s *Zookeeper) AtomicPut(key string, value []byte, previous *store.KVPair, _ *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 (*Zookeeper) Close Uses

func (s *Zookeeper) Close()

Close closes the client connection

func (*Zookeeper) Delete Uses

func (s *Zookeeper) Delete(key string) error

Delete a value at "key"

func (*Zookeeper) DeleteTree Uses

func (s *Zookeeper) DeleteTree(directory string) error

DeleteTree deletes a range of keys under a given directory

func (*Zookeeper) Exists Uses

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

Exists checks if the key exists inside the store

func (*Zookeeper) Get Uses

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

Get the value at "key", returns the last modified index to use in conjunction to Atomic calls

func (*Zookeeper) List Uses

func (s *Zookeeper) List(directory string) ([]*store.KVPair, error)

List child nodes of a given directory

func (*Zookeeper) NewLock Uses

func (s *Zookeeper) NewLock(key string, options *store.LockOptions) (lock store.Locker, err error)

NewLock returns a handle to a lock struct which can be used to provide mutual exclusion on a key

func (*Zookeeper) Put Uses

func (s *Zookeeper) Put(key string, value []byte, opts *store.WriteOptions) error

Put a value at "key"

func (*Zookeeper) Watch Uses

func (s *Zookeeper) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, 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 Uses

func (s *Zookeeper) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, 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.

Package zookeeper imports 5 packages (graph) and is imported by 298 packages. Updated 2017-12-26. Refresh now. Tools for package owners.