etcd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 16 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 implements the db.Client interface.

func NewClient

func NewClient(hosts []string, prefix string) (*Client, error)

NewClient creates a new Client with connections to etcd already established.

func (*Client) Delete

func (c *Client) Delete(obj db.Entity) error

Delete removes the object from the store.

func (*Client) Dump

func (c *Client) Dump(dir string) (string, error)

Dump yields a database dump of the keyspace we manage. It will be contained in a tarball based on the timestamp of the dump. If a dir is provided, it will be placed under that directory.

func (*Client) Get

func (c *Client) Get(obj db.Entity) error

Get retrieves the item from etcd's key/value store and then populates obj with its data.

func (*Client) List

func (c *Client) List(obj db.Entity) ([]db.Entity, error)

List populates obj with the list of the db in the collection corresponding to the entity. Will follow dirs until the ends of the earth trying to deserialize the entity.

func (*Client) Prefix

func (c *Client) Prefix() string

Prefix returns a copy of the string used to make the database prefix.

func (*Client) Set

func (c *Client) Set(obj db.Entity) error

Set takes the object and commits it to the database.

func (*Client) Watch

func (c *Client) Watch(obj db.Entity) (chan db.Entity, chan error)

Watch watches a given object for changes.

func (*Client) WatchAll

func (c *Client) WatchAll(obj db.Entity) (chan db.Entity, chan error)

WatchAll watches all items under the given entity's

func (*Client) WatchAllStop

func (c *Client) WatchAllStop(obj db.Entity) error

WatchAllStop stops

func (*Client) WatchStop

func (c *Client) WatchStop(obj db.Entity) error

WatchStop stops a watch for a given object.

Jump to

Keyboard shortcuts

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