verifier

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Errors   []string
	Warnings []string
}

Result holds the errors and warnings of a package verification

func NewError

func NewError(err ...string) Result

func NewResult

func NewResult() Result

NewResult initializes the Result struct

func NewWarning

func NewWarning(warn ...string) Result

func (*Result) AddErrors

func (vr *Result) AddErrors(err ...string)

AddErrors adds an arbitrary error string to the verification result

func (*Result) AddGroupError added in v0.17.0

func (vr *Result) AddGroupError(groupName string, reason string)

func (*Result) AddGroupWarning added in v0.18.0

func (vr *Result) AddGroupWarning(groupName string, reason string)

func (*Result) AddParamError

func (vr *Result) AddParamError(paramName string, reason string)

AddParamError adds a formatted error string for a package parameter error

func (*Result) AddParamWarning

func (vr *Result) AddParamWarning(paramName string, reason string)

AddParamWarning adds a formatted warning string for a package parameter error

func (*Result) AddWarnings

func (vr *Result) AddWarnings(wrn ...string)

AddWarnings adds an arbitrary warning string to the verification result

func (*Result) ErrorsAsString

func (vr *Result) ErrorsAsString() string

ErrorsAsString returns all errors as a single string

func (*Result) ForOutput added in v0.16.0

func (vr *Result) ForOutput() ResultForOutput

func (*Result) IsEmpty

func (vr *Result) IsEmpty() bool

IsEmpty returns true if verification result has no errors AND no warnings

func (*Result) IsValid

func (vr *Result) IsValid() bool

IsValid returns true if verification result does not have errors

func (*Result) Merge

func (vr *Result) Merge(other Result)

Merge method merges the errors and warnings from two verification results

func (*Result) PrintErrors

func (vr *Result) PrintErrors(out io.Writer)

PrintErrors is a pretty printer for verification errors

func (*Result) PrintWarnings

func (vr *Result) PrintWarnings(out io.Writer)

PrintWarnings is a pretty printer for verification warnings

type ResultForOutput added in v0.16.0

type ResultForOutput struct {
	Errors   []string `json:"errors"`
	Warnings []string `json:"warnings"`
	Valid    bool     `json:"valid"`
}

ResultForOutput provides a serialization format for yaml/json output of a result

Jump to

Keyboard shortcuts

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