validator

package
v0.0.0-...-d6406eb Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCategories

func GetCategories() ([]string, error)

Gets the list of predefined category list

func LoadEnv

func LoadEnv() string

Loads the Env variable

func NewTaskValidator

func NewTaskValidator(r *parser.Resource) *taskValidator

Types

type Category

type Category struct {
	Name string
}

type ContentValidator

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

func NewContentValidator

func NewContentValidator(r *parser.Resource, c []string) *ContentValidator

func (*ContentValidator) Validate

func (v *ContentValidator) Validate() Result

type Data

type Data struct {
	Categories []Category
}

type Kind

type Kind int
const (
	// represents Queued state
	Error Kind = iota
	Warning
	Recommendation
	Info
)

func (Kind) String

func (t Kind) String() string

type Lint

type Lint struct {
	Kind    Kind
	Message string
}

type PathValidator

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

func NewPathValidator

func NewPathValidator(r *parser.Resource, path string) *PathValidator

func (*PathValidator) Validate

func (v *PathValidator) Validate() Result

type Result

type Result struct {
	//Status Status
	Lints    []Lint
	Errors   int
	Warnings int
}

func (*Result) Append

func (r *Result) Append(other Result)

func (*Result) Error

func (r *Result) Error(format string, args ...interface{})

func (*Result) Info

func (r *Result) Info(format string, args ...interface{})

func (*Result) Recommend

func (r *Result) Recommend(format string, args ...interface{})

func (*Result) Warn

func (r *Result) Warn(format string, args ...interface{})

type Status

type Status int
const (
	// represents Queued state
	Passed Status = iota
	Failed
	Unknown
)

func (Status) String

func (s Status) String() string

type Validator

type Validator interface {
	Validate() Result
}

func ForKind

func ForKind(res *parser.Resource) Validator

Jump to

Keyboard shortcuts

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