leveldb

package
v0.0.0-...-fa720cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKVInterface

func NewKVInterface(path string, opts kvi.Options) (kvi.KVInterface, error)

NewKVInterface creates new LevelDB backed KVInterface at `path`

Types

type LevelKV

type LevelKV struct {
	// contains filtered or unexported fields
}

LevelKV implements the generic key value interface using the leveldb library

func (*LevelKV) BulkWrite

func (l *LevelKV) BulkWrite(u func(tx kvi.KVBulkWrite) error) error

BulkWrite is a copy of Update, with no special function yet...

func (*LevelKV) Close

func (l *LevelKV) Close() error

Close database

func (*LevelKV) Delete

func (l *LevelKV) Delete(id []byte) error

Delete removes a key/value from a kvstore

func (*LevelKV) DeletePrefix

func (l *LevelKV) DeletePrefix(prefix []byte) error

DeletePrefix deletes all elements in kvstore that begin with prefix `id`

func (*LevelKV) Get

func (l *LevelKV) Get(id []byte) ([]byte, error)

Get retrieves the value of key `id`

func (*LevelKV) HasKey

func (l *LevelKV) HasKey(id []byte) bool

HasKey returns true if the key is exists in kvstore

func (*LevelKV) Set

func (l *LevelKV) Set(id []byte, val []byte) error

Set value in kvstore

func (*LevelKV) Update

func (l *LevelKV) Update(u func(tx kvi.KVTransaction) error) error

Update runs an alteration transaction of the kvstore

func (*LevelKV) View

func (l *LevelKV) View(u func(it kvi.KVIterator) error) error

View run iterator on bolt keyvalue store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL