consul

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 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 Consul.

func NewBackend

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

NewBackend creates a configuration loader that loads from Consul.

func (*Backend) Get

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

Get loads the given key from Consul.

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