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 WithLogger(lgr *zap.Logger) DBOption
- func WithMemTableSize(size int64) DBOption
- func WithPromStats(registry prometheus.Registerer) DBOption
- func WithSSTDir(sstDir string) DBOption
- func WithStats(statsCli stats.Client) DBOption
- func WithSyncWrites() 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.ChangePropagator 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 WithLogger ¶
WithLogger is used to inject a ZAP logger instance.
func WithMemTableSize ¶
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 ¶
WithSSTDir configures the directory to be used for SST Operation on Badger.
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.