badger

package
v0.0.0-...-0ce2e87 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

DB interface represents the capabilities exposed by the underlying implmentation based on Badger engine.

func OpenDB

func OpenDB(dbOpts ...DBOption) (kvs DB, err error)

OpenDB initializes a new instance of BadgerDB with the specified options.

type DBOption

type DBOption func(*bdgrOpts)

DBOption is used to configure the Badger storage engine.

func WithBadgerConfig

func WithBadgerConfig(iniFile string) DBOption

WithBadgerConfig can be used to override internal Badger storage settings through the given .ini file.

func WithCacheSize

func WithCacheSize(size uint64) DBOption

WithCacheSize sets the value in bytes the amount of cache used for data blocks.

func WithDBDir

func WithDBDir(dir string) DBOption

WithDBDir sets the respective Badger storage folders.

func WithInMemory

func WithInMemory() DBOption

WithInMemory sets Badger storage to operate entirely in memory. No files are created on disk whatsoever.

func WithLogger

func WithLogger(lgr *zap.Logger) DBOption

WithLogger is used to inject a ZAP logger instance.

func WithMemTableSize

func WithMemTableSize(size int64) DBOption

WithMemTableSize sets Badger storage to use the desired mem table size.

func WithPromStats

func WithPromStats(registry prometheus.Registerer) DBOption

WithPromStats is used to inject a prometheus metrics instance

func WithSSTDir

func WithSSTDir(sstDir string) DBOption

WithSSTDir configures the directory to be used for SST Operation on Badger.

func WithStats

func WithStats(statsCli stats.Client) DBOption

WithStats is used to inject a metrics client.

func WithSyncWrites

func WithSyncWrites() DBOption

WithSyncWrites configures Badger to ensure every write is flushed to disk before acking back.

func WithoutSyncWrites

func WithoutSyncWrites() DBOption

WithoutSyncWrites configures Badger to prevent flush to disk for every write.

Jump to

Keyboard shortcuts

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