Documentation ¶
Overview ¶
Package leveldb implements the key-value database interface using LevelDB.
Index ¶
- type Batch
- type Database
- func (d *Database) Delete(key string) error
- func (d *Database) Get(key string) (string, error)
- func (d *Database) GetBytes(key string) ([]byte, error)
- func (d *Database) Has(key string) (bool, error)
- func (d *Database) NewBatch() sortedkv.Batch
- func (d *Database) NewIterator() sortedkv.Iterator
- func (d *Database) NewIteratorWithPrefix(prefix string) sortedkv.Iterator
- func (d *Database) NewIteratorWithRange(start string, end string) sortedkv.Iterator
- func (d *Database) Put(key string, value string) error
- func (d *Database) PutBytes(key string, value []byte) error
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
Batch represents a batch and implements the batch interface.
type Database ¶
Database implements the Database interface and stores the values in memory.
func LoadDatabase ¶
LoadDatabase creates a new, empty Database.
func (*Database) Delete ¶
Delete removes the key from the key-value store. If the key is not present, an error is returned.
func (*Database) GetBytes ¶
GetBytes returns the value as []byte for given key if it is present in the store.
func (*Database) NewIterator ¶
NewIterator creates a new iterator.
func (*Database) NewIteratorWithPrefix ¶
NewIteratorWithPrefix creates a new iterator for a given prefix.
func (*Database) NewIteratorWithRange ¶
NewIteratorWithRange creates a new iterator based on a given range.
type Iterator ¶
Iterator provides an iterator over a key range.
func (*Iterator) ValueBytes ¶
ValueBytes returns the value converted to bytes of the current element.