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

bootstrap

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package bootstrap verifies the catalog generation embedded in the binary.

Index

Constants

View Source
const BaselineRecoveryDirectoryName = baselineRecoveryDirectory

BaselineRecoveryDirectoryName identifies the journal directory within a baseline export tree.

View Source
const PayloadFilename = "generation-payload.json.gz"

PayloadFilename names the generated compressed canonical catalog.

Variables

This section is empty.

Functions

func DecodePayload added in v0.17.0

func DecodePayload(compressed []byte, descriptor catalogs.PayloadDescriptor) ([]byte, error)

DecodePayload bounds decompression and verifies the exact canonical byte descriptor.

func Embedded added in v0.2.0

Embedded returns the process-wide verified immutable bootstrap catalog and its digest-bound manifest. The catalog is safe to retain across goroutines. Verification and JSON decoding run once because the embedded filesystem cannot change during a process lifetime.

func EncodePayload added in v0.17.0

func EncodePayload(payload []byte) ([]byte, error)

EncodePayload compresses canonical bytes with deterministic gzip metadata.

func Generation

func Generation() (catalogs.Generation, error)

Generation returns an owned copy of the process-wide verified embedded generation. Encoding and validation run once because embedded bytes cannot change in this process.

func GenerationManifest added in v0.17.0

func GenerationManifest() (catalogs.GenerationManifest, error)

GenerationManifest returns verified embedded evidence without copying the payload. The caller owns the manifest and all its collections.

func InspectExports added in v0.17.0

func InspectExports(ctx context.Context, path string) (resultErr error)

InspectExports validates a private tree of completed baseline exports without writes. The caller must fence writers and verify the complete inventory before and after inspection. This check refuses journals and unfinished stages, which require separate recovery. A valid export does not establish provenance, authority, or permission to activate it.

func InspectRetainedBaselinePublications added in v0.17.0

func InspectRetainedBaselinePublications(ctx context.Context, files map[string]BaselineRetainedFile, read BaselineRecordReader) ([]string, error)

InspectRetainedBaselinePublications selects matching baseline stages for inactive retention. The inventory includes the baseline files and the separate recovery directory. The caller preserves selected files and every recovery record in inactive evidence. Completed exports require separate validation. This check never promotes staging bytes or authorizes native cleanup.

func Load

Load parses embedded generation metadata and verifies it against the exact canonical bytes produced by the embedded catalog.

func NewEmbeddedBuilder added in v0.7.0

func NewEmbeddedBuilder() (*catalogs.Builder, error)

NewEmbeddedBuilder composes the repository-owned embedded filesystem with a catalog builder. Callers that only need the verified immutable generation should use Embedded.

Types

type BaselineRecordReader added in v0.17.0

type BaselineRecordReader = privatefiles.RetainedRecordReader

BaselineRecordReader reads bounded metadata from a verified backup.

type BaselineRecovery added in v0.17.0

type BaselineRecovery struct {
	RecoveredOperations int      `json:"recovered_operations"`
	PreservedPaths      []string `json:"preserved_paths,omitempty"`
}

BaselineRecovery reports completed recovery operations and paths that recovery preserves. Preserved paths are relative to the baseline directory. They require separate ownership review.

type BaselineRetainedFile added in v0.17.0

type BaselineRetainedFile = privatefiles.RetainedFile

BaselineRetainedFile identifies captured bytes in a verified baseline inventory.

type ExportResult added in v0.17.0

type ExportResult struct {
	GenerationID string           `json:"generation_id"`
	Directory    string           `json:"directory"`
	Created      bool             `json:"created"`
	Recovery     BaselineRecovery `json:"recovery"`
}

ExportResult identifies the installed baseline export and its recovery outcomes.

func Export added in v0.17.0

func Export(ctx context.Context, directory string) (ExportResult, error)

Export writes the installed generation as an immutable inspectable baseline. It never changes a catalog store's accepted head or exports acquired credentials.

Directories

Path Synopsis
Package budget measures the checked-in catalog and applies release policy.
Package budget measures the checked-in catalog and applies release policy.
Package manifest derives embedded generation identity from canonical catalog bytes without rewriting unchanged generations.
Package manifest derives embedded generation identity from canonical catalog bytes without rewriting unchanged generations.

Jump to

Keyboard shortcuts

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