validation

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package validation performs structural, format, and semantic validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLedger

func DecodeLedger(source *document.Document) (*ledger.Ledger, error)

Types

type SchemaIssue

type SchemaIssue struct {
	Layer            string `json:"layer"`
	Code             string `json:"code"`
	InstanceLocation string `json:"instance_location"`
	SchemaLocation   string `json:"schema_location"`
	Message          string `json:"message"`
}

type SemanticIssue

type SemanticIssue struct {
	Layer   string `json:"layer"`
	Code    string `json:"code"`
	Pointer string `json:"pointer"`
	Message string `json:"message"`
}

func ValidateSemantics

func ValidateSemantics(model *ledger.Ledger, artifacts fs.FS) ([]SemanticIssue, error)

ValidateSemantics runs cross-field checks after structural validation. artifacts is rooted at the ledger's artifact directory. A nil filesystem intentionally skips artifact-byte checks for model-only prospective validation and stdin inspection; path-backed validation must pass the confined ledger-relative filesystem so missing or changed artifacts fail.

type StructuralValidator

type StructuralValidator struct {
	// contains filtered or unexported fields
}

func DefaultStructuralValidator

func DefaultStructuralValidator() (*StructuralValidator, error)

func (*StructuralValidator) Validate

func (v *StructuralValidator) Validate(document any) ([]SchemaIssue, error)

Jump to

Keyboard shortcuts

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