prepack

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileError

type FileError struct {
	File  string
	Error string
}

FileError associates a validation error with the file that caused it.

type ValidationOptions

type ValidationOptions struct {
	SkipTests bool
}

ValidationOptions controls which stages run in the pre-pack pipeline.

type ValidationResult

type ValidationResult struct {
	FilesChecked       int
	SyntaxErrors       []FileError
	ContractViolations []evaluator.ContractViolation
	TestResults        *evaluator.TestResults
	TestsSkipped       bool
}

ValidationResult holds the outcome of the pre-pack validation pipeline.

func Validate

func Validate(ctx context.Context, contentDir string, eval evaluator.Evaluator, cueSchemas []cue.Value, opts ValidationOptions) (*ValidationResult, error)

Validate runs the pre-pack validation pipeline against a content directory. Three stages execute in order, each fail-fast:

  1. Syntax check -- parse all policy files
  2. Contract check -- verify input.* references against CUE schema
  3. Test execution -- run policy unit tests

If cueSchemas is empty, contract checking is skipped with a warning.

func (*ValidationResult) Valid

func (r *ValidationResult) Valid() bool

Valid returns true if there are no syntax errors, contract violations, or test failures.

Jump to

Keyboard shortcuts

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