validate

package
v0.8.45 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultWorkers         = 5
	DefaultVSAExpiration   = "168h" // 7 days
	DefaultEffectiveTime   = "now"
	DefaultStrictMode      = true
	DefaultFallbackEnabled = true
)

Constants for default values

Variables

View Source
var ValidateCmd *cobra.Command

Functions

func NewValidateCmd

func NewValidateCmd() *cobra.Command

func NewValidateVSACmd added in v0.8.39

func NewValidateVSACmd() *cobra.Command

func ValidatePolicyCmd

func ValidatePolicyCmd(validate policyValidationFunc) *cobra.Command

Types

type InputValidationFunc

type InputValidationFunc func(context.Context, string, policy.Policy, bool) (*output.Output, error)

type OutputFormatter added in v0.8.44

type OutputFormatter interface {
	PrintJSON(writer io.Writer) error
	PrintText(writer io.Writer) error
}

OutputFormatter defines the interface for objects that can be formatted for output

type ResultType added in v0.8.44

type ResultType int

ResultType represents the classification of a component validation result

const (
	ResultTypeError ResultType = iota
	ResultTypeFallback
	ResultTypeVSASuccess
	ResultTypeVSAFailure
	ResultTypeUnexpected
)

type UnifiedResultAdapter added in v0.8.44

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

UnifiedResultAdapter adapts VSAValidationResult to OutputFormatter interface

func (*UnifiedResultAdapter) PrintJSON added in v0.8.44

func (a *UnifiedResultAdapter) PrintJSON(writer io.Writer) error

PrintJSON outputs the unified result as JSON

func (*UnifiedResultAdapter) PrintText added in v0.8.44

func (a *UnifiedResultAdapter) PrintText(writer io.Writer) error

PrintText outputs the unified result as text (using PrintConsole)

type VSAReport added in v0.8.44

type VSAReport struct {
	Timestamp      string                `json:"timestamp"`
	TotalResults   int                   `json:"total_results"`
	SuccessCount   int                   `json:"success_count"`
	FailureCount   int                   `json:"failure_count"`
	FallbackCount  int                   `json:"fallback_count,omitempty"`
	Results        []vsa.ComponentResult `json:"results"`
	OverallSuccess bool                  `json:"overall_success"`
}

VSAReport represents the output structure for VSA validation results

func (*VSAReport) PrintJSON added in v0.8.44

func (r *VSAReport) PrintJSON(writer io.Writer) error

PrintJSON outputs the report in JSON format

func (*VSAReport) PrintText added in v0.8.44

func (r *VSAReport) PrintText(writer io.Writer) error

PrintText outputs the report in text format

Jump to

Keyboard shortcuts

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