Documentation ¶
Index ¶
- Variables
- type Client
- func (c *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 CloserFunc
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var NopCloser = CloserFunc(func() error { return nil })
NopCloser does nothing.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements ring.KVClient for etcd.
func Mock ¶
Mock returns a Mock Etcd client. Inspired by https://github.com/ligato/cn-infra/blob/master/db/keyval/etcd/mocks/embeded_etcd.go.
func (*Client) CAS ¶
func (c *Client) CAS(ctx context.Context, key string, f func(in interface{}) (out interface{}, retry bool, err error)) error
CAS implements kv.Client.
type CloserFunc ¶
type CloserFunc func() error
CloserFunc is like http.HandlerFunc but for io.Closers.
type Config ¶
type Config struct { Endpoints []string `yaml:"endpoints"` DialTimeout time.Duration `yaml:"dial_timeout"` MaxRetries int `yaml:"max_retries"` EnableTLS bool `yaml:"tls_enabled"` CertFile string `yaml:"tls_cert_path"` KeyFile string `yaml:"tls_key_path"` TrustedCAFile string `yaml:"tls_ca_path"` InsecureSkipVerify bool `yaml:"tls_insecure_skip_verify"` }
Config for a new etcd.Client.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
Click to show internal directories.
Click to hide internal directories.