badgerdb

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKVInterface

func NewKVInterface(path string, kopts kvi.Options) (kvi.KVInterface, error)

NewKVInterface creates new BoltDB backed KVInterface at `path`

Types

type BadgerKV

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

BadgerKV is an implementation of the KVStore for badger

func (*BadgerKV) BulkWrite

func (badgerkv *BadgerKV) BulkWrite(u func(tx kvi.KVBulkWrite) error) error

BulkWrite returns a pointer to the badger bulk write method

func (*BadgerKV) Close

func (badgerkv *BadgerKV) Close() error

Close closes the badger connection

func (*BadgerKV) Delete

func (badgerkv *BadgerKV) Delete(id []byte) error

Delete removes a key/value from a kvstore

func (*BadgerKV) DeletePrefix

func (badgerkv *BadgerKV) DeletePrefix(prefix []byte) error

DeletePrefix deletes all elements in kvstore that begin with prefix `id`

func (*BadgerKV) Get

func (badgerkv *BadgerKV) Get(id []byte) ([]byte, error)

Get retrieves the value of key `id`

func (*BadgerKV) HasKey

func (badgerkv *BadgerKV) HasKey(id []byte) bool

HasKey returns true if the key is exists in kvstore

func (*BadgerKV) Set

func (badgerkv *BadgerKV) Set(id []byte, val []byte) error

Set value in kvstore

func (*BadgerKV) Update

func (badgerkv *BadgerKV) Update(u func(tx kvi.KVTransaction) error) error

Update runs an alteration transaction of the kvstore

func (*BadgerKV) View

func (badgerkv *BadgerKV) View(u func(it kvi.KVIterator) error) error

View run iterator on bolt keyvalue store

Jump to

Keyboard shortcuts

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