Documentation ¶
Index ¶
- Constants
- type TEtcdClient
- func (etcd *TEtcdClient) Count(prefix string) (int64, error)
- func (etcd *TEtcdClient) Del(key string) (int64, error)
- func (etcd *TEtcdClient) DelAll(prefix string) (int64, error)
- func (etcd *TEtcdClient) Get(key string) (string, error)
- func (etcd *TEtcdClient) GetAll(prefix string) (map[string]string, int64, error)
- func (etcd *TEtcdClient) GetClient() *clientv3.Client
- func (etcd *TEtcdClient) GetHead() string
- func (etcd *TEtcdClient) GetKV() clientv3.KV
- func (etcd *TEtcdClient) GetLimit(prefix string, limit int) (map[string]string, int64, error)
- func (etcd *TEtcdClient) GetMaxKey(prefix string) (string, error)
- func (etcd *TEtcdClient) GetRange(startKey string, endKey string) (map[string]string, int64, error)
- func (etcd *TEtcdClient) GetRangeLimit(startKey string, limit int) (map[string]string, int64, error)
- func (etcd *TEtcdClient) HGet(getResp *clientv3.GetResponse, err error) (map[string]string, int64, error)
- func (etcd *TEtcdClient) Set(key string, value string, args ...int) error
- func (etcd *TEtcdClient) SetHead(head string)
Constants ¶
View Source
const ( ConnTimeout = time.Second * 3 OperTimeout = time.Second * 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TEtcdClient ¶
type TEtcdClient struct {
// contains filtered or unexported fields
}
func (*TEtcdClient) Count ¶
func (etcd *TEtcdClient) Count(prefix string) (int64, error)
*
- Count By prefix data
func (*TEtcdClient) Del ¶ added in v1.1.3
func (etcd *TEtcdClient) Del(key string) (int64, error)
*
- Delete One
func (*TEtcdClient) DelAll ¶ added in v1.1.3
func (etcd *TEtcdClient) DelAll(prefix string) (int64, error)
*
- Delete All By Prefix
func (*TEtcdClient) GetMaxKey ¶
func (etcd *TEtcdClient) GetMaxKey(prefix string) (string, error)
*
- 获取最大键,用于获取最大ID,比如Key_001 ... Key_102 最大为Key_102
func (*TEtcdClient) GetRangeLimit ¶
func (etcd *TEtcdClient) GetRangeLimit(startKey string, limit int) (map[string]string, int64, error)
*
- Get By Range,Contains StartKey[startKey,N-1]
func (*TEtcdClient) HGet ¶
func (etcd *TEtcdClient) HGet(getResp *clientv3.GetResponse, err error) (map[string]string, int64, error)
*
- hash get,获取一个map键值对结构,对于排序的结构从ectd查出来是有序的,但map不保证有序性,所以放入map后是无序的
func (*TEtcdClient) Set ¶
func (etcd *TEtcdClient) Set(key string, value string, args ...int) error
*
- Set Value
func (*TEtcdClient) SetHead ¶
func (etcd *TEtcdClient) SetHead(head string)
Click to show internal directories.
Click to hide internal directories.