Documentation
¶
Index ¶
- Variables
- func GreaterThan(value int, lbound int) bool
- func InBounds(value int, lbound int, ubound int) bool
- func IsValidISBN10(isbn string) bool
- func IsValidISBN13(isbn string) bool
- func Matches(value string, regex *regexp.Regexp) bool
- func MaxChars(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
- func ValueMustBeGreaterThan(n int) string
- func ValueMustBeInRange(l int, u int) string
- func ValueMustBeLongerThan(n int) string
- func ValueMustNotBeLongerThan(n int) string
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var EmailRegex = 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])?)*$")
View Source
var InvalidISBN = "Fehlerhafte ISBN-Nummer"
View Source
var ValueInvalidEmail = "Das Format der eingegebenen Email wird nicht erkannt"
View Source
var ValueMustNotBeEmpty = "Dieses Feld darf nicht leer sein"
Functions ¶
func GreaterThan ¶
func IsValidISBN10 ¶
func IsValidISBN13 ¶
func PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
func ValueMustBeGreaterThan ¶
func ValueMustBeInRange ¶
func ValueMustBeLongerThan ¶
Types ¶
type Validator ¶
func (*Validator) AddFieldError ¶
func (*Validator) AddNonFieldError ¶
func (*Validator) CheckField ¶
Click to show internal directories.
Click to hide internal directories.