MCPcopy
hub / github.com/dgraph-io/badger / WithInMemory

Method WithInMemory

options.go:581–584  ·  view source on GitHub ↗

WithInMemory returns a new Options value with Inmemory mode set to the given value. When badger is running in InMemory mode, everything is stored in memory. No value/sst files are created. In case of a crash all data will be lost.

(b bool)

Source from the content-addressed store, hash-verified

579// When badger is running in InMemory mode, everything is stored in memory. No value/sst files are
580// created. In case of a crash all data will be lost.
581func (opt Options) WithInMemory(b bool) Options {
582 opt.InMemory = b
583 return opt
584}
585
586// WithZSTDCompressionLevel returns a new Options value with ZSTDCompressionLevel set
587// to the given value.

Callers 5

TestGetFunction · 0.80
TestExistsMoreFunction · 0.80
TestIterate2BasicFunction · 0.80
TestGoroutineLeakFunction · 0.80
TestWriteInemoryFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestGetFunction · 0.64
TestExistsMoreFunction · 0.64
TestIterate2BasicFunction · 0.64
TestGoroutineLeakFunction · 0.64
TestWriteInemoryFunction · 0.64