leveldbhelper

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFormatVersionMismatch

func IsFormatVersionMismatch(err error) bool

Types

type Conf

type Conf struct {
	DBPath                string
	ExpectedFormatVersion 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) IsEmpty

func (dbInst *DB) IsEmpty() (bool, error)

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

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 ErrFormatVersionMismatch

type ErrFormatVersionMismatch struct {
	DBPath                string
	ExpectedFormatVersion string
	DataFormatVersion     string
}

func (*ErrFormatVersionMismatch) Error

func (e *ErrFormatVersionMismatch) Error() string

type FileLock

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

func NewFileLock

func NewFileLock(filePath string) *FileLock

func (*FileLock) Lock

func (f *FileLock) Lock() error

func (*FileLock) Unlock

func (f *FileLock) Unlock()

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, error)

func (*Provider) Close

func (p *Provider) Close()

func (*Provider) GetDBHandle

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

func (*Provider) GetDataFormat

func (p *Provider) GetDataFormat() (string, error)

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)

Jump to

Keyboard shortcuts

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