badger

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Overview

Package badger is the pure-Go store.Engine (ADR-0065): a Badger v4 LSM at a local directory, superseding ADR-0006's slatedb/cgo engine and restoring funcd's pure-Go static binary. (bucket, key) is encoded as bucket+NUL+key — NUL cannot occur in a GVK bucket or a namespace/name key, so Scan prefix-matches unambiguously. Update runs in one Badger transaction (atomic all-or-nothing); the store wrapper serializes writers above it (its writeMu), so no engine-level conflict arises in practice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(dir string, opts ...Option) (store.Engine, error)

Open opens (creating if absent) a Badger-backed store.Engine at dir with the RAM-frugal metastore options profile (small memtables/caches, modest value-log, compression off, small resource blobs kept inline). Close flushes + releases the DB and stops GC.

Types

type Option

type Option func(*config)

Option tunes the engine.

func WithSyncWrites

func WithSyncWrites(s bool) Option

WithSyncWrites toggles fsync-on-commit (default true — durable control-plane writes).

func WithValueLogGCInterval

func WithValueLogGCInterval(d time.Duration) Option

WithValueLogGCInterval sets the value-log GC cadence (default 5m; 0 disables).

Jump to

Keyboard shortcuts

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