Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { // Put adds or updates entry for given key. Put(key, value []byte) // Get returns value for given key, ErrKeyNotFound if key // does not exist. Get(key []byte) ([]byte, error) // Delete removes entry for given key. Delete(key []byte) // Size returns the number of currently stored entries. Size() uint64 // Keys returns a channel that will iterate over keys of all // entries.This operation is synchronous, which means all // other operations will be blocked until all values are read. // You MUST read all values until the channel is closed. Best // to use `range`. Keys() <-chan []byte // KeysAndValues returns a channel that will iterate // over all keys and values of all entries. This operation // is synchronous, which means all other operations will be // blocked until all values are read. You MUST read all values // until the channel is closed. Best to use `range`. KeysAndValues() <-chan *Tuple // Save will write a snapshot of data into provided // directory path. If snapshot successful it will clean up // keeping only `hist` number of snapshots. This operation // is synchronous, which means all other operations will be // blocked until it is done. `hist` value of 0 will only // save current copy. Value of 1 will keep current and previous. Save(dir string, hist uint) error // Load will load data from snapshot. It will replace any // current data completely (not merge/update). It will // always load latest found snapshot version. This operation // is synchronous, which means all other operations will be // blocked until it is done. Load(dir string) error }
Click to show internal directories.
Click to hide internal directories.