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

renderoutput

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package renderoutput binds one rendered configuration to its exact plan and auxiliary artifacts under an authenticated immutable root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactContentMismatchError

type ArtifactContentMismatchError struct {
	Path              string
	PlanBytes         int
	ArtifactBytes     int
	Written           int64
	Matched           int
	ReadOK            bool
	ExactRead         bool
	PlanDigestValid   bool
	IncrementalCommit bool
	PlanFileInherited bool
	PlanFileChanged   bool
	ArtifactInherited bool
	ArtifactChanged   bool
}

ArtifactContentMismatchError carries comparison evidence without file contents. IncrementalCommit is set only when the pair was rejected by an incremental commit; the four provenance fields are meaningful only then. Inherited means the delta carried no After for the path, so the base binding's value was re-validated; changed means the After differs from the base. An inherited, unchanged pair that mismatches was already inconsistent in the base.

func (*ArtifactContentMismatchError) Error

type Authority

type Authority struct {
	// contains filtered or unexported fields
}

Authority owns one output lineage and its exact plan and artifact lineages.

func NewAuthority

func NewAuthority(plans *renderplan.Authority, artifacts *renderartifact.Authority) (*Authority, error)

NewAuthority binds exact plan and artifact lineages to a new output lineage.

func (*Authority) ValidateAuthentication

func (a *Authority) ValidateAuthentication() error

ValidateAuthentication verifies the authority's exact lineage bindings.

func (*Authority) ValidateSnapshot

func (a *Authority) ValidateSnapshot(snapshot *Snapshot) error

ValidateSnapshot proves that snapshot belongs to this output lineage.

type Counts

type Counts struct {
	Sections  int
	Backends  int
	Profiles  int
	Maps      int
	CRTLists  int
	Files     int
	Artifacts int
}

Counts records the exact cardinality of each output collection.

type Delta

type Delta struct {
	// contains filtered or unexported fields
}

Delta authenticates one atomic publication across config, plan, and artifacts.

func (*Delta) Apply

func (d *Delta) Apply(base *Snapshot) (*Snapshot, error)

Apply returns this atomic publication only for its exact output base.

func (*Delta) SameRoot

func (d *Delta) SameRoot() (bool, error)

SameRoot reports whether none of the three child roots changed.

func (*Delta) ValidateAuthentication

func (d *Delta) ValidateAuthentication() error

ValidateAuthentication verifies the exact atomic base-to-next publication.

type PreparedContentHash

type PreparedContentHash struct {
	// contains filtered or unexported fields
}

PreparedContentHash is the document's share of a content checksum, hashed ahead of the snapshot that will carry it so the hashing overlaps the plan work that precedes the snapshot. It serves one snapshot whose document is the one it hashed.

func PrepareContentHash

func PrepareContentHash(document rendercontent.Document) *PreparedContentHash

PrepareContentHash hashes the document part of the content checksum.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot is one authenticated immutable render output.

func NewSnapshot

func NewSnapshot(
	authority *Authority,
	config string,
	plan *renderplan.Plan,
	artifacts *renderartifact.Snapshot,
	previous *Snapshot,
) (*Snapshot, error)

NewSnapshot validates and seals one complete render output.

func NewSnapshotFromDocument

func NewSnapshotFromDocument(
	authority *Authority,
	document rendercontent.Document,
	plan *renderplan.Plan,
	artifacts *renderartifact.Snapshot,
	previous *Snapshot,
) (*Snapshot, error)

NewSnapshotFromDocument validates and seals one authenticated document output.

func ReusePrevious

func ReusePrevious(
	authority *Authority,
	previous *Snapshot,
	plan *renderplan.Snapshot,
	artifacts *renderartifact.Snapshot,
) (*Snapshot, bool, error)

ReusePrevious returns previous only when both supplied child roots are the exact roots it already binds. A false result requires full NewSnapshot validation.

func ReusePreviousDocument

func ReusePreviousDocument(
	authority *Authority,
	previous *Snapshot,
	document rendercontent.Document,
	plan *renderplan.Snapshot,
	artifacts *renderartifact.Snapshot,
) (*Snapshot, bool, error)

ReusePreviousDocument returns previous only when the supplied document and both child snapshots are its exact authenticated roots.

func (*Snapshot) ArtifactSnapshot

func (s *Snapshot) ArtifactSnapshot() (*renderartifact.Snapshot, error)

ArtifactSnapshot returns the authenticated auxiliary-artifact root.

func (*Snapshot) Config

func (s *Snapshot) Config() (string, error)

Config returns the exact immutable haproxy.cfg bytes.

func (*Snapshot) ConfigDocument

func (s *Snapshot) ConfigDocument() (rendercontent.Document, error)

ConfigDocument returns the authenticated haproxy.cfg document root.

func (*Snapshot) ContentChecksum

func (s *Snapshot) ContentChecksum() (string, error)

ContentChecksum returns the checksum authenticated by this output root.

func (*Snapshot) ContentChecksumWith

func (s *Snapshot) ContentChecksumWith(prepared *PreparedContentHash) (string, error)

ContentChecksumWith is ContentChecksum continuing from a document hash prepared ahead of time; a prepared hash of another document is ignored.

func (*Snapshot) Counts

func (s *Snapshot) Counts() (Counts, error)

Counts returns the authenticated collection cardinalities.

func (*Snapshot) ExactEqual

func (s *Snapshot) ExactEqual(other *Snapshot) (bool, error)

ExactEqual compares every final byte and declaration; hashes and IDs only reject.

func (*Snapshot) PlanID

func (s *Snapshot) PlanID() (string, error)

PlanID returns the plan's verified identifier.

func (*Snapshot) PlanSnapshot

func (s *Snapshot) PlanSnapshot() (*renderplan.Snapshot, error)

PlanSnapshot returns the authenticated render-plan root.

func (*Snapshot) SameRoot

func (s *Snapshot) SameRoot(other *Snapshot) (bool, error)

SameRoot reports exact authenticated output-root identity.

func (*Snapshot) ValidateAuthentication

func (s *Snapshot) ValidateAuthentication() error

ValidateAuthentication verifies the composite root in constant time.

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction validates and publishes three exact child transitions atomically.

func BeginTransaction

func BeginTransaction(
	authority *Authority,
	base *Snapshot,
	document *rendercontent.DocumentDelta,
	plan *renderplan.Delta,
	artifacts *renderartifact.Delta,
) (*Transaction, error)

BeginTransaction binds exact child deltas to one output base.

func (*Transaction) Commit

func (t *Transaction) Commit() (*Snapshot, *Delta, error)

Commit validates changed records and seals one indivisible output root.

Jump to

Keyboard shortcuts

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