leveldbhelper

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	DBPath string
}

type DB

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

func CreateDB

func CreateDB(conf *Conf) *DB

func (*DB) Close

func (dbInst *DB) Close()

func (*DB) Delete

func (dbInst *DB) Delete(key []byte, sync bool) error

func (*DB) Get

func (dbInst *DB) Get(key []byte) ([]byte, error)

func (*DB) GetIterator

func (dbInst *DB) GetIterator(startKey []byte, endKey []byte) iterator.Iterator

func (*DB) Open

func (dbInst *DB) Open()

func (*DB) Put

func (dbInst *DB) Put(key []byte, value []byte, sync bool) error

func (*DB) WriteBatch

func (dbInst *DB) WriteBatch(batch *leveldb.Batch, sync bool) error

type DBHandle

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

func (*DBHandle) Delete

func (h *DBHandle) Delete(key []byte, sync bool) error

func (*DBHandle) Get

func (h *DBHandle) Get(key []byte) ([]byte, error)

func (*DBHandle) GetIterator

func (h *DBHandle) GetIterator(startKey []byte, endKey []byte) *Iterator

nil startkey表示第一个可用键,nil endkey表示最后一个可用键之后的逻辑键。

func (*DBHandle) Put

func (h *DBHandle) Put(key []byte, value []byte, sync bool) error

func (*DBHandle) WriteBatch

func (h *DBHandle) WriteBatch(batch *UpdateBatch, sync bool) error

type Iterator

type Iterator struct {
	iterator.Iterator
}

func (*Iterator) Key

func (itr *Iterator) Key() []byte

type Provider

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

func NewProvider

func NewProvider(conf *Conf) *Provider

func (*Provider) Close

func (p *Provider) Close()

func (*Provider) GetDBHandle

func (p *Provider) GetDBHandle(dbName string) *DBHandle

type UpdateBatch

type UpdateBatch struct {
	KVs map[string][]byte
}

func NewUpdateBatch

func NewUpdateBatch() *UpdateBatch

func (*UpdateBatch) Delete

func (batch *UpdateBatch) Delete(key []byte)

func (*UpdateBatch) Len

func (batch *UpdateBatch) Len() int

func (*UpdateBatch) Put

func (batch *UpdateBatch) Put(key []byte, value []byte)

加1千伏

Jump to

Keyboard shortcuts

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