badgerdb

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package badgerdb implements the storage backends using BadgerDB.

Index

Constants

This section is empty.

Variables

View Source
var RaftLogPrefix = storage.RaftPrefix.For("/log/")
View Source
var StableStorePrefix = storage.RaftPrefix.For("/stable/")

Functions

func New

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

New creates a new BadgerDB storage.

func NewLogAdapter

func NewLogAdapter(logger *slog.Logger) badger.Logger

NewLogAdapter returns a badger log adapter for the given logger.

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.

Jump to

Keyboard shortcuts

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