leveldb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKVDBInstance

func NewKVDBInstance(param *kvdb.KVParameter) (kvdb.Database, error)

GetInstance get instance of LDBDatabase

Types

type LDBDatabase

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

LDBDatabase define data structure of storage

func (*LDBDatabase) Close

func (db *LDBDatabase) Close()

Close close database instance

func (*LDBDatabase) Delete

func (db *LDBDatabase) Delete(key []byte) error

Delete deletes the key from the queue and database

func (*LDBDatabase) Get

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

Get returns the given key if it's present.

func (*LDBDatabase) Has

func (db *LDBDatabase) Has(key []byte) (bool, error)

Has if the given key exists

func (*LDBDatabase) LDB

func (db *LDBDatabase) LDB() *leveldb.DB

LDB returns ldb instance

func (*LDBDatabase) NewBatch

func (db *LDBDatabase) NewBatch() kvdb.Batch

NewBatch returns batch instance of ldb

func (*LDBDatabase) NewIterator

func (db *LDBDatabase) NewIterator() kvdb.Iterator

NewIterator returns an instance of Iterator

func (*LDBDatabase) NewIteratorWithPrefix

func (db *LDBDatabase) NewIteratorWithPrefix(prefix []byte) kvdb.Iterator

NewIteratorWithPrefix returns an instance of Iterator with prefix

func (*LDBDatabase) NewIteratorWithRange

func (db *LDBDatabase) NewIteratorWithRange(start []byte, limit []byte) kvdb.Iterator

NewIteratorWithRange returns an instance of Iterator with range

func (*LDBDatabase) Open

func (db *LDBDatabase) Open(path string, options map[string]interface{}) error

func (*LDBDatabase) OpenCloud

func (ldb *LDBDatabase) OpenCloud(path string, options map[string]interface{}) error

Open opens an instance of LDB with parameters (ldb path and other options)

func (*LDBDatabase) OpenMulti

func (ldb *LDBDatabase) OpenMulti(path string, options map[string]interface{}) error

Open opens an instance of LDB with parameters (ldb path and other options)

func (*LDBDatabase) OpenSingle

func (ldb *LDBDatabase) OpenSingle(path string, options map[string]interface{}) error

Open opens an instance of LDB with parameters (ldb path and other options)

func (*LDBDatabase) Path

func (db *LDBDatabase) Path() string

Path returns the path to the database directory.

func (*LDBDatabase) Put

func (db *LDBDatabase) Put(key []byte, value []byte) error

Put puts the given key / value to the queue

Jump to

Keyboard shortcuts

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