Documentation ¶
Index ¶
- type EtcdClient
- func (ec *EtcdClient) Close() error
- func (ec *EtcdClient) Delete(ctx context.Context, key string) (*clientv3.DeleteResponse, error)
- func (ec *EtcdClient) Get(ctx context.Context, key string) (*clientv3.GetResponse, error)
- func (ec *EtcdClient) Put(ctx context.Context, key, value string) (*clientv3.PutResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
EtcdClient represents the etcd client wrapper.
func NewEtcdClient ¶
func NewEtcdClient(endpoints []string, dialTimeout time.Duration) (*EtcdClient, error)
NewEtcdClient creates a new etcd client.
func (*EtcdClient) Close ¶
func (ec *EtcdClient) Close() error
Close closes the etcd client connection.
func (*EtcdClient) Delete ¶
func (ec *EtcdClient) Delete(ctx context.Context, key string) (*clientv3.DeleteResponse, error)
Delete deletes a key from etcd.
func (*EtcdClient) Get ¶
func (ec *EtcdClient) Get(ctx context.Context, key string) (*clientv3.GetResponse, error)
Get gets the value for a given key from etcd.
func (*EtcdClient) Put ¶
func (ec *EtcdClient) Put(ctx context.Context, key, value string) (*clientv3.PutResponse, error)
Put puts a key-value pair into etcd.
Click to show internal directories.
Click to hide internal directories.