zookeeper

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ZKNodeFilePrefix is prefixed to any "files" in ZooKeeper,
	// so that they do not collide with directory entries. Otherwise,
	// we cannot delete a file if the path is a full-prefix of another
	// key.
	ZKNodeFilePrefix = "_"
)

Variables

This section is empty.

Functions

func NewZooKeeperBackend

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

NewZooKeeperBackend constructs a ZooKeeper backend using the given API client and the prefix in the KV store.

Types

type ZooKeeperBackend

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

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

func (*ZooKeeperBackend) Delete

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

Delete is used to permanently delete an entry

func (*ZooKeeperBackend) Get

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

Get is used to fetch an entry

func (*ZooKeeperBackend) HAEnabled

func (c *ZooKeeperBackend) HAEnabled() bool

HAEnabled indicates whether the HA functionality should be exposed. Currently always returns true.

func (*ZooKeeperBackend) List

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

List is used ot list all the keys under a given prefix, up to the next prefix.

func (*ZooKeeperBackend) LockWith

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

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

func (*ZooKeeperBackend) Put

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

Put is used to insert or update an entry

type ZooKeeperHALock

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

ZooKeeperHALock is a ZooKeeper Lock implementation for the HABackend

func (*ZooKeeperHALock) Lock

func (i *ZooKeeperHALock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error)

func (*ZooKeeperHALock) Unlock

func (i *ZooKeeperHALock) Unlock() error

func (*ZooKeeperHALock) Value

func (i *ZooKeeperHALock) Value() (bool, string, error)

Jump to

Keyboard shortcuts

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