reporting

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2016 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int
const (
	Failure Level = iota
	Warning
	Success
)

type Path

type Path interface {
	Path() []string
}

type Report

type Report struct {
	Level        Level
	Message      string
	Path         []string
	PathReadable string
}

func NewFailure

func NewFailure(path Path, format string, args ...interface{}) *Report

func NewInvalidTypeFailure

func NewInvalidTypeFailure(path Path, actual string, expected Type) *Report

func NewWarning

func NewWarning(path Path, format string, args ...interface{}) *Report

func (Report) String

func (f Report) String() string

type Reports

type Reports []*Report

func Safe

func Safe(f Reports) Reports

Safe returns either the given list of failures, or nil if there are no failures.

func (Reports) Stats

func (reports Reports) Stats() Stats

func (Reports) String

func (f Reports) String() string

type Stats

type Stats struct {
	Failures, Warnings, Total int
}

type Type

type Type interface {
	Describe() string
}

type ValidateResult

type ValidateResult string
const (
	// ValidateOK indicates that validation should continue regardless of
	// whether the current set of tests passed or failed. This is useful for when
	// you are chaining tests together.
	ValidateOK ValidateResult = "OK"
	// ValidateAbort means validation either passed or failed, and should not
	// execute any more validations; this is used when something like a Ref is
	// validated, no more validations should run from the ValueString suite
	// because they're meaningless against a Ref.
	ValidateAbort ValidateResult = "Abort"
)

Jump to

Keyboard shortcuts

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