Documentation ¶
Index ¶
- type Client
- func (p *Client) CAS(ctx context.Context, key string, ...) error
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) Get(ctx context.Context, key string) (interface{}, error)
- func (c *Client) List(ctx context.Context, prefix string) ([]string, error)
- func (c *Client) WatchKey(ctx context.Context, key string, f func(interface{}) bool)
- func (c *Client) WatchPrefix(ctx context.Context, key string, f func(string, interface{}) bool)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements ring.KVClient for etcd.
func (*Client) CAS ¶
func (p *Client) CAS(ctx context.Context, key string, f func(in interface{}) (out interface{}, retry bool, err error)) error
CAS implements kv.Client. TODO Test with lease
type Config ¶
type Config struct { Endpoints []string `yaml:"endpoints"` DialTimeout formats.Duration `yaml:"dial_timeout"` MaxRetries int `yaml:"max_retries"` EnableTLS bool `yaml:"tls_enabled"` UserName string `yaml:"username"` Password formats.Hide `yaml:"password"` TLS iTLS.ClientConfig `yaml:",inline"` TTL formats.Duration `yaml:"ttl"` // use with lease ZapLogger *zap.Logger `yaml:"-"` }
Config for a new etcd.Client.
Click to show internal directories.
Click to hide internal directories.