Documentation ¶
Index ¶
- Variables
- type KVIterator
- type KVStore
- type MockKV
- func (m *MockKV) Close()
- func (m *MockKV) Delete(key string) error
- func (m *MockKV) Get(key string) ([]byte, error)
- func (m *MockKV) GetJSON(key string, obj interface{}) error
- func (m *MockKV) NewIterator() KVIterator
- func (m *MockKV) NewIteratorWithRange(rng *Range) KVIterator
- func (m *MockKV) Put(key string, val []byte) error
- func (m *MockKV) PutJSON(key string, obj interface{}) error
- type Range
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNotFound = leveldb.ErrNotFound
ErrorNotFound signal error for not found
Functions ¶
This section is empty.
Types ¶
type KVIterator ¶
type KVIterator interface { Key() string Value() []byte ValueJSON(obj interface{}) error Next() bool Prev() bool Seek(string) bool Last() bool Release() }
KVIterator interface for key value iterators
type KVStore ¶
type KVStore interface { Put(key string, val []byte) error PutJSON(key string, val interface{}) error Get(key string) ([]byte, error) GetJSON(key string, obj interface{}) error Delete(key string) error NewIterator() KVIterator NewIteratorWithRange(keyRange *Range) KVIterator Close() }
KVStore interface for key value stores
func NewLDBKeyValueStore ¶
NewLDBKeyValueStore construct a new LevelDB instance of a KV store
type MockKV ¶
MockKV simple memory K/V store for testing
func (*MockKV) NewIterator ¶
func (m *MockKV) NewIterator() KVIterator
NewIterator for a new iterator
func (*MockKV) NewIteratorWithRange ¶
func (m *MockKV) NewIteratorWithRange(rng *Range) KVIterator
NewIterator for a new iterator
Click to show internal directories.
Click to hide internal directories.