badger

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerLogger

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

BadgerLogger is a wrapper type to give our logger the expected interface

func NewBadgerLogger

func NewBadgerLogger(logger *slog.Logger) *BadgerLogger

func (*BadgerLogger) Debugf

func (b *BadgerLogger) Debugf(msg string, args ...any)

func (*BadgerLogger) Errorf

func (b *BadgerLogger) Errorf(msg string, args ...any)

func (*BadgerLogger) Infof

func (b *BadgerLogger) Infof(msg string, args ...any)

func (*BadgerLogger) Warningf

func (b *BadgerLogger) Warningf(msg string, args ...any)

type BlobStoreBadger

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

BlobStoreBadger stores all data in badger. Data may not be persisted

func New

func New(
	dataDir string,
	logger *slog.Logger,
	promRegistry prometheus.Registerer,
	badgerCacheSize int64,
) (*BlobStoreBadger, error)

New creates a new database

func (*BlobStoreBadger) Close

func (d *BlobStoreBadger) Close() error

Close gets the database handle from our BlobStore and closes it

func (*BlobStoreBadger) DB

func (d *BlobStoreBadger) DB() *badger.DB

DB returns the database handle

func (*BlobStoreBadger) GetCommitTimestamp

func (b *BlobStoreBadger) GetCommitTimestamp() (int64, error)

func (*BlobStoreBadger) NewTransaction

func (d *BlobStoreBadger) NewTransaction(update bool) *badger.Txn

NewTransaction creates a new badger transaction

func (*BlobStoreBadger) SetCommitTimestamp

func (b *BlobStoreBadger) SetCommitTimestamp(
	txn *badger.Txn,
	timestamp int64,
) error

Jump to

Keyboard shortcuts

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