validation

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidFileTypes

func ValidFileTypes() []string

ValidFileTypes returns the list of accepted --type values.

Types

type FileType

type FileType string

FileType identifies which schema to validate against.

const (
	FileTypeFlowFile  FileType = "flowfile"
	FileTypeWorkspace FileType = "workspace"
	FileTypeConfig    FileType = "config"
	FileTypeTemplate  FileType = "template"
)

func DetectFileType

func DetectFileType(filePath string) (FileType, error)

DetectFileType infers the schema type from the file's name.

type Issue

type Issue struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

Issue represents a single validation error.

func (Issue) String

func (i Issue) String() string

type Result

type Result struct {
	Valid  bool    `json:"valid"`
	Errors []Issue `json:"errors,omitempty"`
}

Result holds the outcome of a validation.

func ValidateBytes

func ValidateBytes(data []byte, ft FileType, strict bool) (*Result, error)

ValidateBytes validates raw YAML content against the schema for the given file type.

func ValidateFile

func ValidateFile(filePath string, ft FileType, strict bool) (*Result, error)

ValidateFile reads a file from disk and validates it against the appropriate schema.

Jump to

Keyboard shortcuts

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