Documentation
¶
Overview ¶
Package validation implements complete DraftView validation from Spec 007.
Index ¶
Constants ¶
const ( SeverityInfo = "info" SeverityWarning = "warning" SeverityError = "error" SeverityBlocking = "blocking" ReadinessReady = "ready" ReadinessBlocked = "blocked" StatusFresh = "fresh" StatusStale = "stale" )
Variables ¶
var ErrNotFound = errors.New("validation result not found")
Functions ¶
func ExitCodeFor ¶
func ExitCodeFor(diagnostics []Diagnostic) int
ExitCodeFor returns the CLI process exit code defined by Spec 007.
func ReadinessFor ¶
func ReadinessFor(diagnostics []Diagnostic) string
ReadinessFor returns the complete-validation readiness for diagnostics.
func SortDiagnostics ¶
func SortDiagnostics(diagnostics []Diagnostic)
SortDiagnostics applies the frozen diagnostic ordering.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Path string `json:"path"`
Severity string `json:"severity"`
Message string `json:"message"`
EntityRef string `json:"entity_ref,omitempty"`
FixSuggestion string `json:"fix_suggestion"`
DocumentationURL string `json:"documentation_url,omitempty"`
}
Diagnostic is the stable, display-independent diagnosis contract.
func Validate ¶
func Validate(input Input) []Diagnostic
Validate dispatches to the validator for the selected mobile advertising Pack version. Other Pack versions have no domain rules yet.
type Input ¶
type Input struct {
PackRef string
EnvironmentID string
EnvironmentKind string
Effective map[string]any
RestrictedDeletes []RestrictedDelete
}
Input is the captured DraftView data needed for a complete validation run. RestrictedDeletes is supplied by callers that validate a pending restricted deletion; ordinary full validation leaves it empty.
type RestrictedDelete ¶
type Result ¶
type Result struct {
EnvironmentID string `json:"environment_id"`
ValidatedDraftRevision uint64 `json:"validated_draft_revision"`
ValidatedAt time.Time `json:"validated_at"`
Status string `json:"status"`
Readiness string `json:"readiness"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
Result is persisted after a complete validation run.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists complete-validation results next to draft state. This is a temporary Spec 005 boundary: source configuration persistence is not owned by this file and validation records remain local under .conflow.