Documentation ¶
Index ¶
- type DB
- type DBOption
- func WithBadgerConfig(iniFile string) DBOption
- func WithCacheSize(size uint64) DBOption
- func WithDBDir(dir string) DBOption
- func WithInMemory() DBOption
- func WithKeepL0InMemory() DBOption
- func WithLogger(lgr *zap.Logger) DBOption
- func WithStats(statsCli stats.Client) DBOption
- func WithSyncWrites() DBOption
- func WithoutKeepL0InMemory() DBOption
- func WithoutSyncWrites() DBOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { storage.KVStore storage.Backupable storage.ChangeApplier }
DB interface represents the capabilities exposed by the underlying implmentation based on Badger engine.
type DBOption ¶
type DBOption func(*bdgrOpts)
DBOption is used to configure the Badger storage engine.
func WithBadgerConfig ¶
WithBadgerConfig can be used to override internal Badger storage settings through the given .ini file.
func WithCacheSize ¶
WithCacheSize sets the value in bytes the amount of cache used for data blocks.
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 ¶
WithLogger is used to inject a ZAP logger instance.
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.