Documentation ¶
Index ¶
- type Client
- func (client *Client) DelPrefix(ctx context.Context, prefix string) (deleted int64, err error)
- func (client *Client) GetKeyValue(ctx context.Context, key string) (kv *mvccpb.KeyValue, err error)
- func (client *Client) GetLeaseSession(ctx context.Context, opts ...concurrency.SessionOption) (leaseSession *concurrency.Session, err error)
- func (client *Client) GetPrefix(ctx context.Context, prefix string) (map[string]string, error)
- func (client *Client) GetValues(ctx context.Context, keys ...string) (map[string]string, error)
- func (client *Client) NewMutex(key string, opts ...concurrency.SessionOption) (mutex *Mutex, err error)
- func (client *Client) WatchPrefix(ctx context.Context, prefix string) (*Watch, error)
- type Config
- type Mutex
- type Watch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client ...
func (*Client) GetKeyValue ¶ added in v1.1.2
GetKeyValue queries etcd key, returns mvccpb.KeyValue
func (*Client) GetLeaseSession ¶ added in v1.1.2
func (client *Client) GetLeaseSession(ctx context.Context, opts ...concurrency.SessionOption) (leaseSession *concurrency.Session, err error)
GetLeaseSession 创建租约会话
func (*Client) NewMutex ¶ added in v1.1.2
func (client *Client) NewMutex(key string, opts ...concurrency.SessionOption) (mutex *Mutex, err error)
NewMutex ...
type Config ¶
type Config struct { Endpoints []string `json:"endpoints"` CertFile string `json:"certFile"` KeyFile string `json:"keyFile"` CaCert string `json:"caCert"` BasicAuth bool `json:"basicAuth"` UserName string `json:"userName"` Password string `json:"-"` ConnectTimeout time.Duration `json:"connectTimeout"` // 连接超时时间 Secure bool `json:"secure"` AutoSyncInterval time.Duration `json:"autoAsyncInterval"` // 自动同步member list的间隔 TTL int // 单位:s }
Config ...
type Mutex ¶ added in v1.1.2
type Mutex struct {
// contains filtered or unexported fields
}
Mutex ...
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
Watch A watch only tells the latest revision
func (*Watch) IncipientKeyValues ¶
IncipientKeyValues incipient key and values
Click to show internal directories.
Click to hide internal directories.