effective

package
v0.45.0 Latest Latest
Warning

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

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

Documentation

Overview

Package effective renders the effective (fully-composed, canonicalized) solution document as stable, deterministic JSON or YAML.

The "effective" solution is the document that results after applying the solution's compose: merges. Unlike rendering the action graph, this transform performs NO resolver execution and NO provider calls -- it is a pure document projection suitable for golden-file fidelity diffing, code review, and debugging composition (mirroring `docker compose config`, `helm template`, and `kustomize build`).

Determinism: both encoding/json and gopkg.in/yaml.v3 marshal Go maps in sorted-key order and structs in field-declaration order, so the output is byte-stable across runs for a given input. This is what makes the output safe to commit as a golden file and diff in CI.

Index

Constants

This section is empty.

Variables

ValidSections lists the accepted --section values for help and validation.

Functions

func Render

func Render(sol *solution.Solution, opts Options) ([]byte, error)

Render serializes the effective (post-compose) solution into deterministic bytes. The caller is responsible for loading the solution with compose already applied (the standard getter does this on load).

Render never executes resolvers or providers; it is a pure projection of the already-composed document.

Types

type Format

type Format string

Format selects the output serialization.

const (
	// FormatYAML serializes the effective document as YAML.
	FormatYAML Format = "yaml"
	// FormatJSON serializes the effective document as JSON.
	FormatJSON Format = "json"
)

type Options

type Options struct {
	// Section scopes the output. Defaults to SectionAll when empty.
	Section Section
	// Format selects the serialization. Defaults to FormatYAML when empty.
	Format Format
	// Compact disables pretty-printing for JSON output. Ignored for YAML.
	Compact bool
}

Options configures how the effective solution is rendered.

type Section

type Section string

Section scopes the effective output to a portion of the solution.

const (
	// SectionAll emits the entire effective solution document.
	SectionAll Section = "all"
	// SectionWorkflow emits only spec.workflow (actions and finally).
	SectionWorkflow Section = "workflow"
	// SectionResolvers emits only spec.resolvers.
	SectionResolvers Section = "resolvers"
)

Jump to

Keyboard shortcuts

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