kv

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// EntryNotFoundError is an error for a storage entry not found
	EntryNotFoundError = "EntryNotFoundError"
)

Variables

This section is empty.

Functions

func New

func New(options basedb.Options) (basedb.IDb, error)

New create new instance of Badger db

Types

type BadgerDb

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

BadgerDb struct

func (*BadgerDb) Close

func (b *BadgerDb) Close()

Close close db

func (*BadgerDb) CountByCollection added in v0.0.4

func (b *BadgerDb) CountByCollection(prefix []byte) (int64, error)

CountByCollection return the object count for all keys under specified prefix(bucket)

func (*BadgerDb) Delete added in v0.1.4

func (b *BadgerDb) Delete(prefix []byte, key []byte) error

Delete key in specific prefix

func (*BadgerDb) Get

func (b *BadgerDb) Get(prefix []byte, key []byte) (basedb.Obj, bool, error)

Get return value for specified key

func (*BadgerDb) GetAllByCollection

func (b *BadgerDb) GetAllByCollection(prefix []byte) ([]basedb.Obj, error)

GetAllByCollection return all array of Obj for all keys under specified prefix(bucket)

func (*BadgerDb) RemoveAllByCollection added in v0.0.18

func (b *BadgerDb) RemoveAllByCollection(prefix []byte) error

RemoveAllByCollection cleans all items in a collection

func (*BadgerDb) Set

func (b *BadgerDb) Set(prefix []byte, key []byte, value []byte) error

Set save value with key to storage

Jump to

Keyboard shortcuts

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