badgerutils

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefixToKey

func AddPrefixToKey(prefix []byte, key []byte) []byte

func ChangeValue

func ChangeValue(db *badger.DB, prefix []byte, key []byte, chFn func(val []byte) ([]byte, error)) error

func FindKeyByValue

func FindKeyByValue(db *badger.DB, prefix []byte, targetVal []byte) ([]byte, error)

func GetValue

func GetValue(db *badger.DB, prefix []byte, key []byte) ([]byte, error)

func Int64FromBytes

func Int64FromBytes(b []byte) int64

func Int64ToBytes

func Int64ToBytes(v int64) []byte

func IterOverKeys

func IterOverKeys(db *badger.DB, prefix []byte, callback func(keyWithoutPrefix []byte) (stop bool, err error)) (stoppedByCallback bool, err error)

func IterOverKeysAndValues

func IterOverKeysAndValues(db *badger.DB, prefix []byte, callback func(keyWithoutPrefix []byte, val []byte) (stop bool, err error)) (stoppedByCallback bool, err error)

func IterOverValues

func IterOverValues(db *badger.DB, prefix []byte, callback func(val []byte) (stop bool, err error)) (stoppedByCallback bool, err error)

func RemovePrefixFromKey

func RemovePrefixFromKey(prefix []byte, key []byte) []byte

func SetValue

func SetValue(db *badger.DB, prefix []byte, key []byte, value []byte) error

func Uint64FromBytes

func Uint64FromBytes(b []byte) uint64

func Uint64ToBytes

func Uint64ToBytes(v uint64) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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