Documentation
¶
Overview ¶
Package db implements key-value database functionality with prefix feature.
Index ¶
- Variables
- type Batch
- type DB
- func (db *DB) Close() error
- func (db *DB) Del(key []byte)
- func (db *DB) DropAll()
- func (db *DB) Exist(key []byte) bool
- func (db *DB) Get(key []byte) ([]byte, bool)
- func (db *DB) Iterate(prefix []byte, limit int, reverse bool) []KeyValue
- func (db *DB) IterateKey(prefix []byte, limit int, reverse bool) [][]byte
- func (db *DB) IterateRange(start, end []byte, limit int, reverse bool) []KeyValue
- func (db *DB) NewBatch() *Batch
- func (db *DB) NewReader() *Reader
- func (db *DB) Set(key, value []byte)
- func (db *DB) Write(batch *Batch)
- type KeyValue
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) Exist(key []byte) bool
- func (r *Reader) Get(key []byte) ([]byte, bool)
- func (r *Reader) Iterate(prefix []byte, limit int, reverse bool) []KeyValue
- func (r *Reader) IterateKey(prefix []byte, limit int, reverse bool) [][]byte
- func (r *Reader) IterateRange(start, end []byte, limit int, reverse bool) []KeyValue
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDataNotFound = errors.New("data was not found")
)
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewInMemoryDB ¶
NewInMemoryDB returns new instance of in-memory db.
func (*DB) IterateRange ¶
type KeyValue ¶
func NewKeyValue ¶
Directories
¶
Path | Synopsis |
---|---|
Package batchdb provides the prefixed db feature without diff functionality.
|
Package batchdb provides the prefixed db feature without diff functionality. |
Package diffdb provides diff functionality, which is used for rolling back the stored data.
|
Package diffdb provides diff functionality, which is used for rolling back the stored data. |
Click to show internal directories.
Click to hide internal directories.