Documentation ¶
Index ¶
- type Entry
- type EntryKind
- type Kind
- type Report
- func (r *Report) AddOn(c path.ContextPath, err error, k EntryKind)
- func (r *Report) AddOnError(c path.ContextPath, err error)
- func (r *Report) AddOnInfo(c path.ContextPath, err error)
- func (r *Report) AddOnWarn(c path.ContextPath, err error)
- func (r *Report) Correlate(n tree.Node)
- func (r Report) IsFatal() bool
- func (r *Report) Merge(child Report)
- func (r Report) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { // Kind is the severity of the message. Kind EntryKind Message string // Context is the logical location of the error. Context path.ContextPath // Marker is the literal location in a json or yaml blob of the error. Marker tree.Marker }
Entry represents one error or message from validation.
type Report ¶
type Report struct {
Entries []Entry
}
Report is a collection of information from validating a struct.
func (*Report) AddOnError ¶
func (r *Report) AddOnError(c path.ContextPath, err error)
AddOnError adds err to report with kind "Error" if err is not nil.
func (*Report) AddOnInfo ¶
func (r *Report) AddOnInfo(c path.ContextPath, err error)
AddOnInfo adds err to report with kind "Info" if err is not nil.
func (*Report) AddOnWarn ¶
func (r *Report) AddOnWarn(c path.ContextPath, err error)
AddOnWarn adds err to report with kind "Warning" if err is not nil.
func (*Report) Correlate ¶
Correlate takes a node tree and populates the markers in the report's entries based on the entries' context.
Click to show internal directories.
Click to hide internal directories.