Documentation ¶
Overview ¶
Package badgerdb implements the storage backends using BadgerDB.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BadgerGoRoutines = 32
BadgerGoRoutines is the number of goroutines to use for BadgerDB.
View Source
var RaftLogPrefix = types.ConsensusPrefix.For([]byte("/log/"))
View Source
var StableStorePrefix = types.ConsensusPrefix.For([]byte("/stable/"))
Functions ¶
func NewInMemory ¶
func NewInMemory(opts Options) (storage.DualStorage, error)
NewInMemory creates a new in-memory BadgerDB storage.
func NewTestDiskStorage ¶
func NewTestDiskStorage(debug bool) storage.DualStorage
NewTestDiskStorage is a helper method for returning a new disk storage and panicking on error. The storage is created in a temporary directory that is cleaned up when the storage is closed.
func NewTestStorage ¶
func NewTestStorage(debug bool) storage.DualStorage
NewTestStorage is a helper method for returning a new in-memory storage and panicking on error.
Types ¶
type Options ¶
type Options struct { // InMemory specifies whether to use an in-memory storage. InMemory bool // DiskPath is the path to use for disk storage. DiskPath string // SyncWrites specifies whether to sync writes to disk. SyncWrites bool // Debug specifies whether to enable debug logging. Debug bool }
Options are the options for creating a new NutsDB storage.
type TempDiskStorage ¶
type TempDiskStorage struct { storage.DualStorage // contains filtered or unexported fields }
func (*TempDiskStorage) Close ¶
func (t *TempDiskStorage) Close() error
Click to show internal directories.
Click to hide internal directories.