Documentation
¶
Overview ¶
Package diagnostic provides product-neutral diagnostic records and helpers.
Index ¶
Constants ¶
View Source
const ( SeverityError = "error" SeverityWarning = "warning" SeverityInfo = "info" SeverityBlocking = "blocking" SeverityAdvisory = "advisory" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeSeverity ¶
NormalizeSeverity returns a stable lowercase severity. Empty and unknown severities are treated as warnings, which is the safest non-success default.
Types ¶
type Location ¶
type Location struct {
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Address string `json:"address,omitempty"`
ModuleAddress string `json:"module_address,omitempty"`
APISourceKind string `json:"api_source_kind,omitempty"`
APISourceID string `json:"api_source_id,omitempty"`
OperationID string `json:"operation_id,omitempty"`
Field string `json:"field,omitempty"`
}
Location identifies the artifact, resource, source, or field tied to a diagnostic without requiring a product-specific type.
type Record ¶
type Record struct {
Code string `json:"code"`
Severity string `json:"severity"`
Message string `json:"message"`
Location Location `json:"location,omitempty"`
Remediation string `json:"remediation,omitempty"`
Detail map[string]any `json:"detail,omitempty"`
}
Record describes one validation, review, authoring, or runtime evidence issue in a product-neutral shape.
func NormalizeAll ¶
NormalizeAll returns normalized records without mutating the input slice.
Click to show internal directories.
Click to hide internal directories.