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 ¶
GetKeyValue queries etcd key, returns mvccpb.KeyValue
func (*Client) GetLeaseSession ¶ added in v0.2.0
func (client *Client) GetLeaseSession(ctx context.Context, opts ...concurrency.SessionOption) (leaseSession *concurrency.Session, err error)
GetLeaseSession 创建租约会话
func (*Client) NewMutex ¶
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"` // 自动同步member list的间隔 AutoSyncInterval time.Duration `json:"autoAsyncInterval"` TTL int // 单位:s // contains filtered or unexported fields }
Config ...
type Mutex ¶
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 ¶ added in v0.2.0
IncipientKeyValues incipient key and values
Click to show internal directories.
Click to hide internal directories.