Documentation ¶
Index ¶
- type Iterator
- type MemDB
- func (db *MemDB) Close() error
- func (db *MemDB) Delete(key []byte) error
- func (db *MemDB) DeleteSync(key []byte) error
- func (db *MemDB) Get(key []byte) ([]byte, error)
- func (db *MemDB) Has(key []byte) (bool, error)
- func (db *MemDB) Iterator(start, end []byte) (Iterator, error)
- func (db *MemDB) IteratorNoMtx(start, end []byte) (Iterator, error)
- func (db *MemDB) Print() error
- func (db *MemDB) ReverseIterator(start, end []byte) (Iterator, error)
- func (db *MemDB) ReverseIteratorNoMtx(start, end []byte) (Iterator, error)
- func (db *MemDB) Set(key []byte, value []byte) error
- func (db *MemDB) SetSync(key []byte, value []byte) error
- func (db *MemDB) Stats() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemDB ¶
type MemDB struct {
// contains filtered or unexported fields
}
MemDB is an in-memory database backend using a B-tree for storage.
For performance reasons, all given and returned keys and values are pointers to the in-memory database, so modifying them will cause the stored values to be modified as well. All DB methods already specify that keys and values should be considered read-only, but this is especially important with MemDB.
func (*MemDB) Iterator ¶
Iterator implements DB. Takes out a read-lock on the database until the iterator is closed.
func (*MemDB) IteratorNoMtx ¶
IteratorNoMtx makes an iterator with no mutex.
func (*MemDB) ReverseIterator ¶
ReverseIterator implements DB. Takes out a read-lock on the database until the iterator is closed.
func (*MemDB) ReverseIteratorNoMtx ¶
ReverseIteratorNoMtx makes an iterator with no mutex.