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

renderartifact

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: 9 Imported by: 0

Documentation

Overview

Package renderartifact holds authenticated immutable auxiliary render output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReconcileSnapshot

func ReconcileSnapshot(
	authority *Authority,
	base *Snapshot,
	desired *Snapshot,
) (*Snapshot, *Delta, error)

ReconcileSnapshot returns desired through an authenticated transition from base.

Types

type Artifact

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

Artifact is an authenticated descriptor and immutable content pair.

func (*Artifact) Content

func (a *Artifact) Content() (*Content, error)

Content returns the authenticated immutable payload.

func (*Artifact) Descriptor

func (a *Artifact) Descriptor() (Descriptor, error)

Descriptor returns a detached descriptor value.

func (*Artifact) SameRoot

func (a *Artifact) SameRoot(other *Artifact) (bool, error)

SameRoot reports exact artifact identity.

func (*Artifact) ValidateAuthentication

func (a *Artifact) ValidateAuthentication() error

ValidateAuthentication verifies the artifact's exact ownership chain.

type Authority

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

Authority owns one lineage of exact snapshot roots.

func NewAuthority

func NewAuthority() *Authority

NewAuthority creates an isolated snapshot lineage.

func (*Authority) ValidateAuthentication

func (a *Authority) ValidateAuthentication() error

ValidateAuthentication verifies the authority's exact identity.

func (*Authority) ValidateSnapshot

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

ValidateSnapshot verifies that snapshot is authenticated by this authority.

type Builder

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

Builder seals one complete canonical artifact set.

func NewBuilder

func NewBuilder(authority *Authority, previous *Snapshot) (*Builder, error)

NewBuilder starts a complete set under authority. Previous must belong to the same authority so exact roots and unchanged artifacts can be reused.

func (*Builder) Add

func (b *Builder) Add(descriptor Descriptor, content *Content) error

Add declares one artifact. Exact duplicate declarations are idempotent.

func (*Builder) Build

func (b *Builder) Build() (*Snapshot, error)

Build seals the complete set atomically.

type Content

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

Content is one authenticated immutable artifact payload.

func NewDocumentContent

func NewDocumentContent(document rendercontent.Document, final string, direct bool) (*Content, error)

NewDocumentContent retains an authenticated source document and seals the final artifact bytes. Direct content must equal the document exactly.

func NewLiteralContent

func NewLiteralContent(value string) *Content

NewLiteralContent detaches and seals literal artifact bytes.

func (*Content) Bytes

func (c *Content) Bytes() (int, error)

Bytes returns the final payload length.

func (*Content) SameRoot

func (c *Content) SameRoot(other *Content) (bool, error)

SameRoot reports exact authenticated representation identity.

func (*Content) String

func (c *Content) String() (string, error)

String returns the final payload bytes as a string.

func (*Content) ValidateAuthentication

func (c *Content) ValidateAuthentication() error

ValidateAuthentication verifies the exact immutable representation in constant time.

func (*Content) WriteTo

func (c *Content) WriteTo(writer io.Writer) (int64, error)

WriteTo streams the final payload to writer.

type Delta

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

Delta is an authenticated transition between exact artifact roots.

func (*Delta) Apply

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

Apply returns this delta's next root only for its exact base.

func (*Delta) Changes

func (d *Delta) Changes() ([]SnapshotChange, error)

Changes returns the authenticated changed artifacts without materializing content.

func (*Delta) RequiresFullValidation

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

RequiresFullValidation reports set or descriptor changes that affect unchanged consumers.

func (*Delta) SameRoot

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

SameRoot reports whether no artifact changed.

func (*Delta) ValidateAuthentication

func (d *Delta) ValidateAuthentication() error

ValidateAuthentication verifies the exact transition and every changed record.

type Descriptor

type Descriptor struct {
	Family Family
	// Name is Filename for general families and the canonical path identity otherwise.
	Name string
	// Path is the compatibility output path and remains part of equality.
	Path string
	// RuntimePath is the path declared in the render plan. Empty defaults to Path.
	RuntimePath string
	// ReloadOnChange is effective General metadata; every other family normalizes false.
	ReloadOnChange bool
}

Descriptor is the deployment-relevant identity and metadata of one artifact.

type Family

type Family uint8

Family identifies one legacy AuxiliaryFiles family without collapsing files that happen to share deployment behaviour.

const (
	Map Family = iota + 1
	General
	Certificate
	CA
	CRTList
	GeneralCA
)

type Handle

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

Handle proves the exact artifact currently stored under one canonical key.

type Snapshot

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

Snapshot is an authenticated immutable sorted artifact set.

func (*Snapshot) ExactEqual

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

ExactEqual compares every descriptor and final byte when roots differ; digests only reject.

func (*Snapshot) Len

func (s *Snapshot) Len() (int, error)

Len returns the number of artifacts.

func (*Snapshot) Lookup

func (s *Snapshot) Lookup(descriptor Descriptor) (*Handle, bool, error)

Lookup returns an exact handle for descriptor's canonical key.

func (*Snapshot) SameRoot

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

SameRoot reports exact authenticated set identity.

func (*Snapshot) ValidateAuthentication

func (s *Snapshot) ValidateAuthentication() error

ValidateAuthentication verifies the exact immutable root in constant time.

func (*Snapshot) Walk

func (s *Snapshot) Walk(visit func(*Artifact) error) error

Walk visits artifacts in family and canonical-identity order.

type SnapshotChange

type SnapshotChange struct {
	Before *Artifact
	After  *Artifact
}

SnapshotChange is one authenticated artifact transition.

type Transaction

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

Transaction atomically path-copies artifact changes from one exact base.

func BeginTransaction

func BeginTransaction(authority *Authority, base *Snapshot) (*Transaction, error)

BeginTransaction starts an atomic edit against base.

func (*Transaction) Commit

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

Commit seals the next snapshot and its exact base-to-next proof.

func (*Transaction) Delete

func (t *Transaction) Delete(expected *Handle) error

Delete removes only the exact artifact proven by expected.

func (*Transaction) Insert

func (t *Transaction) Insert(descriptor Descriptor, content *Content) error

Insert adds an artifact only when its canonical key is absent from base.

func (*Transaction) Replace

func (t *Transaction) Replace(expected *Handle, descriptor Descriptor, content *Content) error

Replace changes only the exact artifact proven by expected.

Jump to

Keyboard shortcuts

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