configvalidate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package configvalidate implements schema and semantic validation for cloop config and state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Severity Severity
	Field    string
	Message  string
	// FixNote describes what --fix will do. Empty means not auto-fixable.
	FixNote string
}

Finding is a single validation result.

type Report

type Report struct {
	Findings []Finding
	// Fixed lists human-readable descriptions of auto-corrections applied by --fix.
	Fixed []string
}

Report holds all findings from a validation run.

func Run

func Run(ctx context.Context, workdir string, opts ValidateOptions) (*Report, error)

Run executes all validation checks against the project at workdir.

func (*Report) Counts

func (r *Report) Counts() (errors, warns, infos int)

Counts returns counts by severity.

func (*Report) HasErrors

func (r *Report) HasErrors() bool

HasErrors returns true if any ERROR-severity findings exist.

type Severity

type Severity string

Severity is the severity level of a validation finding.

const (
	SeverityError Severity = "ERROR"
	SeverityWarn  Severity = "WARN"
	SeverityInfo  Severity = "INFO"
)

type ValidateOptions

type ValidateOptions struct {
	// Probe performs live HTTP reachability checks for notification URLs.
	Probe bool
	// Fix auto-corrects safe issues in place (unknown keys stripped, bad statuses reset).
	Fix bool
}

ValidateOptions controls optional behaviour.

Jump to

Keyboard shortcuts

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