Version: v1.1.0 Latest Latest

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

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




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 = "_"


This section is empty.


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.


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)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL