Documentation ¶
Index ¶
- func NewKVDBInstance(param *kvdb.KVParameter) (kvdb.Database, error)
- type LDBDatabase
- func (db *LDBDatabase) Close()
- func (db *LDBDatabase) Delete(key []byte) error
- func (db *LDBDatabase) Get(key []byte) ([]byte, error)
- func (db *LDBDatabase) Has(key []byte) (bool, error)
- func (db *LDBDatabase) LDB() *leveldb.DB
- func (db *LDBDatabase) NewBatch() kvdb.Batch
- func (db *LDBDatabase) NewIterator() kvdb.Iterator
- func (db *LDBDatabase) NewIteratorWithPrefix(prefix []byte) kvdb.Iterator
- func (db *LDBDatabase) NewIteratorWithRange(start []byte, limit []byte) kvdb.Iterator
- func (db *LDBDatabase) Open(path string, options map[string]interface{}) error
- func (ldb *LDBDatabase) OpenCloud(path string, options map[string]interface{}) error
- func (ldb *LDBDatabase) OpenMulti(path string, options map[string]interface{}) error
- func (ldb *LDBDatabase) OpenSingle(path string, options map[string]interface{}) error
- func (db *LDBDatabase) Path() string
- func (db *LDBDatabase) Put(key []byte, value []byte) error
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) 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) 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.