Documentation ¶
Index ¶
- Constants
- Variables
- func InitKV() error
- type EtcdClient
- func (c *EtcdClient) Delete(key string) (string, error)
- func (c *EtcdClient) Get(key string) (string, error)
- func (c *EtcdClient) List(key string, withPrefix bool) (map[string]string, error)
- func (c *EtcdClient) Lock(ctx context.Context, key string) error
- func (c *EtcdClient) Range(begin string, end string) (map[string]string, error)
- func (c *EtcdClient) Set(key string, value string) error
- func (c *EtcdClient) Unlock(ctx context.Context, key string) error
- func (c *EtcdClient) Watch(ctx context.Context, key string, withPrefix bool) <-chan KVAction
- type KVAction
- type KVMutex
- type KVStorage
Constants ¶
View Source
const ( KVActionTypeSet = "set" KVActionTypeDelete = "delete" )
Variables ¶
View Source
var ClientV3 *clientv3.Client
Functions ¶
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
func NewEtcdClient ¶
func NewEtcdClient(endpoints []string) (*EtcdClient, error)
type KVStorage ¶
type KVStorage interface { Get(string) (string, error) Set(string, string) error List(string, bool) (map[string]string, error) Delete(string) (string, error) Range(string, string) (map[string]string, error) Watch(context.Context, string, bool) <-chan KVAction Lock(context.Context, string) error Unlock(context.Context, string) error }
var KV KVStorage
Click to show internal directories.
Click to hide internal directories.