badger

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Key   []byte
	Value []byte
}

type Manager

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

func New

func New(dbPath string) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) DB

func (m *Manager) DB(ctx context.Context) QueryManager

func (*Manager) Delete

func (m *Manager) Delete(key []byte) error

func (*Manager) GC

func (m *Manager) GC()

func (*Manager) Get

func (m *Manager) Get(key []byte) (data []byte, err error)

func (*Manager) GetAll

func (m *Manager) GetAll(prefix []byte) (items []Item, err error)

func (*Manager) RunTransaction

func (m *Manager) RunTransaction(ctx context.Context, fn transactor.TransactionFn) error

func (*Manager) Set

func (m *Manager) Set(key []byte, val []byte) error

type Provider

type Provider interface {
	transactor.Transactor
	DB(ctx context.Context) QueryManager
}

type QueryManager

type QueryManager interface {
	Set(key []byte, val []byte) error
	GetAll(prefix []byte) ([]Item, error)
	Get(key []byte) ([]byte, error)
	Delete(key []byte) error
}

Jump to

Keyboard shortcuts

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