badgerstore

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadgerLogger

func BadgerLogger(ctx context.Context) badger.Logger

BadgerLogger converts a logger on a context to a Badger logger. Debug messages are ignored, Info are forwarded and Warning/Errors are written as errors.

Types

type BadgerStore

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

BadgerStore returns a store that operate on Badger database. We have a short queue to be able to do bulk writes.

func New

func New(opts badger.Options) (*BadgerStore, error)

New returns a new BadgerStore with the provided options.

func (*BadgerStore) Close

func (b *BadgerStore) Close() error

func (*BadgerStore) Delete

func (b *BadgerStore) Delete(ctx context.Context, set, key string) error

func (*BadgerStore) Get

func (b *BadgerStore) Get(ctx context.Context, set, key string) ([]byte, error)

func (*BadgerStore) Set

func (b *BadgerStore) Set(ctx context.Context, set, key string, val []byte) error

Jump to

Keyboard shortcuts

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