Documentation
¶
Index ¶
- Constants
- func NewFromCmdlineOptions() plugin.Plugin
- type BadgerLogger
- type BlobStoreBadger
- func (d *BlobStoreBadger) Close() error
- func (d *BlobStoreBadger) DB() *badger.DB
- func (d *BlobStoreBadger) Delete(txn types.Txn, key []byte) error
- func (d *BlobStoreBadger) Get(txn types.Txn, key []byte) ([]byte, error)
- func (b *BlobStoreBadger) GetCommitTimestamp() (int64, error)
- func (d *BlobStoreBadger) NewIterator(txn types.Txn, opts types.BlobIteratorOptions) types.BlobIterator
- func (d *BlobStoreBadger) NewTransaction(update bool) types.Txn
- func (d *BlobStoreBadger) Set(txn types.Txn, key, val []byte) error
- func (b *BlobStoreBadger) SetCommitTimestamp(timestamp int64, txn types.Txn) error
- func (d *BlobStoreBadger) Start() error
- func (d *BlobStoreBadger) Stop() error
- type BlobStoreBadgerOptionFunc
- func WithBlockCacheSize(size uint64) BlobStoreBadgerOptionFunc
- func WithDataDir(dataDir string) BlobStoreBadgerOptionFunc
- func WithGc(enabled bool) BlobStoreBadgerOptionFunc
- func WithIndexCacheSize(size uint64) BlobStoreBadgerOptionFunc
- func WithLogger(logger *slog.Logger) BlobStoreBadgerOptionFunc
- func WithPromRegistry(registry prometheus.Registerer) BlobStoreBadgerOptionFunc
Constants ¶
const ( DefaultBlockCacheSize = 1610612736 // 1.5GB (increased from 768MB) DefaultIndexCacheSize = 536870912 // 512MB (increased from 256MB) )
Default cache sizes for BadgerDB (in bytes)
Variables ¶
This section is empty.
Functions ¶
func NewFromCmdlineOptions ¶ added in v0.18.0
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(opts ...BlobStoreBadgerOptionFunc) (*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) Delete ¶ added in v0.19.0
func (d *BlobStoreBadger) Delete(txn types.Txn, key []byte) error
Delete removes a key from badger within a transaction
func (*BlobStoreBadger) Get ¶ added in v0.19.0
Get retrieves a value from badger within a transaction
func (*BlobStoreBadger) GetCommitTimestamp ¶
func (b *BlobStoreBadger) GetCommitTimestamp() (int64, error)
func (*BlobStoreBadger) NewIterator ¶ added in v0.19.0
func (d *BlobStoreBadger) NewIterator( txn types.Txn, opts types.BlobIteratorOptions, ) types.BlobIterator
NewIterator creates an iterator for badger within a transaction.
Important: items returned by the iterator's `Item()` must only be accessed while the transaction used to create the iterator is still active. Implementations may validate transaction state at access time (for example `ValueCopy` may fail if the transaction has been committed or rolled back). Typical usage iterates and accesses item values within the same transaction scope.
func (*BlobStoreBadger) NewTransaction ¶
func (d *BlobStoreBadger) NewTransaction(update bool) types.Txn
NewTransaction creates a new badger transaction
func (*BlobStoreBadger) Set ¶ added in v0.19.0
func (d *BlobStoreBadger) Set(txn types.Txn, key, val []byte) error
Set stores a key-value pair in badger within a transaction
func (*BlobStoreBadger) SetCommitTimestamp ¶
func (b *BlobStoreBadger) SetCommitTimestamp( timestamp int64, txn types.Txn, ) error
func (*BlobStoreBadger) Start ¶ added in v0.18.0
func (d *BlobStoreBadger) Start() error
Start implements the plugin.Plugin interface
func (*BlobStoreBadger) Stop ¶ added in v0.18.0
func (d *BlobStoreBadger) Stop() error
Stop implements the plugin.Plugin interface
type BlobStoreBadgerOptionFunc ¶ added in v0.18.0
type BlobStoreBadgerOptionFunc func(*BlobStoreBadger)
func WithBlockCacheSize ¶ added in v0.18.0
func WithBlockCacheSize(size uint64) BlobStoreBadgerOptionFunc
WithBlockCacheSize specifies the block cache size
func WithDataDir ¶ added in v0.18.0
func WithDataDir(dataDir string) BlobStoreBadgerOptionFunc
WithDataDir specifies the data directory to use for storage
func WithGc ¶ added in v0.18.0
func WithGc(enabled bool) BlobStoreBadgerOptionFunc
WithGc specifies whether garbage collection is enabled
func WithIndexCacheSize ¶ added in v0.18.0
func WithIndexCacheSize(size uint64) BlobStoreBadgerOptionFunc
WithIndexCacheSize specifies the index cache size
func WithLogger ¶ added in v0.18.0
func WithLogger(logger *slog.Logger) BlobStoreBadgerOptionFunc
WithLogger specifies the logger object to use for logging messages
func WithPromRegistry ¶ added in v0.18.0
func WithPromRegistry( registry prometheus.Registerer, ) BlobStoreBadgerOptionFunc
WithPromRegistry specifies the prometheus registry to use for metrics