Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type EtcdStoreClient
- func (r *EtcdStoreClient) CreateNode(response *etcd.Node) *Node
- func (r *EtcdStoreClient) Delete(key string) error
- func (r *EtcdStoreClient) Get(key string) (*Node, error)
- func (r *EtcdStoreClient) GetNodeEvent(response *etcd.Response) (event NodeChange)
- func (r *EtcdStoreClient) GetRaw(key string) (*etcd.Response, error)
- func (r *EtcdStoreClient) List(path string) ([]*Node, error)
- func (r *EtcdStoreClient) Mkdir(path string) error
- func (r *EtcdStoreClient) RemovePath(path string) error
- func (r *EtcdStoreClient) Set(key string, value string) error
- func (r *EtcdStoreClient) URL() string
- func (r *EtcdStoreClient) ValidateKey(key string) string
- func (r *EtcdStoreClient) Watch(key string, updateChannel NodeUpdateChannel) (chan bool, error)
- type KVStore
- type Node
- type NodeChange
- type NodeUpdateChannel
Constants ¶
View Source
const ( DEFAULT_KV_STORE = "etcd://localhost:4001" VERBOSE_LEVEL = 6 )
View Source
const ( UNKNOWN = 0 CHANGED = 1 DELETED = 2 )
Variables ¶
View Source
var ( InvalidUrlErr = errors.New("Invalid URI error, please check backend url") InvalidDirectoryErr = errors.New("Invalid directory specified") )
Functions ¶
This section is empty.
Types ¶
type EtcdStoreClient ¶
type EtcdStoreClient struct {
// contains filtered or unexported fields
}
func (*EtcdStoreClient) CreateNode ¶
func (r *EtcdStoreClient) CreateNode(response *etcd.Node) *Node
func (*EtcdStoreClient) Delete ¶
func (r *EtcdStoreClient) Delete(key string) error
func (*EtcdStoreClient) GetNodeEvent ¶
func (r *EtcdStoreClient) GetNodeEvent(response *etcd.Response) (event NodeChange)
func (*EtcdStoreClient) GetRaw ¶
func (r *EtcdStoreClient) GetRaw(key string) (*etcd.Response, error)
func (*EtcdStoreClient) Mkdir ¶
func (r *EtcdStoreClient) Mkdir(path string) error
func (*EtcdStoreClient) RemovePath ¶
func (r *EtcdStoreClient) RemovePath(path string) error
func (*EtcdStoreClient) URL ¶
func (r *EtcdStoreClient) URL() string
func (*EtcdStoreClient) ValidateKey ¶
func (r *EtcdStoreClient) ValidateKey(key string) string
func (*EtcdStoreClient) Watch ¶
func (r *EtcdStoreClient) Watch(key string, updateChannel NodeUpdateChannel) (chan bool, error)
type KVStore ¶
type KVStore interface { /* get the url for the kv store */ URL() string /* retrieve a key from the store */ Get(key string) (*Node, error) /* Get a list of all the nodes under the path */ List(path string) ([]*Node, error) /* set a key in the store */ Set(key string, value string) error /* delete a key from the store */ Delete(key string) error /* recursively delete a path */ RemovePath(path string) error /* Create a directory node */ Mkdir(path string) error /* watch for changes on the key */ Watch(key string, updateChannel NodeUpdateChannel) (chan bool, error) }
func NewKVStore ¶
type Node ¶
type NodeChange ¶
type NodeUpdateChannel ¶
type NodeUpdateChannel chan NodeChange
Click to show internal directories.
Click to hide internal directories.