output

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package output renders canonical JSON and derived report formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailsThreshold

func FailsThreshold(reader io.Reader, threshold string, failOnUnknown bool) (bool, error)

FailsThreshold evaluates CI status strictly from canonical finding fields.

func WriteHTML

func WriteHTML(writer io.Writer, reader io.Reader) error

WriteHTML renders a self-contained static report from canonical JSON.

func WriteSARIF

func WriteSARIF(writer io.Writer, reader io.Reader) error

WriteSARIF renders a SARIF 2.1.0 compatibility projection from canonical JSON.

func WriteScanJSON

func WriteScanJSON(w io.Writer, input ScanInput) error

WriteScanJSON writes an indented canonical JSON report.

func WriteScanJSONWithEvaluation

func WriteScanJSONWithEvaluation(w io.Writer, input ScanInput, packs []engine.Pack, evaluated engine.Result) error

WriteScanJSONWithEvaluation writes a report using an already-computed rule engine result. The scan command uses this path so repeatable user packs and producer-specific availability facts are preserved without changing the frozen canonical JSON shape.

func WriteScanJSONWithRuntime added in v0.2.0

func WriteScanJSONWithRuntime(w io.Writer, input ScanInput, packs []engine.Pack, evaluated engine.Result, runtime RuntimeInput) error

WriteScanJSONWithRuntime preserves the existing declared output assembly and adds only schema-defined runtime evidence. Credentials are never accepted here.

func WriteScore

func WriteScore(writer io.Writer, reader io.Reader, namespace string) error

WriteScore renders the score fields already present in canonical JSON.

Types

type RuntimeInput added in v0.2.0

type RuntimeInput struct {
	Enabled    bool
	URL        string
	Lookback   string
	DegradedTo string
	Verified   map[string]map[string]any
}

RuntimeInput supplies optional runtime evidence separately from the frozen ScanInput and resolver interfaces. Keys use namespace/name, within one cluster.

type ScanInput

type ScanInput struct {
	GeneratedAt       time.Time
	ScannerVersion    string
	ResolverVersion   string
	ClusterContext    string
	Scope             ScanScope
	PermissionSummary []collect.Permission
	Inventory         normalize.Inventory
	WorkloadPostures  []resolver.WorkloadResult
}

ScanInput contains the generated scan data needed for canonical JSON output.

type ScanScope

type ScanScope struct {
	AllNamespaces bool
	Namespaces    []string
}

ScanScope is the output-facing copy of the scan scope.

Jump to

Keyboard shortcuts

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