db

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("Key not found")

ErrKeyNotFound ..

Functions

This section is empty.

Types

type DB

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

DB holds the database

func NewDB

func NewDB(dataDir string) (*DB, error)

NewDB creates or loads a database at folder dataDir

func (*DB) Count

func (db *DB) Count(prefix string, filter string, countProcessor func(cnt int64) error) error

Count ..

func (*DB) Del

func (db *DB) Del(prefix string, key string) error

Del ..

func (*DB) DelByPrefix added in v0.4.2

func (db *DB) DelByPrefix(prefix string) error

DelByPrefix ..

func (*DB) DelEverything

func (db *DB) DelEverything() error

DelEverything ..

func (*DB) DelManyRefs

func (db *DB) DelManyRefs(prefix string, keys []string) error

DelManyRefs ..

func (*DB) Enumerate added in v0.2.1

func (db *DB) Enumerate(prefix string, enumProcessor func(key string, value []byte) (bool, error)) error

Enumerate ..

func (*DB) Fix added in v0.4.2

func (db *DB) Fix() error

Fix ..

func (*DB) Get

func (db *DB) Get(prefix string, key string, valueProcessor func(value []byte) error) error

Get ..

func (*DB) List

func (db *DB) List(prefix string, filter string, offset int64, limit int64, valuesProcessor func(keys []string, values [][]byte) error) error

List ..

func (*DB) RefMany

func (db *DB) RefMany(prefix string, keys []string) error

RefMany ..

func (*DB) Set

func (db *DB) Set(prefix string, key string, value interface{}) error

Set ..

func (*DB) SetMany added in v0.1.4

func (db *DB) SetMany(prefix string, keys []string, values []interface{}) error

SetMany ..

Jump to

Keyboard shortcuts

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