validator

package
v0.0.0-...-f6b2a55 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateVersionName

func ValidateVersionName(versionName string) bool

Types

type ValidationErrors

type ValidationErrors []error

ValidationErrors is an array of Error's to store multiple error messages post validation. NOTE: this technique based on github.com/go-playground/validator.

func (ValidationErrors) Error

func (ve ValidationErrors) Error() string

Error method allows ValidationErrors to subscribe to the Error interface.

type Validator

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

Validator struct contains methods to validate a KRT file.

func New

func New() Validator

New creates a new Validator instance.

func NewWithLogger

NewWithLogger creates a new Validator instance with a custom logger.

func (*Validator) Parse

func (v *Validator) Parse(r io.Reader) (*krt.File, error)

Parse parse a Krt file from the given Reader.

func (*Validator) ParseFile

func (v *Validator) ParseFile(yamlFile string) (*krt.File, error)

ParseFile parse a Krt file from the given filename that must exists on the filesystem.

func (*Validator) Validate

func (v *Validator) Validate(file *krt.File) error

Validate check Krt structure compliance and reference between nodes and workflows.

func (*Validator) ValidateContent

func (v *Validator) ValidateContent(file *krt.File, rootDir string) error

ValidateContent checks Krt file references exists on the filesystem.

Jump to

Keyboard shortcuts

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