client

package
v0.0.0-...-6f2a98a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is used to facilitate communications with a drax cluster

func New

func New(addr string, retryTimeout time.Duration, dialer rpc.DialerFn) *Client

New creates a new drax Client

func (*Client) AtomicDelete

func (c *Client) AtomicDelete(key string, previous *store.KVPair) (bool, error)

AtomicDelete is like `Delete`, but makes sure the key is not changed while performing the action.

func (*Client) AtomicPut

func (c *Client) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)

AtomicPut is like `Put`, but ensures there are no changes to the key while the action is performed If the key is changed, this returns an error and does not perorm the requested change

func (*Client) Close

func (c *Client) Close()

Close closes the underlying stream layer

func (*Client) Delete

func (c *Client) Delete(key string) error

Delete deletes the key

func (*Client) DeleteTree

func (c *Client) DeleteTree(dir string) error

DeleteTree deletes the specified dir and all subdirs

func (*Client) Exists

func (c *Client) Exists(key string) (bool, error)

Exists checks for the existence of a key

func (*Client) Get

func (c *Client) Get(key string) (*store.KVPair, error)

Get gets the k/v pair for the specified key

func (*Client) List

func (c *Client) List(prefix string) ([]*store.KVPair, error)

List lists the key/value pairs that have the provided key prefix

func (*Client) NewLock

func (c *Client) NewLock(key string, options *store.LockOptions) (store.Locker, error)

NewLock creates a new lock that can be used to lock access to the given key, like a sync.Mutex

func (*Client) Put

func (c *Client) Put(key string, value []byte, options *store.WriteOptions) error

Put sets the key to the given value

func (*Client) Watch

func (c *Client) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error)

Watch watches a key for changes and notifies the caller Watch is not implemented

func (*Client) WatchTree

func (c *Client) WatchTree(dir string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error)

WatchTree watches a dir and all subdirs for changes and notifies the caller

Jump to

Keyboard shortcuts

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