internal

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONAlpha1 = "json-alpha1"
	Text       = "text"
)

Variables

This section is empty.

Functions

func NewLoggerTo

func NewLoggerTo(w io.Writer) *log.Logger

NewLoggerTo returns a logger that writes logs to w.

Types

type Result

type Result struct {
	Passed  bool     `json:"passed"`
	Outputs []output `json:"outputs"`
}

Result represents the final result

func NewResult

func NewResult() Result

NewResult return a new result object which starts with passed == true since has no errors

func (*Result) AddError

func (o *Result) AddError(err error)

AddError will add a log to the result with the Error Level

func (*Result) AddInfo

func (o *Result) AddInfo(msg string)

AddInfo will add a log to the result with the Info Level

func (*Result) AddWarn

func (o *Result) AddWarn(err error)

AddWarn will add a log to the result with the Warn Level

func (*Result) PrintWithFormat

func (o *Result) PrintWithFormat(format string) (err error)

PrintWithFormat prints output to w in format, and exits if some object in output is not in a passing state.

Jump to

Keyboard shortcuts

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