output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Bold   = "\033[1m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Cyan   = "\033[36m"
)

Variables

This section is empty.

Functions

func Detail

func Detail(msg string)

func Error

func Error(msg string)
func Header(msg string)

func Info

func Info(msg string)

func RenderDiff

func RenderDiff(f FindingOutput) []string

RenderDiff returns a colorized git-style line diff for a finding.

func Success

func Success(msg string)

func Warning

func Warning(msg string)

Types

type FindingOutput

type FindingOutput struct {
	FilePath  string `json:"file_path"`
	Operation string `json:"operation"`
	Message   string `json:"message"`
	Expected  string `json:"-"`
	Actual    string `json:"-"`
}

FindingOutput is the JSON representation of a finding.

type RepoResult

type RepoResult struct {
	Name             string          `json:"repo"`
	Status           string          `json:"status"`
	StatusDetail     string          `json:"status_detail,omitempty"`
	ValidationErrors []string        `json:"validation_errors,omitempty"`
	Findings         []FindingOutput `json:"findings,omitempty"`
}

RepoResult represents the result for a single repository.

type Report

type Report struct {
	Tool          ToolMeta     `json:"tool"`
	RootConfig    string       `json:"root_config_path"`
	ConfigRepo    string       `json:"central_config_path"`
	IgnoreMissing bool         `json:"-"`
	Repos         []RepoResult `json:"repos"`
}

Report is the structured JSON output for all commands.

func NewReport

func NewReport(version, command, rootConfigPath, configRepoPath string) *Report

NewReport creates a new report.

func (*Report) HasFailures

func (r *Report) HasFailures() bool

HasFailures returns true if any repo has a non-clean status that indicates failure.

func (*Report) PrintHuman

func (r *Report) PrintHuman(verbose bool)

PrintHuman outputs the report in human-readable format.

func (*Report) PrintJSON

func (r *Report) PrintJSON() error

PrintJSON outputs the report as JSON.

type ToolMeta

type ToolMeta struct {
	Name      string `json:"name"`
	Version   string `json:"version"`
	Timestamp string `json:"timestamp"`
	Command   string `json:"command"`
}

ToolMeta contains tool metadata.

Jump to

Keyboard shortcuts

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