boltbk

package
v2.7.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package boltbk implements BoltDB backed backend for standalone instances This is a legacy backend which only exists for backward compatibility purposes

Production Teleport clusters should be using either etcd or DynamoDB backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) (bool, error)

Exists returns true if backend has been used before

func GetBucket

func GetBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)

func GetName

func GetName() string

GetName() is a part of the backend API and returns the name of this backend as shown in 'storage/type' section of Teleport YAML config

func New

func New(params backend.Params) (backend.Backend, error)

New initializes and returns a fully created BoltDB backend. It's a properly implemented Backend.NewFunc, part of a backend API

func UpsertBucket

func UpsertBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)

Types

type BoltBackend

type BoltBackend struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BoltBackend is a boltdb-based backend used in tests and standalone mode

func (*BoltBackend) AcquireLock

func (b *BoltBackend) AcquireLock(token string, ttl time.Duration) error

func (*BoltBackend) Clock

func (b *BoltBackend) Clock() clockwork.Clock

Clock returns clock assigned to the backend

func (*BoltBackend) Close

func (b *BoltBackend) Close() error

Close closes the backend resources

func (*BoltBackend) CompareAndSwapVal

func (b *BoltBackend) CompareAndSwapVal(bucket []string, key string, newData []byte, prevData []byte, ttl time.Duration) error

CompareAndSwapVal compares and swap values in atomic operation, succeeds if prevData matches the value stored in the databases, requires prevData as a non-empty value. Returns trace.CompareFailed in case if value did not match

func (*BoltBackend) CreateVal added in v1.0.0

func (b *BoltBackend) CreateVal(bucket []string, key string, val []byte, ttl time.Duration) error

func (*BoltBackend) DeleteBucket

func (b *BoltBackend) DeleteBucket(path []string, bucket string) error

func (*BoltBackend) DeleteKey

func (b *BoltBackend) DeleteKey(path []string, key string) error

func (*BoltBackend) GetItems

func (b *BoltBackend) GetItems(path []string) ([]backend.Item, error)

GetItems fetches keys and values and returns them to the caller.

func (*BoltBackend) GetKeys

func (b *BoltBackend) GetKeys(path []string) ([]string, error)

func (*BoltBackend) GetVal

func (b *BoltBackend) GetVal(path []string, key string) ([]byte, error)

func (*BoltBackend) ReleaseLock

func (b *BoltBackend) ReleaseLock(token string) error

func (*BoltBackend) UpsertItems

func (bk *BoltBackend) UpsertItems(bucket []string, items []backend.Item) error

func (*BoltBackend) UpsertVal

func (b *BoltBackend) UpsertVal(path []string, key string, val []byte, ttl time.Duration) error

Jump to

Keyboard shortcuts

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