db

package
v0.0.0-...-b2779c9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerKVStore

type BadgerKVStore struct {
	TTL time.Duration
	DB  *badger.DB
}

func NewBadgerKVStore

func NewBadgerKVStore(dbPath string, ttl time.Duration) (*BadgerKVStore, error)

func (*BadgerKVStore) Close

func (b *BadgerKVStore) Close() error

Close implements ports.KeyValueStore.

func (*BadgerKVStore) Get

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

Get implements ports.KeyValueStore.

func (*BadgerKVStore) Put

func (b *BadgerKVStore) Put(ctx context.Context, key []byte, value []byte) error

Put implements ports.KeyValueStore.

type BadgerSlogLogger

type BadgerSlogLogger struct {
	Logger *slog.Logger
}

func NewBadgerSlogLogger

func NewBadgerSlogLogger(logger *slog.Logger) BadgerSlogLogger

func (BadgerSlogLogger) Debugf

func (b BadgerSlogLogger) Debugf(format string, args ...any)

Debugf implements badger.Logger.

func (BadgerSlogLogger) Errorf

func (b BadgerSlogLogger) Errorf(format string, args ...any)

Errorf implements badger.Logger.

func (BadgerSlogLogger) Infof

func (b BadgerSlogLogger) Infof(format string, args ...any)

Infof implements badger.Logger.

func (BadgerSlogLogger) Warningf

func (b BadgerSlogLogger) Warningf(format string, args ...any)

Warningf implements badger.Logger.

Jump to

Keyboard shortcuts

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