Documentation ¶
Index ¶
- type Conf
- type DB
- func (dbInst *DB) Close()
- func (dbInst *DB) Delete(key []byte, sync bool) error
- func (dbInst *DB) Get(key []byte) ([]byte, error)
- func (dbInst *DB) GetIterator(startKey []byte, endKey []byte) iterator.Iterator
- func (dbInst *DB) Open()
- func (dbInst *DB) Put(key []byte, value []byte, sync bool) error
- func (dbInst *DB) WriteBatch(batch *leveldb.Batch, sync bool) error
- type DBHandle
- func (h *DBHandle) Delete(key []byte, sync bool) error
- func (h *DBHandle) Get(key []byte) ([]byte, error)
- func (h *DBHandle) GetIterator(startKey []byte, endKey []byte) *Iterator
- func (h *DBHandle) Put(key []byte, value []byte, sync bool) error
- func (h *DBHandle) WriteBatch(batch *UpdateBatch, sync bool) error
- type Iterator
- type Provider
- type UpdateBatch
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 - a wrapper on an actual store
func (*DB) Delete ¶
Delete deletes the given key
func (*DB) Get ¶
Get returns the value for the given key
func (*DB) GetIterator ¶
GetIterator returns an iterator over key-value store. The iterator should be released after the use. The resultset contains all the keys that are present in the db between the startKey (inclusive) and the endKey (exclusive). A nil startKey represents the first available key and a nil endKey represent a logical key after the last available key
func (*DB) Put ¶
Put saves the key/value
type DBHandle ¶
type DBHandle struct {
// contains filtered or unexported fields
}
DBHandle is an handle to a named db
func (*DBHandle) Delete ¶
Delete deletes the given key
func (*DBHandle) Get ¶
Get returns the value for the given key
func (*DBHandle) GetIterator ¶
GetIterator gets an handle to iterator. The iterator should be released after the use. The resultset contains all the keys that are present in the db between the startKey (inclusive) and the endKey (exclusive). A nil startKey represents the first available key and a nil endKey represent a logical key after the last available key
func (*DBHandle) Put ¶
Put saves the key/value
func (*DBHandle) WriteBatch ¶
func (h *DBHandle) WriteBatch(batch *UpdateBatch, sync bool) error
WriteBatch writes a batch in an atomic way
type Iterator ¶
Iterator extends actual leveldb iterator
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider enables to use a single leveldb as multiple logical leveldbs
type UpdateBatch ¶
UpdateBatch encloses the details of multiple `updates`
func NewUpdateBatch ¶
func NewUpdateBatch() *UpdateBatch
NewUpdateBatch constructs an instance of a Batch
func (*UpdateBatch) Delete ¶
func (batch *UpdateBatch) Delete(key []byte)
Delete deletes a Key and associated value
func (*UpdateBatch) Len ¶ added in v1.4.0
func (batch *UpdateBatch) Len() int
Len returns the number of entries in the batch