database

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = badger.ErrKeyNotFound
)

Functions

This section is empty.

Types

type DB

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

func Open

func Open(options badger.Options, manager *modules.Manager) (*DB, error)

func (*DB) Client

func (db *DB) Client() *badger.DB

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetAll

func (db *DB) GetAll(prefix string) (map[string]string, error)

func (*DB) GetJSON

func (db *DB) GetJSON(key string, dst interface{}) error

func (*DB) GetKey

func (db *DB) GetKey(key string) ([]byte, error)

func (*DB) PutJSON

func (db *DB) PutJSON(key string, data interface{}) error

func (*DB) PutJSONBulk

func (db *DB) PutJSONBulk(kvs map[string]interface{}) error

func (*DB) PutKey

func (db *DB) PutKey(key string, data []byte) error

func (*DB) RemoveKey

func (db *DB) RemoveKey(key string) error

func (*DB) Subscribe

func (db *DB) Subscribe(ctx context.Context, fn func(changed []ModifiedKV) error, prefixes ...string) error

type ModifiedKV

type ModifiedKV struct {
	Key     string
	Data    []byte
	Meta    []byte
	Version uint64
	Expires uint64
}

Jump to

Keyboard shortcuts

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