Documentation ¶
Overview ¶
Package db_etcd Mode Name: etcd Mode Desc: 模块功能描述
Index ¶
- type ETCDClient
- func (ec *ETCDClient) Close()
- func (ec *ETCDClient) Connect() error
- func (ec *ETCDClient) Del(key string) error
- func (ec *ETCDClient) Get(key string, withPrefix bool) (*clientv3.GetResponse, error)
- func (ec *ETCDClient) Init(conf *ETCDConf) chaoserrors.CError
- func (ec *ETCDClient) Lock(key string) error
- func (ec *ETCDClient) Put(key, value string) error
- func (ec *ETCDClient) Unlock(key string) error
- type ETCDConf
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
}
func NewETCDClient ¶
func NewETCDClient() *ETCDClient
func (*ETCDClient) Close ¶
func (ec *ETCDClient) Close()
Close 关闭etcd客户端
关闭前应该保证业务已经退出,否则退出时自动关闭所有的锁可能会导致业务异常
func (*ETCDClient) Connect ¶
func (ec *ETCDClient) Connect() error
func (*ETCDClient) Get ¶
func (ec *ETCDClient) Get(key string, withPrefix bool) (*clientv3.GetResponse, error)
Get 获取存储记录
func (*ETCDClient) Init ¶
func (ec *ETCDClient) Init(conf *ETCDConf) chaoserrors.CError
Click to show internal directories.
Click to hide internal directories.