leveldbstore

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.2.0

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