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)
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"` }
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
Click to show internal directories.
Click to hide internal directories.