Documentation ¶
Index ¶
- func All(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc
- func Any(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc
- func CIDRNetwork(min, max int) schema.SchemaValidateFunc
- func FloatBetween(min, max float64) schema.SchemaValidateFunc
- func IPRange() schema.SchemaValidateFunc
- func IntAtLeast(min int) schema.SchemaValidateFunc
- func IntAtMost(max int) schema.SchemaValidateFunc
- func IntBetween(min, max int) schema.SchemaValidateFunc
- func IntInSlice(valid []int) schema.SchemaValidateFunc
- func NoZeroValues(i interface{}, k string) (s []string, es []error)
- func SingleIP() schema.SchemaValidateFunc
- func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc
- func StringLenBetween(min, max int) schema.SchemaValidateFunc
- func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc
- func ValidateJsonString(v interface{}, k string) (ws []string, errors []error)
- func ValidateListUniqueStrings(v interface{}, k string) (ws []string, errors []error)
- func ValidateRFC3339TimeString(v interface{}, k string) (ws []string, errors []error)
- func ValidateRegexp(v interface{}, k string) (ws []string, errors []error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶ added in v0.11.12
func All(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc
All returns a SchemaValidateFunc which tests if the provided value passes all provided SchemaValidateFunc
func Any ¶ added in v0.11.12
func Any(validators ...schema.SchemaValidateFunc) schema.SchemaValidateFunc
Any returns a SchemaValidateFunc which tests if the provided value passes any of the provided SchemaValidateFunc
func CIDRNetwork ¶ added in v0.9.2
func CIDRNetwork(min, max int) schema.SchemaValidateFunc
CIDRNetwork returns a SchemaValidateFunc which tests if the provided value is of type string, is in valid CIDR network notation, and has significant bits between min and max (inclusive)
func FloatBetween ¶ added in v0.12.0
func FloatBetween(min, max float64) schema.SchemaValidateFunc
FloatBetween returns a SchemaValidateFunc which tests if the provided value is of type float64 and is between min and max (inclusive).
func IPRange ¶ added in v0.11.6
func IPRange() schema.SchemaValidateFunc
IPRange returns a SchemaValidateFunc which tests if the provided value is of type string, and in valid IP range notation
func IntAtLeast ¶ added in v0.10.0
func IntAtLeast(min int) schema.SchemaValidateFunc
IntAtLeast returns a SchemaValidateFunc which tests if the provided value is of type int and is at least min (inclusive)
func IntAtMost ¶ added in v0.10.0
func IntAtMost(max int) schema.SchemaValidateFunc
IntAtMost returns a SchemaValidateFunc which tests if the provided value is of type int and is at most max (inclusive)
func IntBetween ¶
func IntBetween(min, max int) schema.SchemaValidateFunc
IntBetween returns a SchemaValidateFunc which tests if the provided value is of type int and is between min and max (inclusive)
func IntInSlice ¶ added in v0.11.12
func IntInSlice(valid []int) schema.SchemaValidateFunc
IntInSlice returns a SchemaValidateFunc which tests if the provided value is of type int and matches the value of an element in the valid slice
func NoZeroValues ¶ added in v0.10.7
NoZeroValues is a SchemaValidateFunc which tests if the provided value is not a zero value. It's useful in situations where you want to catch explicit zero values on things like required fields during validation.
func SingleIP ¶ added in v0.11.6
func SingleIP() schema.SchemaValidateFunc
SingleIP returns a SchemaValidateFunc which tests if the provided value is of type string, and in valid single IP notation
func StringInSlice ¶
func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc
StringInSlice returns a SchemaValidateFunc which tests if the provided value is of type string and matches the value of an element in the valid slice will test with in lower case if ignoreCase is true
func StringLenBetween ¶ added in v0.9.2
func StringLenBetween(min, max int) schema.SchemaValidateFunc
StringLenBetween returns a SchemaValidateFunc which tests if the provided value is of type string and has length between min and max (inclusive)
func StringMatch ¶ added in v0.11.2
func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc
StringMatch returns a SchemaValidateFunc which tests if the provided value matches a given regexp. Optionally an error message can be provided to return something friendlier than "must match some globby regexp".
func ValidateJsonString ¶ added in v0.9.3
ValidateJsonString is a SchemaValidateFunc which tests to make sure the supplied string is valid JSON.
func ValidateListUniqueStrings ¶ added in v0.10.3
ValidateListUniqueStrings is a ValidateFunc that ensures a list has no duplicate items in it. It's useful for when a list is needed over a set because order matters, yet the items still need to be unique.
func ValidateRFC3339TimeString ¶ added in v0.11.4
ValidateRFC3339TimeString is a ValidateFunc that ensures a string parses as time.RFC3339 format
func ValidateRegexp ¶ added in v0.10.3
ValidateRegexp returns a SchemaValidateFunc which tests to make sure the supplied string is a valid regular expression.
Types ¶
This section is empty.