Documentation
¶
Index ¶
- Variables
- type DB
- 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 Iterimpl
- func (i *Iterimpl) Error() error
- func (i *Iterimpl) First() bool
- func (i *Iterimpl) Key() []byte
- func (i *Iterimpl) Last() bool
- func (i *Iterimpl) Next() bool
- func (i *Iterimpl) Prev() bool
- func (Iterimpl) Release()
- func (i *Iterimpl) Seek(key []byte) bool
- func (Iterimpl) SetReleaser(releaser util.Releaser)
- func (i *Iterimpl) Valid() bool
- func (i *Iterimpl) Value() []byte
- type Provider
- type UpdateBatch
- type ValueHashtable
Constants ¶
This section is empty.
Variables ¶
var KeyNotFound = errors.New("key not found")
Functions ¶
This section is empty.
Types ¶
type DBHandle ¶
type DBHandle struct {
// contains filtered or unexported fields
}
DBHandle is an handle to a named db
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) WriteBatch ¶
func (h *DBHandle) WriteBatch(batch *UpdateBatch, sync bool) error
WriteBatch writes a batch in an atomic way
type Iterimpl ¶
type Iterimpl struct {
// contains filtered or unexported fields
}
func (Iterimpl) SetReleaser ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider enables to use a single leveldb as multiple logical leveldbs
func (*Provider) GetDBHandle ¶
GetDBHandle returns a handle to a named db
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 ¶
func (batch *UpdateBatch) Len() int
Len returns the number of entries in the batch
type ValueHashtable ¶
type ValueHashtable struct {
// contains filtered or unexported fields
}
ValueHashtable the set of Items
func NewHT ¶
func NewHT() *ValueHashtable
func (*ValueHashtable) Cleanup ¶
func (ht *ValueHashtable) Cleanup()
func (*ValueHashtable) Get ¶
func (ht *ValueHashtable) Get(key []byte) ([]byte, error)
Get item with key k from the hashtable
func (*ValueHashtable) Remove ¶
func (ht *ValueHashtable) Remove(key []byte) error
Remove item with key k from hashtable
func (*ValueHashtable) Size ¶
func (ht *ValueHashtable) Size() int
Size returns the number of the hashtable elements