Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Name is the name of this kvdb implementation. Name = "kv-mem" // 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 ¶
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
Click to show internal directories.
Click to hide internal directories.