output

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorizeJSON

func ColorizeJSON(raw []byte) []byte

ColorizeJSON adds ANSI colors to severity values for terminal display.

func FixHint

func FixHint(ruleID string) (string, bool)

FixHint returns a deterministic remediation hint for a rule code.

func FormatJSON

func FormatJSON(payload any, pretty bool) ([]byte, error)

FormatJSON renders the payload as JSON, optionally pretty printed.

func RenderJSONError

func RenderJSONError(specFile string, exitCode int, message string, debug *Debug) (any, jsonSummary, error)

RenderJSONError builds a JSON error response when findings cannot be produced.

func RenderJSONReport

func RenderJSONReport(specFile string, report validate.Report, exitCode int, debug *Debug) (any, jsonSummary, error)

RenderJSONReport renders a report to JSON with the required schema.

func RenderReport

func RenderReport(r validate.Report) string

RenderReport is kept for compatibility with existing callers.

Types

type CheckResult

type CheckResult struct {
	Target   string
	Report   validate.Report
	ExitCode int
}

CheckResult holds all data required by human renderers.

type ClassicRenderer

type ClassicRenderer struct{}

ClassicRenderer preserves the original human-readable output format.

func (ClassicRenderer) Render

func (ClassicRenderer) Render(result CheckResult, _ RenderOptions) string

Render renders a report in classic mode.

type Debug

type Debug struct {
	InternalError string `json:"internal_error"`
	Stacktrace    string `json:"stacktrace"`
}

type HumanRenderer

type HumanRenderer interface {
	Render(result CheckResult, opts RenderOptions) string
}

HumanRenderer renders human-readable output.

type RenderOptions

type RenderOptions struct {
	Width int
}

RenderOptions controls human output formatting.

type ReportRenderer

type ReportRenderer struct{}

ReportRenderer renders the structured interactive report format.

func (ReportRenderer) Render

func (ReportRenderer) Render(result CheckResult, opts RenderOptions) string

Render renders a report in structured report mode.

type Verdict

type Verdict string

Jump to

Keyboard shortcuts

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