Documentation ¶
Index ¶
- func SetEtcdAddrs(li ...string) option
- func SetEtcdDialTimeout(t time.Duration) option
- func SetEtcdLeaseTTL(ttl int64) option
- func SetEtcdTimeoutFunc(f func()) option
- type EtcdAccess
- func (this *EtcdAccess) Close()
- func (this *EtcdAccess) Get(key string) (result *mvccpb.KeyValue, err error)
- func (this *EtcdAccess) GetPathAll(pathname string) (*clientv3.GetResponse, error)
- func (this *EtcdAccess) Put(key, val string) error
- func (this *EtcdAccess) PutForever(key, val string) error
- func (this *EtcdAccess) RevokeLease(leaseid clientv3.LeaseID)
- func (this *EtcdAccess) SetReFunc(fs ...reFunc)
- func (this *EtcdAccess) Start() (err error)
- func (this *EtcdAccess) WatchPrefix(pathname string, f func(md *clientv3.Event))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EtcdAccess ¶
type EtcdAccess struct {
// contains filtered or unexported fields
}
etcd的连接器
func NewEtcdAccess ¶
func NewEtcdAccess(opts ...option) (result *EtcdAccess)
func (*EtcdAccess) Close ¶
func (this *EtcdAccess) Close()
func (*EtcdAccess) Get ¶
func (this *EtcdAccess) Get(key string) (result *mvccpb.KeyValue, err error)
获取一个KEY的数据
func (*EtcdAccess) GetPathAll ¶
func (this *EtcdAccess) GetPathAll(pathname string) (*clientv3.GetResponse, error)
获取指定路径下的所有数据
func (*EtcdAccess) RevokeLease ¶
func (this *EtcdAccess) RevokeLease(leaseid clientv3.LeaseID)
撤回指定Lease的Keep
func (*EtcdAccess) Start ¶
func (this *EtcdAccess) Start() (err error)
func (*EtcdAccess) WatchPrefix ¶
func (this *EtcdAccess) WatchPrefix(pathname string, f func(md *clientv3.Event))
监听某个目录,f方法为收到信息后的回调逻辑,回调新协程上
Click to show internal directories.
Click to hide internal directories.