Documentation ¶
Index ¶
- type DB
- type Iterator
- func (it *Iterator) Key() []byte
- func (it *Iterator) Next()
- func (it *Iterator) Prev()
- func (it *Iterator) Seek(seekKey []byte)
- func (it *Iterator) SeekForExclusivePrev(target []byte)
- func (it *Iterator) SeekForPrev(target []byte)
- func (it *Iterator) SeekToFirst()
- func (it *Iterator) SeekToLast()
- func (it *Iterator) Valid() bool
- func (it *Iterator) Value() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is an in-memory key/value database.
func New ¶
New creates a new initialized in-memory key/value DB. The initBlockSize is the size of first block. This DB is append-only, deleting an entry would remove entry node but not reclaim KV buffer.
func (*DB) Delete ¶
Delete deletes the value for the given key. It returns false if the DB does not contain the key.
func (*DB) Get ¶
Get gets the value for the given key. It returns nil if the DB does not contain the key.
func (*DB) NewIterator ¶
NewIterator returns a new Iterator for the lock store.
func (*DB) Put ¶
Put sets the value for the given key. It overwrites any previous value for that key.
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator iterates the entries in the DB.
func (*Iterator) SeekForExclusivePrev ¶
SeekForExclusivePrev locates the iterator to the last entry with key < target.
func (*Iterator) SeekForPrev ¶
SeekForPrev locates the iterator to the last entry with key <= target.
func (*Iterator) SeekToFirst ¶
func (it *Iterator) SeekToFirst()
SeekToFirst locates the iterator to the first entry.
func (*Iterator) SeekToLast ¶
func (it *Iterator) SeekToLast()
SeekToLast locates the iterator to the last entry.