leveldbstore

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BITSPERKEY = 10

used to compute the size of bloom filter bits array . too small will lead to high false positive rate.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBStore

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

LevelDB store

func NewLevelDBStore

func NewLevelDBStore(file string) (*LevelDBStore, error)

NewLevelDBStore return LevelDBStore instance

func NewMemLevelDBStore added in v1.5.1

func NewMemLevelDBStore() (*LevelDBStore, error)

func (*LevelDBStore) BatchCommit

func (self *LevelDBStore) BatchCommit() error

BatchCommit commit batch to leveldb

func (*LevelDBStore) BatchDelete

func (self *LevelDBStore) BatchDelete(key []byte)

BatchDelete delete a key to leveldb batch

func (*LevelDBStore) BatchPut

func (self *LevelDBStore) BatchPut(key []byte, value []byte)

BatchPut put a key-value pair to leveldb batch

func (*LevelDBStore) Close

func (self *LevelDBStore) Close() error

Close leveldb

func (*LevelDBStore) Delete

func (self *LevelDBStore) Delete(key []byte) error

Delete the the in leveldb

func (*LevelDBStore) Get

func (self *LevelDBStore) Get(key []byte) ([]byte, error)

Get the value of a key from leveldb

func (*LevelDBStore) Has

func (self *LevelDBStore) Has(key []byte) (bool, error)

Has return whether the key is exist in leveldb

func (*LevelDBStore) NewBatch

func (self *LevelDBStore) NewBatch()

NewBatch start commit batch

func (*LevelDBStore) NewIterator

func (self *LevelDBStore) NewIterator(prefix []byte) common.StoreIterator

NewIterator return a iterator of leveldb with the key prefix

func (*LevelDBStore) Put

func (self *LevelDBStore) Put(key []byte, value []byte) error

Put a key-value pair to leveldb

Jump to

Keyboard shortcuts

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