Documentation
¶
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])?)*$")
Functions ¶
func Matches ¶
Matches() returns ture if a value mathces a provided comiled regular expression pattern.
func PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
PermittedInt() returns true if a value is in a list of permitted integers.
Types ¶
type Validator ¶
Validator type contains a map of validation errors
func (*Validator) AddFieldError ¶
AddFieldError() adds an error message to the FieldErrors map.
func (*Validator) AddNonFieldErrors ¶
AddNonFieldErrors helper adds an error messages to the NonFieldErrors slice.
Click to show internal directories.
Click to hide internal directories.