Documentation ¶
Index ¶
- Variables
- 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
- type Alphanum
- type Blank
- type DateTime
- type Email
- type Error
- type ErrorHandler
- type GroupHandler
- type Handler
- type IP
- type IPv4
- type IPv6
- type Identifier
- type JSON
- type Length
- type Logger
- type LowerCase
- type Match
- type MaxLength
- type MinLength
- type NotBlank
- type Numeric
- type Regex
- type RequestURI
- type RequestURL
- type Slug
- type UUID
- type UpperCase
- type Username
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDateTime = errors.New("this value is not a valid datetime") ErrDateTimeZone = errors.New("this value is not a valid timezone") )
View Source
var ( ErrIP = errors.New("this value is not a valid IP") ErrIPv4 = errors.New("this value is not a valid IPv4") ErrIPv6 = errors.New("this value is not a valid IPv6") )
View Source
var ( ErrMatch = errors.New("this value is not valid") ErrRegex = errors.New("this value is not valid") )
View Source
var ( ErrAlpha = errors.New("this value should be alpha") ErrAlphanum = errors.New("this value should be alphanumeric") ErrBlank = errors.New("this value should be blank") ErrEmail = errors.New("this value is not a valid email address") ErrJSON = errors.New("this value should be valid JSON") ErrLowerCase = errors.New("this value should be lowercase") ErrNotBlank = errors.New("this value should not be blank") ErrNumeric = errors.New("this value should be numeric") ErrRequestURI = errors.New("this value is not a valid URI") ErrRequestURL = errors.New("this value is not a valid URL") ErrSlug = errors.New("this value should be a valid slug") ErrUpperCase = errors.New("this value should be uppercase") ErrUsername = errors.New("this value is not a valid username") ErrUUID = errors.New("this value is not a valid UUID") )
Functions ¶
func IsLetterAlpha ¶
func IsLetterNumeric ¶
Types ¶
type DateTime ¶
type Error ¶
type ErrorHandler ¶
type GroupHandler ¶
type GroupHandler interface { Identifier ErrorHandler }
type Handler ¶
type Handler[T any] interface { Identifier Validator[T] }
type Identifier ¶
type Identifier interface {
Name() string
}
type Length ¶
type Logger ¶
type Logger interface { Add(GroupHandler) Get(name string) GroupHandler Remove(name string) ErrorHandler }
type Regex ¶
type RequestURI ¶
type RequestURI struct{}
func (RequestURI) Name ¶
func (RequestURI) Name() string
func (RequestURI) Validate ¶
func (RequestURI) Validate(s string) error
type RequestURL ¶
type RequestURL struct{}
func (RequestURL) Name ¶
func (RequestURL) Name() string
func (RequestURL) Validate ¶
func (RequestURL) Validate(s string) error
type Username ¶
type Username struct { Format string `json:"format" xml:"format"` ExtraChars string `json:"-" xml:"-"` }
The validation format used matches the following regular expression :
Format: /^[a-zA-Z][a-zA-Z0-9]*$/
To limit the length, it is recommended to use the Length, MinLength or MaxLength validator.
Click to show internal directories.
Click to hide internal directories.