Documentation ¶
Index ¶
- Constants
- type LevelDBStore
- func (self *LevelDBStore) BatchCommit() error
- func (self *LevelDBStore) BatchDelete(key []byte)
- func (self *LevelDBStore) BatchPut(key []byte, value []byte)
- func (self *LevelDBStore) Close() error
- func (self *LevelDBStore) Delete(key []byte) error
- func (self *LevelDBStore) Get(key []byte) ([]byte, error)
- func (self *LevelDBStore) Has(key []byte) (bool, error)
- func (self *LevelDBStore) NewBatch()
- func (self *LevelDBStore) NewIterator(prefix []byte) common.StoreIterator
- func (self *LevelDBStore) Put(key []byte, value []byte) error
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 ¶
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) 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) NewIterator ¶
func (self *LevelDBStore) NewIterator(prefix []byte) common.StoreIterator
NewIterator return a iterator of leveldb with the key perfix
Click to show internal directories.
Click to hide internal directories.