Documentation ¶
Index ¶
- Variables
- type Constraint
- func Email() Constraint
- func Equal(value interface{}) Constraint
- func HasLowerCase() Constraint
- func HasNumber() Constraint
- func HasSpecial() Constraint
- func HasUpperCase() Constraint
- func MaxLength(n int) Constraint
- func MinLength(n int) Constraint
- func MinMaxLength(min, max int) Constraint
- func Nil() Constraint
- func NotNil() Constraint
- func Range(min interface{}, max interface{}) Constraint
- func Regexp(s string) Constraint
- func Slug() Constraint
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotEqual = errors.New("values are not equal") ErrNotNil = errors.New("value is not nil") ErrNil = errors.New("value is nil") )
View Source
var ( ErrInvalidTextPattern = errors.New("invalid text pattern") ErrTextTooLong = errors.New("text is too long") ErrTextTooShort = errors.New("text is too short") ErrTextMissingUpper = errors.New("missing uppercase character") ErrTextMissingLower = errors.New("missing lowercase character") ErrTextMissingSpecial = errors.New("missing special character") ErrTextMissingNumber = errors.New("missing number") ErrInvalidEmail = errors.New("invalid email") ErrTextInvalidSlug = errors.New("invalid slug") )
View Source
var (
ErrIncompatibleTypes = errors.New("incompatible types")
)
View Source
var (
ErrNumberOutOfRange = errors.New("number is out of range")
)
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Constraint func(value interface{}) error
func Email ¶
func Email() Constraint
func Equal ¶
func Equal(value interface{}) Constraint
func HasLowerCase ¶
func HasLowerCase() Constraint
func HasNumber ¶
func HasNumber() Constraint
func HasSpecial ¶
func HasSpecial() Constraint
func HasUpperCase ¶
func HasUpperCase() Constraint
func MaxLength ¶
func MaxLength(n int) Constraint
func MinLength ¶
func MinLength(n int) Constraint
func MinMaxLength ¶
func MinMaxLength(min, max int) Constraint
func Nil ¶
func Nil() Constraint
func NotNil ¶
func NotNil() Constraint
func Range ¶
func Range(min interface{}, max interface{}) Constraint
func Regexp ¶
func Regexp(s string) Constraint
func Slug ¶
func Slug() Constraint
Click to show internal directories.
Click to hide internal directories.