etcd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(conn db.Conn)

Run synchronizes state in `conn` with the Etcd cluster.

Types

type Store

type Store interface {
	Watch(path string, rateLimit time.Duration) chan struct{}
	Mkdir(dir string, ttl time.Duration) error
	GetTree(dir string) (Tree, error)
	Get(path string) (string, error)
	Delete(path string) error
	Create(path, value string, ttl time.Duration) error
	Set(path, value string, ttl time.Duration) error
	Refresh(path, value string, ttl time.Duration) error
	RefreshDir(dir string, ttl time.Duration) error
}

A Store implements a consistent distributed key value store similar to Etcd.

func NewMock

func NewMock() Store

NewMock creates a new mock etcd store for use of the unit tests.

func NewStore

func NewStore() Store

NewStore creates a new consensus store and returns it.

type Tree

type Tree struct {
	Key      string
	Value    string
	Children map[string]Tree
}

A Tree is a parsed subtree of the consensus store including each node's key, value and all of it's children recursively.

Jump to

Keyboard shortcuts

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