leveldbstore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: Apache-2.0 Imports: 6 Imported by: 1

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
}

func NewLevelDBStore

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

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() dbstore.Batch

NewBatch create db batch

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