Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(vObj reflect.Value, ast AstNode, source io.ReadSeeker, checkUnusedKeys bool) (r report.Report)
Validate walks down a struct tree calling Validate on every node that implements it, building A report of all the errors, warnings, info, and deprecations it encounters. If checkUnusedKeys is true, Validate will generate warnings for unused keys in the ast, otherwise it will not.
Types ¶
type AstNode ¶ added in v0.12.0
type AstNode interface { // ValueLineCol returns the line, column, and highlight string of the value of // this node in the source. ValueLineCol(source io.ReadSeeker) (int, int, string) // KeyLineCol returns the line, column, and highlight string of the key for the // value of this node in the source. KeyLineCol(source io.ReadSeeker) (int, int, string) // LiteralValue returns the value of this node. LiteralValue() interface{} // SliceChild returns the child node at the index specified. If this node is not // a slice node, an empty AstNode and false is returned. SliceChild(index int) (AstNode, bool) // KeyValueMap returns a map of keys and values. If this node is not a mapping // node, nil and false are returned. KeyValueMap() (map[string]AstNode, bool) // Tag returns the struct tag used in the config structure used to unmarshal. Tag() string }
AstNode abstracts the differences between yaml and json nodes, providing a common interface
Click to show internal directories.
Click to hide internal directories.