Documentation ¶
Overview ¶
Package check is a collection of functions that assert various facts about the strings.
Package check is a collection of functions that can be used for checking single values. These functions are so simple there are many useful ways they can be generated and some common cases are provided here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Func ¶
Func is a check function, defined here as a simple function that takes a string and returns an error explaining why the check failed or nil if the input passed the check.
func And ¶
And combines multiple check Func's into a single one where all must pass. Short circuits on first failure.
func Equality ¶
Equality dose a string equality check on the found value. This performs no deserialization of the value, this means you may need to include qoutes for strings.
func Invert ¶
Invert the output of the given Func, if it returned nil then return an error, if it returned error return nil.
func Or ¶
Or combines multiple check Func's into a single one where any one must pass, the rest may fail. Short circuits on first success.
func RegexMatch ¶
RegexMatch compiles the given regex and returns a patcheck Func that asserts values match the expression.