Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBatchClosed common error for batch closed ErrBatchClosed = errors.New("storage batch closed") )
Functions ¶
func KeyInRange ¶
KeyInRange check if key in the range [start, end)
Types ¶
type Batch ¶
type Batch interface { Put(key, val []byte) error Del(key []byte) error Commit() error Close() error }
Batch batch interface
type Iterator ¶
type Iterator interface { First() Last() Seek(seek []byte) Next() bool Prev() bool Key() []byte Value() []byte Valid() bool Close() error Err() error }
Iterator iter interface
type Storage ¶
type Storage interface { // if key not found, just return nil value Get(key []byte) ([]byte, error) // if any key not found, just return nil value MGet(keys ...[]byte) ([][]byte, error) Put(key, val []byte) error Del(key []byte) error PrefixIterator(prefix []byte) (Iterator, error) RangeIterator(start, end []byte) (Iterator, error) Batch() (Batch, error) Close() error GC() error }
Storage storage interface
Click to show internal directories.
Click to hide internal directories.