Documentation ¶
Overview ¶
Package validate contains methods for validating inputs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesNotMatchReErr ¶
DoesNotMatchReErr returns an error indicating that a value does not match a regex.
func MatchReWithLength ¶
MatchReWithLength validates a value matches the given re and its length is within the specific range [minLen, maxLen].
For convenience, if minLen > 0 and value == "", returns "unspecified" as the error message (instead of referring to length limit in the error message).
func RegexpFragment ¶
RegexpFragment returns a non-nil error if re is not a valid regular expression fragment that can be embedded in a regex template.
func SpecifiedWithRe ¶
SpecifiedWithRe validates a value is non-empty and matches the given re.
func Unspecified ¶
func Unspecified() error
Unspecified returns an error indicating that a value is unspecified.
Types ¶
This section is empty.