Documentation ¶
Index ¶
Constants ¶
View Source
const ( EInvalidEmail = "invalid_email" EUnallowedEmail = "unallowed_email" )
Variables ¶
This section is empty.
Functions ¶
func ValidateEmail ¶
func ValidateEmail(email string, config EmailValidationConfig) error
func ValidateRegex ¶
func ValidateString ¶
func ValidateString(str string, config StringValidationConfig) error
Types ¶
type EmailValidationConfig ¶
type StringValidationConfig ¶
type StringValidationConfig struct { MinLength int `json:"minLength" mapstructure:"min_length"` MaxLength int `json:"maxLength" mapstructure:"max_length"` MinDigits int `json:"minDigits" mapstructure:"min_digits"` MinUppers int `json:"minUppers" mapstructure:"min_uppers"` MinLowers int `json:"minLowers" mapstructure:"min_lowers"` MinSpecials int `json:"minSpecials" mapstructure:"min_specials"` WhitespaceAllowed bool `json:"whitespaceAllowed" mapstructure:"whitespace_allowed"` AllowedSpecialChars string `json:"allowedSpecialChars" mapstructure:"allowed_special_chars"` }
Click to show internal directories.
Click to hide internal directories.