vault: Index | Files

package inmem

import ""


Package Files

inmem.go inmem_ha.go


var (
    PutDisabledError    = errors.New("put operations disabled in inmem backend")
    GetDisabledError    = errors.New("get operations disabled in inmem backend")
    DeleteDisabledError = errors.New("delete operations disabled in inmem backend")
    ListDisabledError   = errors.New("list operations disabled in inmem backend")

func NewInmem Uses

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

NewInmem constructs a new in-memory backend

func NewInmemHA Uses

func NewInmemHA(_ map[string]string, logger log.Logger) (physical.Backend, error)

NewInmemHA constructs a new in-memory HA backend. This is only for testing.

func NewTransactionalInmem Uses

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

Basically for now just creates a permit pool of size 1 so only one operation can run at a time

func NewTransactionalInmemHA Uses

func NewTransactionalInmemHA(_ map[string]string, logger log.Logger) (physical.Backend, error)

type InmemBackend Uses

type InmemBackend struct {
    // contains filtered or unexported fields

InmemBackend is an in-memory only physical backend. It is useful for testing and development situations where the data is not expected to be durable.

func (*InmemBackend) Delete Uses

func (i *InmemBackend) Delete(ctx context.Context, key string) error

Delete is used to permanently delete an entry

func (*InmemBackend) DeleteInternal Uses

func (i *InmemBackend) DeleteInternal(ctx context.Context, key string) error

func (*InmemBackend) FailDelete Uses

func (i *InmemBackend) FailDelete(fail bool)

func (*InmemBackend) FailGet Uses

func (i *InmemBackend) FailGet(fail bool)

func (*InmemBackend) FailList Uses

func (i *InmemBackend) FailList(fail bool)

func (*InmemBackend) FailPut Uses

func (i *InmemBackend) FailPut(fail bool)

func (*InmemBackend) Get Uses

func (i *InmemBackend) Get(ctx context.Context, key string) (*physical.Entry, error)

Get is used to fetch an entry

func (*InmemBackend) GetInternal Uses

func (i *InmemBackend) GetInternal(ctx context.Context, key string) (*physical.Entry, error)

func (*InmemBackend) List Uses

func (i *InmemBackend) List(ctx context.Context, prefix string) ([]string, error)

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

func (*InmemBackend) ListInternal Uses

func (i *InmemBackend) ListInternal(ctx context.Context, prefix string) ([]string, error)

func (*InmemBackend) Put Uses

func (i *InmemBackend) Put(ctx context.Context, entry *physical.Entry) error

Put is used to insert or update an entry

func (*InmemBackend) PutInternal Uses

func (i *InmemBackend) PutInternal(ctx context.Context, entry *physical.Entry) error

type InmemHABackend Uses

type InmemHABackend struct {
    // contains filtered or unexported fields

func (*InmemHABackend) HAEnabled Uses

func (i *InmemHABackend) HAEnabled() bool

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

func (*InmemHABackend) LockMapSize Uses

func (i *InmemHABackend) LockMapSize() int

LockMapSize is used in some tests to determine whether this backend has ever been used for HA purposes rather than simply for storage

func (*InmemHABackend) LockWith Uses

func (i *InmemHABackend) LockWith(key, value string) (physical.Lock, error)

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

type InmemLock Uses

type InmemLock struct {
    // contains filtered or unexported fields

InmemLock is an in-memory Lock implementation for the HABackend

func (*InmemLock) Lock Uses

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

func (*InmemLock) Unlock Uses

func (i *InmemLock) Unlock() error

func (*InmemLock) Value Uses

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

type TransactionalInmemBackend Uses

type TransactionalInmemBackend struct {

func (*TransactionalInmemBackend) Transaction Uses

func (t *TransactionalInmemBackend) Transaction(ctx context.Context, txns []*physical.TxnEntry) error

Implements the transaction interface

type TransactionalInmemHABackend Uses

type TransactionalInmemHABackend struct {

Package inmem imports 11 packages (graph) and is imported by 5 packages. Updated 2019-06-04. Refresh now. Tools for package owners.