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

opencfg

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package opencfg holds the resolved form of thread's open options — the one piece of the option vocabulary that thread (which declares the options), its in-tree backends (Memory) and thread/backend (which publishes the resolution to backend authors) all need, kept here so that none of them has to import another to share it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier

type Applier interface {
	ApplyOpen(*Config)
}

Applier is what every open option is beneath thread's sealed OpenOption: a change to the configuration.

type Config

type Config struct {
	// Salvage downgrades a malformed line from a load failure to a
	// skip reported in the LoadReport.
	Salvage bool
	// SyncEveryAppend is the durability cadence: true (the default)
	// fsyncs every Append; false defers the fsync to Flush.
	SyncEveryAppend bool
	// NoLock turns off the backend's cross-process writer lock.
	NoLock bool
	// Logger receives the backend's own reports. Never nil after
	// Resolve: the default is slog.Default(), read at open.
	Logger *slog.Logger
}

Config is an open's resolved configuration: the defaults with every option applied. thread/backend.Config is its published form.

func Resolve

func Resolve[O any](opts []O) Config

Resolve folds opts over the defaults. A nil option, and a value that is not an option, change nothing.

Jump to

Keyboard shortcuts

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