etcd

package
v0.0.0-...-cfdbbe0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EtcdMultipleBootstrapError = errors.New("client setup failed: multiple discovery or bootstrap flags specified, use either \"address\" or \"discovery_srv\"")
	EtcdAddressError           = errors.New("client setup failed: address must be valid URL (ex. 'scheme://host:port')")
	EtcdLockHeldError          = errors.New("lock already held")
	EtcdLockNotHeldError       = errors.New("lock not held")
	EtcdVersionUnknown         = errors.New("etcd: unknown API version")
)

Functions

func NewEtcdBackend

func NewEtcdBackend(conf map[string]string, logger log.Logger) (physical.Backend, error)

NewEtcdBackend constructs a etcd backend using a given machine address.

Types

type EtcdBackend

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

EtcdBackend is a physical backend that stores data at specific prefix within etcd. It is used for most production situations as it allows Vault to run on multiple machines in a highly-available manner.

func (*EtcdBackend) Delete

func (c *EtcdBackend) Delete(ctx context.Context, key string) error

func (*EtcdBackend) Get

func (c *EtcdBackend) Get(ctx context.Context, key string) (*physical.Entry, error)

func (*EtcdBackend) HAEnabled

func (e *EtcdBackend) HAEnabled() bool

func (*EtcdBackend) List

func (c *EtcdBackend) List(ctx context.Context, prefix string) ([]string, error)

func (*EtcdBackend) LockWith

func (c *EtcdBackend) LockWith(key, value string) (physical.Lock, error)

Lock is used for mutual exclusion based on the given key.

func (*EtcdBackend) Put

func (c *EtcdBackend) Put(ctx context.Context, entry *physical.Entry) error

type EtcdLock

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

EtcdLock implements a lock using and etcd backend.

func (*EtcdLock) Lock

func (c *EtcdLock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error)

func (*EtcdLock) Unlock

func (c *EtcdLock) Unlock() error

func (*EtcdLock) Value

func (c *EtcdLock) Value() (bool, string, error)

Jump to

Keyboard shortcuts

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