Documentation ¶
Index ¶
- Variables
- func AllIn[T comparable](values []T, safelist ...T) bool
- func Between[T constraints.Ordered](value, min, max T) bool
- func Email(value string) bool
- func In[T comparable](value T, safelist ...T) bool
- func Length(value string, min, max int) bool
- func Matches(value string, rx *regexp.Regexp) bool
- func MaxRunes(value string, n int) bool
- func MinRunes(value string, n int) bool
- func NoDuplicates[T comparable](values []T) bool
- func NotBlank(value string) bool
- func NotIn[T comparable](value T, blocklist ...T) bool
- func URL(value string) bool
- func Validate(fns ...ValidateFunc) error
- type ValidateFunc
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var RgxEmail = 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 AllIn ¶
func AllIn[T comparable](values []T, safelist ...T) bool
func Between ¶
func Between[T constraints.Ordered](value, min, max T) bool
func In ¶
func In[T comparable](value T, safelist ...T) bool
func NoDuplicates ¶
func NoDuplicates[T comparable](values []T) bool
func NotIn ¶
func NotIn[T comparable](value T, blocklist ...T) bool
func Validate ¶
func Validate(fns ...ValidateFunc) error
Types ¶
type ValidateFunc ¶
type ValidateFunc func(v *Validator)
Click to show internal directories.
Click to hide internal directories.