Documentation ¶
Overview ¶
Package etcdbk implements Etcd powered backend
Index ¶
- func GetName() string
- type Config
- type EtcdBackend
- func (b *EtcdBackend) Clock() clockwork.Clock
- func (b *EtcdBackend) Close() error
- func (b *EtcdBackend) CloseWatchers()
- func (b *EtcdBackend) CompareAndSwap(ctx context.Context, expected backend.Item, replaceWith backend.Item) (*backend.Lease, error)
- func (b *EtcdBackend) Create(ctx context.Context, item backend.Item) (*backend.Lease, error)
- func (b *EtcdBackend) Delete(ctx context.Context, key []byte) error
- func (b *EtcdBackend) DeleteRange(ctx context.Context, startKey, endKey []byte) error
- func (b *EtcdBackend) Get(ctx context.Context, key []byte) (*backend.Item, error)
- func (b *EtcdBackend) GetRange(ctx context.Context, startKey, endKey []byte, limit int) (*backend.GetResult, error)
- func (b *EtcdBackend) KeepAlive(ctx context.Context, lease backend.Lease, expires time.Time) error
- func (b *EtcdBackend) NewWatcher(ctx context.Context, watch backend.Watch) (backend.Watcher, error)
- func (b *EtcdBackend) Put(ctx context.Context, item backend.Item) (*backend.Lease, error)
- func (b *EtcdBackend) Update(ctx context.Context, item backend.Item) (*backend.Lease, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v1.0.0
type Config struct { // Nodes is a list of nodes Nodes []string `json:"peers,omitempty"` // Key is an optional prefix for etcd Key string `json:"prefix,omitempty"` // TLSKeyFile is a private key, implies mTLS client authentication TLSKeyFile string `json:"tls_key_file,omitempty"` // TLSCertFile is a client certificate implies mTLS client authentication TLSCertFile string `json:"tls_cert_file,omitempty"` // TLSCAFile is a trusted certificate authority certificate TLSCAFile string `json:"tls_ca_file,omitempty"` // Insecure turns off TLS Insecure bool `json:"insecure,omitempty"` // BufferSize is a default buffer size // used to pull events BufferSize int `json:"buffer_size,omitempty"` // DialTimeout specifies dial timeout DialTimeout time.Duration `json:"dial_timeout,omitempty"` // Username is an optional username for HTTPS basic authentication Username string `json:"username,omitempty"` // Password is initialized from password file, and is not read from the config Password string `json:"-"` // PasswordFile is an optional password file for HTTPS basic authentication, // expects path to a file PasswordFile string `json:"password_file,omitempty"` // MaxClientMsgSizeBytes optionally specifies the size limit on client send message size. // See https://github.com/etcd-io/etcd/blob/221f0cc107cb3497eeb20fb241e1bcafca2e9115/clientv3/config.go#L49 MaxClientMsgSizeBytes int `json:"etcd_max_client_msg_size_bytes,omitempty"` }
Config represents JSON config for etcd backend
type EtcdBackend ¶
func (*EtcdBackend) Clock ¶
func (b *EtcdBackend) Clock() clockwork.Clock
func (*EtcdBackend) Close ¶
func (b *EtcdBackend) Close() error
func (*EtcdBackend) CloseWatchers ¶
func (b *EtcdBackend) CloseWatchers()
CloseWatchers closes all the watchers without closing the backend
func (*EtcdBackend) CompareAndSwap ¶
func (b *EtcdBackend) CompareAndSwap(ctx context.Context, expected backend.Item, replaceWith backend.Item) (*backend.Lease, error)
CompareAndSwap compares item with existing item and replaces is with replaceWith item
func (*EtcdBackend) Delete ¶
func (b *EtcdBackend) Delete(ctx context.Context, key []byte) error
Delete deletes item by key
func (*EtcdBackend) DeleteRange ¶
func (b *EtcdBackend) DeleteRange(ctx context.Context, startKey, endKey []byte) error
DeleteRange deletes range of items with keys between startKey and endKey
func (*EtcdBackend) GetRange ¶
func (b *EtcdBackend) GetRange(ctx context.Context, startKey, endKey []byte, limit int) (*backend.GetResult, error)
GetRange returns query range
func (*EtcdBackend) NewWatcher ¶
NewWatcher returns a new event watcher
type Option ¶
type Option func(*options)
Option is an etcd backend functional option (used in tests).
func LeaseBucket ¶
LeaseBucket overrides the default lease bucketing size
Click to show internal directories.
Click to hide internal directories.