etcd

package
v0.0.0-...-3fa228a Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: MIT Imports: 17 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) error
	GetTree(dir string) (Tree, error)
	Get(path string) (string, error)
	Delete(path string) error
	Create(path, value string, ttl time.Duration) error
	Update(path, value string, ttl time.Duration) error
	Set(path, value 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