bolt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of this kvdb implementation.
	Name = "bolt-kv"
	// KvSnap is an option passed to designate this kvdb as a snap.
	KvSnap = "KvSnap"
	// KvUseInterface is an option passed that configures the mem to store
	// the values as interfaces instead of bytes. It will not create a
	// copy of the interface that is passed in. USE WITH CAUTION
	KvUseInterface = "KvUseInterface"
)

Variables

View Source
var (
	// ErrSnap is returned if an operation is not supported on a snap.
	ErrSnap = errors.New("operation not supported on snap")
	// ErrSnapWithInterfaceNotSupported is returned when a snap kv-mem is
	// created with KvUseInterface flag on
	ErrSnapWithInterfaceNotSupported = errors.New("snap kvdb not supported with interfaces")
	// ErrIllegalSelect is returned when an incorrect select function
	// implementation is detected.
	ErrIllegalSelect = errors.New("Illegal Select implementation")
)

Functions

func New

func New(
	domain string,
	machines []string,
	options map[string]string,
	fatalErrorCb kvdb.FatalErrorCB,
) (kvdb.Kvdb, error)

New constructs a new kvdb.Kvdb.

func Start

func Start(removeDir bool) error

func Stop

func Stop() error

func TestAll

func TestAll(t *testing.T)

func Version

func Version(url string, kvdbOptions map[string]string) (string, error)

Version returns the supported version of the mem implementation

Types

type WatchDistributor

type WatchDistributor interface {
	// Add creates a new watch queue to send updates
	Add() WatchUpdateQueue
	// Remove removes an existing watch queue
	Remove(WatchUpdateQueue)
	// NewUpdate is invoked to distribute a new update
	NewUpdate(w *watchUpdate)
}

WatchDistributor distributes updates to the watchers

func NewWatchDistributor

func NewWatchDistributor() WatchDistributor

NewWatchDistributor returns a new instance of the WatchDistrubtor interface

type WatchUpdateQueue

type WatchUpdateQueue interface {
	// Enqueue will enqueue an update. It is non-blocking.
	Enqueue(update *watchUpdate)
	// Dequeue will either return an element from front of the queue or
	// will block until element becomes available
	Dequeue() *watchUpdate
}

WatchUpdateQueue is a producer consumer queue.

func NewWatchUpdateQueue

func NewWatchUpdateQueue() WatchUpdateQueue

NewWatchUpdateQueue returns an instance of WatchUpdateQueue

Jump to

Keyboard shortcuts

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