badgerdb

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

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 New

func New(opts Options) (storage.DualStorage, error)

New creates a new BadgerDB storage.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL