Documentation ¶
Index ¶
- type DecodeFn
- type EncodeFn
- type Itr
- type MemoryDB
- func (db *MemoryDB) Delete(key []byte) error
- func (db *MemoryDB) Find(key []byte) keyvaluedb.Iterator
- func (db *MemoryDB) First() keyvaluedb.Iterator
- func (db *MemoryDB) Last() keyvaluedb.Iterator
- func (db *MemoryDB) MockWriteError(err error)
- func (db *MemoryDB) Read(key []byte, value any) (bool, error)
- func (db *MemoryDB) StartTx() (keyvaluedb.DBTransaction, error)
- func (db *MemoryDB) Write(key []byte, value any) error
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryDB ¶
type MemoryDB struct {
// contains filtered or unexported fields
}
MemoryDB is meant to be used as mockup for unit and integration tests where needed, not in production
func New ¶
New creates a new mock key value db that currently uses map as storage NB! map is probably not the best solution and should be replaced with binary search tree
func (*MemoryDB) Find ¶
func (db *MemoryDB) Find(key []byte) keyvaluedb.Iterator
Find returns the closest binary search match
func (*MemoryDB) First ¶
func (db *MemoryDB) First() keyvaluedb.Iterator
First returns forward iterator to the first element in DB
func (*MemoryDB) Last ¶
func (db *MemoryDB) Last() keyvaluedb.Iterator
Last returns reverse iterator from the last element in DB
func (*MemoryDB) MockWriteError ¶
func (*MemoryDB) StartTx ¶
func (db *MemoryDB) StartTx() (keyvaluedb.DBTransaction, error)
Click to show internal directories.
Click to hide internal directories.