Documentation
¶
Index ¶
- func PrunePrefixes(prefixes []string) []string
- func ToBytes(val interface{}) ([]byte, error)
- type BaseKvdb
- func (b *BaseKvdb) CheckLockTimeout(key string, startTime time.Time, lockTimeout time.Duration)
- func (b *BaseKvdb) DeserializeAll(out []byte) (kvdb.KVPairs, error)
- func (b *BaseKvdb) GetLockTimeout() time.Duration
- func (b *BaseKvdb) LockTimedout(key string)
- func (b *BaseKvdb) SerializeAll(kvps kvdb.KVPairs) ([]byte, error)
- func (b *BaseKvdb) SetFatalCb(f kvdb.FatalErrorCB)
- func (b *BaseKvdb) SetLockTimeout(timeout time.Duration)
- type WatchUpdateQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrunePrefixes ¶
PrunePrefixes will return all the top level prefixes from a given list so that any enumerate on these prefixes will not end up returning duplicate keys
Types ¶
type BaseKvdb ¶
type BaseKvdb struct {
// LockTimeout is the maximum time any lock can be held
LockTimeout time.Duration
// FatalCb invoked for fatal errors
FatalCb kvdb.FatalErrorCB
// contains filtered or unexported fields
}
BaseKvdb provides common functionality across kvdb types
func (*BaseKvdb) CheckLockTimeout ¶
CheckLockTimeout checks lock timeout.
func (*BaseKvdb) DeserializeAll ¶
DeserializeAll Unmarshals a byte stream created from serializeAll into the kvdb tree.
func (*BaseKvdb) GetLockTimeout ¶
GetLockTimeout gets lock timeout.
func (*BaseKvdb) LockTimedout ¶
LockTimedout does lock timedout.
func (*BaseKvdb) SerializeAll ¶
SerializeAll Serializes all key value pairs to a byte array.
func (*BaseKvdb) SetFatalCb ¶
func (b *BaseKvdb) SetFatalCb(f kvdb.FatalErrorCB)
SetFatalCb callback is invoked when an unrecoverable KVDB error happens.
func (*BaseKvdb) SetLockTimeout ¶
SetLockTimeout has property such that if the lock is held past this duration, then a configured fatal callback is called.
type WatchUpdateQueue ¶
type WatchUpdateQueue interface {
// Enqueue will enqueue an update. It is non-blocking.
Enqueue(key string, kvp *kvdb.KVPair, err error)
// Dequeue will either return an element from front of the queue or
// will block until element becomes available
Dequeue() (string, *kvdb.KVPair, error)
}
WatchUpdateQueue is a producer consumer queue.
func NewWatchUpdateQueue ¶
func NewWatchUpdateQueue() WatchUpdateQueue
NewWatchUpdateQueue returns WatchUpdateQueue