Versions in this module Expand all Collapse all v0 v0.2.0 Sep 16, 2022 Changes in this version + var ErrSlug = errors.New("this value should be a valid slug") + type Slug struct + func (Slug) Name() string + func (Slug) Validate(s string) error v0.1.0 Sep 15, 2022 Changes in this version + var ErrAlpha = errors.New("this value should be alpha") + var ErrAlphanum = errors.New("this value should be alphanumeric") + var ErrBlank = errors.New("this value should be blank") + var ErrDateTime = errors.New("this value is not a valid datetime") + var ErrDateTimeZone = errors.New("this value is not a valid timezone") + var ErrEmail = errors.New("this value is not a valid email address") + var ErrIP = errors.New("this value is not a valid IP") + var ErrIPv4 = errors.New("this value is not a valid IPv4") + var ErrIPv6 = errors.New("this value is not a valid IPv6") + var ErrJSON = errors.New("this value should be valid JSON") + var ErrLowerCase = errors.New("this value should be lowercase") + var ErrMatch = errors.New("this value is not valid") + var ErrNotBlank = errors.New("this value should not be blank") + var ErrNumeric = errors.New("this value should be numeric") + var ErrRegex = errors.New("this value is not valid") + var ErrRequestURI = errors.New("this value is not a valid URI") + var ErrRequestURL = errors.New("this value is not a valid URL") + var ErrUUID = errors.New("this value is not a valid UUID") + var ErrUpperCase = errors.New("this value should be uppercase") + var ErrUsername = errors.New("this value is not a valid username") + func HasLetter(r rune, s string) bool + func IsAlpha(s string) bool + func IsLetterAlpha(r rune) bool + func IsLetterNumeric(r rune) bool + func IsNumeric(s string) bool + type Alpha struct + func (Alpha) Name() string + func (Alpha) Validate(s string) error + type Alphanum struct + func (Alphanum) Name() string + func (Alphanum) Validate(s string) error + type Blank struct + func (Blank) Name() string + func (Blank) Validate(s string) error + type DateTime struct + Format string + Layout string + Timezone string + func (DateTime) Name() string + func (v *DateTime) Validate(s string) error + type Email struct + Address string + func (Email) Name() string + func (v *Email) Validate(s string) error + type Error struct + Constraint string + Message string + Params any + Value any + func (e Error) Error() string + type ErrorHandler interface + Errors func() map[string][]error + IsValid func() bool + type GroupHandler interface + func Group(name string, value T, validators ...Handler[T]) GroupHandler + type Handler interface + type IP struct + func (IP) Name() string + func (IP) Validate(s string) error + type IPv4 struct + func (IPv4) Name() string + func (IPv4) Validate(s string) error + type IPv6 struct + func (IPv6) Name() string + func (IPv6) Validate(s string) error + type Identifier interface + Name func() string + type JSON struct + func (JSON) Name() string + func (JSON) Validate(s string) error + type Length struct + Length int + Max int + Min int + func (Length) Name() string + func (v *Length) Validate(s string) error + type Logger interface + Add func(GroupHandler) + Get func(name string) GroupHandler + Remove func(name string) + func NewLogger() Logger + type LowerCase struct + func (LowerCase) Name() string + func (LowerCase) Validate(s string) error + type Match struct + Pattern string + func (Match) Name() string + func (v Match) Validate(s string) error + type MaxLength struct + Length int + Max int + func (MaxLength) Name() string + func (v *MaxLength) Validate(s string) error + type MinLength struct + Length int + Min int + func (MinLength) Name() string + func (v *MinLength) Validate(s string) error + type NotBlank struct + func (NotBlank) Name() string + func (NotBlank) Validate(s string) error + type Numeric struct + func (Numeric) Name() string + func (Numeric) Validate(s string) error + type Regex struct + Pattern string + Re *regexp.Regexp + func (Regex) Name() string + func (v *Regex) Validate(s string) error + type RequestURI struct + func (RequestURI) Name() string + func (RequestURI) Validate(s string) error + type RequestURL struct + func (RequestURL) Name() string + func (RequestURL) Validate(s string) error + type UUID struct + Version uint8 + func (UUID) Name() string + func (v UUID) Validate(s string) error + type UpperCase struct + func (UpperCase) Name() string + func (UpperCase) Validate(s string) error + type Username struct + ExtraChars string + Format string + func (Username) Name() string + func (v Username) Validate(s string) error + type Validator interface + Validate func(T) error