verify

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Check    string             `json:"check"`
	Severity contracts.Severity `json:"severity"`
	URL      string             `json:"url"`
	Element  string             `json:"element,omitempty"`
	Message  string             `json:"message"`
	Fix      string             `json:"fix,omitempty"`
	Evidence string             `json:"evidence,omitempty"`
}

Finding is the neutral verification finding contract shared across Hawk and verification engines.

type Report

type Report struct {
	Target      string             `json:"target"`
	Findings    []Finding          `json:"findings"`
	Stats       Stats              `json:"stats"`
	CrawledURLs int                `json:"crawled_urls"`
	Duration    time.Duration      `json:"duration"`
	FailOn      contracts.Severity `json:"fail_on"`
	// FailOnSet reports whether FailOn was explicitly configured via
	// SetFailOn. When it is false, Failed() treats SeverityCritical as the
	// effective threshold: an unset FailOn must not fail the report on
	// informational findings just because SeverityInfo is the zero value.
	FailOnSet bool `json:"fail_on_set,omitempty"`
}

Report is the neutral verification report contract.

func (*Report) Failed

func (r *Report) Failed() bool

Failed reports whether any finding meets or exceeds the configured fail threshold. When the threshold was never set — a zero Report, or a Report whose FailOn field was assigned directly — SeverityCritical is used as the effective threshold, mirroring review.Result.

func (*Report) MaxSeverity

func (r *Report) MaxSeverity() contracts.Severity

MaxSeverity returns the highest severity present in the report.

func (*Report) SetFailOn added in v0.1.13

func (r *Report) SetFailOn(sev contracts.Severity)

SetFailOn sets the fail threshold used by Failed. Set the threshold through this method rather than assigning FailOn directly, so that the threshold is recorded as explicitly configured.

type Stats

type Stats struct {
	PagesScanned     int                        `json:"pages_scanned"`
	FindingsTotal    int                        `json:"findings_total"`
	BySeverity       map[contracts.Severity]int `json:"by_severity"`
	ByCheck          map[string]int             `json:"by_check"`
	DurationPerCheck map[string]time.Duration   `json:"duration_per_check"`
}

Stats captures verification execution metrics.

Jump to

Keyboard shortcuts

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