Documentation ¶
Index ¶
- Constants
- Variables
- func Verbose(message string, args ...interface{})
- type Action
- type ConsulClient
- func (r *ConsulClient) Delete(key string) error
- func (r *ConsulClient) Get(key string) (*Node, error)
- func (r *ConsulClient) GetNodeEvent(response *consulapi.KVPair) (event NodeChange)
- func (r *ConsulClient) List(path string) ([]*Node, error)
- func (r *ConsulClient) Mkdir(path string) error
- func (r *ConsulClient) RemovePath(path string) error
- func (r *ConsulClient) Set(key string, value string) error
- func (r *ConsulClient) Watch(key string, updateChannel chan NodeChange) (chan bool, error)
- 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) (response *etcd.Response, err 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) Watch(key string, updateChannel chan NodeChange) (chan bool, error)
- type KVStore
- type Node
- type NodeChange
Constants ¶
View Source
const ( UNKNOWN = 0 CHANGED = 1 DELETED = 2 )
View Source
const STORE_VERBOSE_LEVEL = 6
Variables ¶
View Source
var InvalidDirectoryErr = errors.New("Invalid directory specified")
View Source
var InvalidUrlErr = errors.New("Invalid URI error, please check backend url")
Functions ¶
Types ¶
type ConsulClient ¶
type ConsulClient struct { /* the consul client */ Client *consulapi.Client /* the write options for client */ WriteOptions *consulapi.WriteOptions }
func (*ConsulClient) Delete ¶
func (r *ConsulClient) Delete(key string) error
func (*ConsulClient) GetNodeEvent ¶
func (r *ConsulClient) GetNodeEvent(response *consulapi.KVPair) (event NodeChange)
func (*ConsulClient) Mkdir ¶
func (r *ConsulClient) Mkdir(path string) error
func (*ConsulClient) RemovePath ¶
func (r *ConsulClient) RemovePath(path string) error
func (*ConsulClient) Watch ¶
func (r *ConsulClient) Watch(key string, updateChannel chan NodeChange) (chan bool, error)
type EtcdStoreClient ¶
type EtcdStoreClient struct { /* a list of etcd hosts */ Hosts []string /* the etcd client - under the hood is http client which should be pooled i believe */ Client *etcd.Client }
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) (response *etcd.Response, err error)
func (*EtcdStoreClient) Mkdir ¶
func (r *EtcdStoreClient) Mkdir(path string) error
func (*EtcdStoreClient) RemovePath ¶
func (r *EtcdStoreClient) RemovePath(path string) error
func (*EtcdStoreClient) Watch ¶
func (r *EtcdStoreClient) Watch(key string, updateChannel chan NodeChange) (chan bool, error)
type KVStore ¶
type KVStore interface { /* 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 chan NodeChange) (chan bool, error) }
type Node ¶
type NodeChange ¶
Click to show internal directories.
Click to hide internal directories.