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
- func (config *Config) Build() (*Client, error)
- func (config *Config) GetName() string
- func (config *Config) MustBuild() *Client
- func (config *Config) MustSingleton() *Client
- func (config *Config) SetAutoSyncInterval(autoSyncInterval time.Duration) *Config
- func (config *Config) SetBasicAuth(auth bool) *Config
- func (config *Config) SetCaCert(ca string) *Config
- func (config *Config) SetCertFile(cert string) *Config
- func (config *Config) SetConnectTimeout(timeout time.Duration) *Config
- func (config *Config) SetEnableTrace(enableTrace bool) *Config
- func (config *Config) SetEndpoints(endpoint []string) *Config
- func (config *Config) SetKeyFile(key string) *Config
- func (config *Config) SetName(Name string) *Config
- func (config *Config) SetPassword(pwd string) *Config
- func (config *Config) SetSecure(secure bool) *Config
- func (config *Config) SetUserName(userName string) *Config
- func (config *Config) Singleton() (*Client, error)
- 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 ¶
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 { Name string `json:"name"` 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的间隔 EnableTrace bool `json:"enableTrace" toml:"enableTrace"` TTL int // 单位:s }
Config ...
func (*Config) MustSingleton ¶ added in v3.2.29
func (*Config) SetAutoSyncInterval ¶ added in v3.2.24
SetAutoSyncInterval ...
func (*Config) SetBasicAuth ¶ added in v3.2.24
SetBasicAuth ...
func (*Config) SetCertFile ¶ added in v3.2.24
SetCertFile ...
func (*Config) SetConnectTimeout ¶ added in v3.2.24
SetConnectTimeout ...
func (*Config) SetEnableTrace ¶ added in v3.2.29
SetEnableTrace ...
func (*Config) SetEndpoints ¶ added in v3.2.24
SetEndpoints ...
func (*Config) SetKeyFile ¶ added in v3.2.24
SetKeyFile ...
func (*Config) SetPassword ¶ added in v3.2.24
SetPassword ...
func (*Config) SetUserName ¶ added in v3.2.25
SetUserName ...
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.