Documentation ¶
Index ¶
- func MakeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) error
- type Cfg
- type Client
- func (cli *Client) AddKv(key, value string, leaseId int64) (*clientv3.PutResponse, error)
- func (cli *Client) DeleteKeys(key string) error
- func (cli *Client) Equal(host string) bool
- func (cli *Client) GetEndpoints() []string
- func (cli *Client) GetEtcdConn() *clientv3.Client
- func (cli *Client) GetPassWord() string
- func (cli *Client) GetUserName() string
- func (cli *Client) GetValue(key string) (*clientv3.GetResponse, error)
- func (cli *Client) GrantLease(ttl int64) (*clientv3.LeaseGrantResponse, error)
- func (cli *Client) KeepAliveOnce(leaseId clientv3.LeaseID) (*clientv3.LeaseKeepAliveResponse, error)
- func (cli *Client) Leases() (*clientv3.LeaseLeasesResponse, error)
- func (cli *Client) RangeAllKvs() (*clientv3.GetResponse, error)
- func (cli *Client) RevokeLease(leaseId clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
- func (cli *Client) SetEndpoints(host string)
- func (cli *Client) Status(ctx context.Context) error
- func (cli *Client) TimeToAliveTime(leaseId clientv3.LeaseID) (*clientv3.LeaseTimeToLiveResponse, error)
- func (cli *Client) UpdateValue(key, value string) (*clientv3.PutResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 连接etcd服务端的client
func (*Client) DeleteKeys ¶
func (*Client) GetEndpoints ¶
func (*Client) GetEtcdConn ¶
func (*Client) GetPassWord ¶
func (*Client) GetUserName ¶
func (*Client) GrantLease ¶
func (cli *Client) GrantLease(ttl int64) (*clientv3.LeaseGrantResponse, error)
GrantLease 创建租约ID
func (*Client) KeepAliveOnce ¶
func (*Client) Leases ¶
func (cli *Client) Leases() (*clientv3.LeaseLeasesResponse, error)
Leases 获取多有的LeaseId
func (*Client) RangeAllKvs ¶
func (cli *Client) RangeAllKvs() (*clientv3.GetResponse, error)
func (*Client) RevokeLease ¶
RevokeLease 清楚对应的lease
func (*Client) SetEndpoints ¶
func (*Client) TimeToAliveTime ¶
func (cli *Client) TimeToAliveTime(leaseId clientv3.LeaseID) (*clientv3.LeaseTimeToLiveResponse, error)
TimeToAliveTime 获取当前租约剩余时间
func (*Client) UpdateValue ¶
func (cli *Client) UpdateValue(key, value string) (*clientv3.PutResponse, error)
Click to show internal directories.
Click to hide internal directories.