Documentation
¶
Overview ¶
Package kvdb 迭代器实现
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrNotFound ¶
ErrNotFound return true or false when key not found
Types ¶
type Batch ¶
type Batch interface {
ValueSize() int
Write() error
Reset()
Put(key []byte, value []byte) error
Delete(key []byte) error
PutIfAbsent(key []byte, value []byte) error
Exist(key []byte) bool
}
Batch Batch操作的接口
type Database ¶
type Database interface {
Open(path string, options map[string]interface{}) error
Put(key []byte, value []byte) error
Get(key []byte) ([]byte, error)
Has(key []byte) (bool, error)
Delete(key []byte) error
Close()
NewBatch() Batch
NewIteratorWithRange(start []byte, limit []byte) Iterator
NewIteratorWithPrefix(prefix []byte) Iterator
}
Database KV数据库的接口
type Iterator ¶
type Iterator interface {
Key() []byte
Value() []byte
Next() bool
Prev() bool
Last() bool
First() bool
Error() error
Release()
}
Iterator NewIteratorXX操作后得到的迭代器
type QuickIterator ¶
type QuickIterator struct {
// contains filtered or unexported fields
}
QuickIterator define the data structure of quick iterator
func NewQuickIterator ¶
func NewQuickIterator(ldb Database, prefix []byte, middleKey []byte) *QuickIterator
NewQuickIterator new quick iterator instance
func (*QuickIterator) Error ¶
func (qi *QuickIterator) Error() error
Error return err for quick iterator
func (*QuickIterator) Release ¶
func (qi *QuickIterator) Release()
Release release iterators of quick iterator
func (*QuickIterator) Value ¶
func (qi *QuickIterator) Value() []byte
Value get value by quick iterator
Directories
¶
| Path | Synopsis |
|---|---|
|
badger wrapper plugin so
|
badger wrapper plugin so |
|
go-leveldb wrapper plugin so 模式,package必须是main
|
go-leveldb wrapper plugin so 模式,package必须是main |
Click to show internal directories.
Click to hide internal directories.