badger

package
v0.0.0-...-1aaebbc Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 21 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 WithKeepL0InMemory

func WithKeepL0InMemory() DBOption

WithKeepL0InMemory configures Badger to place the L0 SSTable in memory for better write performance. However, replaying the value log during startup can take longer with this option set. This is enabled by default in DKV.

func WithLogger

func WithLogger(lgr *zap.Logger) DBOption

WithLogger is used to inject a ZAP logger instance.

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 WithoutKeepL0InMemory

func WithoutKeepL0InMemory() DBOption

WithoutKeepL0InMemory configures Badger to prevent placing L0 SSTable in memory.

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