Help us shape the future of Go! Take the 2026 Go Developer Survey

badger

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package badger snapshots and loads a whole Badger instance for the platform stores built on one (ADR-0202), the metastore engine and the run state, so each reads in one transaction alike.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(ctx context.Context, db *badger.DB, next func() (snapshot.Record, error), skip func(key []byte) (bool, error)) error

Load writes the records next returns, until io.EOF, into db through a WriteBatch, which commits whenever Badger's transaction limit is reached. A non-empty db gets fault.Conflict before any write. skip, when not nil, names a record to leave out, or fails the Load on a malformed one.

func Snapshot

func Snapshot(ctx context.Context, db *badger.DB, emit func(snapshot.Record) error) error

Snapshot emits every key and its latest value, in key order, from ONE read transaction with ONE iterator: never DB.Backup or a Stream, whose producers each read at their own time (#806).

func SnapshotPrefix

func SnapshotPrefix(ctx context.Context, db *badger.DB, prefix []byte, emit func(snapshot.Record) error) error

SnapshotPrefix is Snapshot over the keys under prefix, each emitted without it (ADR-0209 Decision 7).

Types

This section is empty.

Jump to

Keyboard shortcuts

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