Documentation ¶
Overview ¶
Package validators specifies that the variables, constants and functions to validate form data.
Index ¶
- Constants
- func Email(s string) bool
- func Empty(s string) bool
- func IntegerInRange(s string, min int, max int) (error, bool)
- func IsInteger(s string) bool
- func LengthInRange(s string, min int, max int) bool
- func MaxLength(s string, max int) bool
- func MinLength(s string, min int) bool
- func NotBlank(data interface{}) bool
- func Password(s string) bool
Constants ¶
const EmailPattern = "" /* 130-byte string literal not displayed */
EmailPattern stores a regular expression to validate the email address.
const NamePattern = "^[A-Za-z ]{5,}$"
NamePattern stores a regular expression to validate the name.
Variables ¶
This section is empty.
Functions ¶
func IntegerInRange ¶
IntegerInRange validates if s contains integral value, and its value lies between min and max values. This function returns error if s is non-integral.
func LengthInRange ¶
LengthInRange validates if the length s is between specified min and max value.
func MaxLength ¶
MaxLength validates if the length s is smaller than or equal to the specified max value.
func MinLength ¶
MinLength validates if the length of s is greater than or equal to the specified min value.
func NotBlank ¶
func NotBlank(data interface{}) bool
NotBlank is the validation function for validating if the current field has a value or length greater than zero, or is not a space only string.
Types ¶
This section is empty.