Documentation ¶
Index ¶
- Variables
- func IsURL(value string) bool
- func Matches(value string, rx *regexp.Regexp) bool
- func MaxBytes(value string, n int) bool
- func MaxChars(value string, n int) bool
- func MinBytes(value string, n int) bool
- func MinChars(value string, n int) bool
- func NotBlank(value string) bool
- func PermittedValue[T comparable](value T, permittedValues ...T) bool
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocationRX = regexp.MustCompile(`^([A-Za-z\s.'-]+, )+[A-Za-z\s.'-]+$`) 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 PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
Types ¶
type Validator ¶
func (*Validator) AddFieldError ¶
func (*Validator) AddNonFieldError ¶
func (*Validator) CheckField ¶
Click to show internal directories.
Click to hide internal directories.