Documentation
¶
Overview ¶
Package validator collects per-field form validation errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
IsEmail returns true if the value is a valid email address this is the recommended Regular Expression for valid emails
Functions ¶
func IsValidEmail ¶
Types ¶
type Validator ¶
Validator type is just a map
func NewValidator ¶
func NewValidator() *Validator
We create a new Validator using a factory function We have used factory functions before
func (*Validator) AddError ¶
Add an error entry to the error map. the field and the failed validation message to be sent to the client
Click to show internal directories.
Click to hide internal directories.