leveldbhelper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func CreateNewDB

func CreateNewDB(levelDbPath string) *DB

tested

func (*DB) Close

func (db *DB) Close()

func (*DB) Delete

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

Delete deletes the given key

func (*DB) Get

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

func (*DB) GetIterator

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

func (*DB) GetIteratorWithPrefix

func (db *DB) GetIteratorWithPrefix(prefix []byte) iterator.Iterator

func (*DB) Open

func (db *DB) Open()

tested

func (*DB) Put

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

sync 옵션은 write buffer를 file io와 항상 동기화 시키는지 여부 sync false면 시스템 crash발생시 정보의 손실 가능성이 있다.

func (*DB) Snapshot

func (db *DB) Snapshot() (map[string][]byte, error)

func (*DB) WriteBatch

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

WriteBatch writes a batch

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) GetIteratorWithPrefix

func (h *DBHandle) GetIteratorWithPrefix() iterator.Iterator

func (*DBHandle) Put

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

func (*DBHandle) Snapshot

func (h *DBHandle) Snapshot() (map[string][]byte, error)

func (*DBHandle) WriteBatch

func (h *DBHandle) WriteBatch(KVs map[string][]byte, sync bool) error

type DBProvider

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

func CreateNewDBProvider

func CreateNewDBProvider(levelDbPath string) *DBProvider

func (*DBProvider) Close

func (p *DBProvider) Close()

func (*DBProvider) GetDBHandle

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

Jump to

Keyboard shortcuts

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