etcd

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend loads keys from etcd.

func NewBackend

func NewBackend(client *clientv3.Client, opts ...Option) *Backend

NewBackend creates a configuration loader that loads from etcd.

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, key string) ([]byte, error)

Get loads the given key from etcd.

func (*Backend) Name added in v0.3.0

func (b *Backend) Name() string

Name returns the name of the backend.

type Option added in v0.4.0

type Option func(*Backend)

Option is used to configure the Consul backend.

func WithPrefetch added in v0.4.0

func WithPrefetch() Option

WithPrefetch is used to prefetch the entire tree and cache it to avoid further round trips. If the WithPrefix option is used, will fetch the tree under the specified prefix.

func WithPrefix added in v0.4.0

func WithPrefix(prefix string) Option

WithPrefix is used to specify the prefix to prepend on every keys.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL