Documentation
¶
Index ¶
- Constants
- Variables
- type Bool
- type Bytes
- type Error
- type Errors
- type Float
- type Int
- type Map
- type Slice
- type Str
- func (str *Str) Date(layout string) *Str
- func (str *Str) Email() *Str
- func (str *Str) Equal(eq string) *Str
- func (str *Str) In(values ...string) *Str
- func (str *Str) Len(num int) *Str
- func (str *Str) NotEqual(eq string) *Str
- func (str *Str) Range(min, max int) *Str
- func (str *Str) RegExp(pattern string) *Str
- func (str *Str) Required() *Str
- func (str *Str) URL() *Str
- type Validator
- func (v *Validator) Bool(value bool, field string) *Bool
- func (v *Validator) Bytes(value []byte, field string) *Bytes
- func (v *Validator) Float(value float64, field string) *Float
- func (v *Validator) Int(value int, field string) *Int
- func (v *Validator) Map(value interface{}, field string) *Map
- func (v *Validator) Slice(value interface{}, field string) *Slice
- func (v *Validator) Str(value, field string) *Str
Constants ¶
View Source
const ( CodeRequired = "required" CodeNotMatched = "not_matched" CodeNotEqual = "not_equal" CodeEqual = "equal" CodeOutRange = "out_range" CodeIn = "in" CodeLen = "length" CodeDate = "not_date" CodeNotFound = "not_found" CodeExists = "exists" CodeUnsupported = "unsopported_type" CodeBadParameter = "bad_parameter" )
View Source
const ( PatternEmail = "" /* 135-byte string literal not displayed */ PatternURL = `` /* 301-byte string literal not displayed */ )
Variables ¶
View Source
var ( ErrRequired = errors.New("is required") ErrNotMatched = errors.New("not matched") ErrNotEqual = errors.New("is not equal to value passed") ErrEqual = errors.New("is equal to value passed") ErrOutRange = errors.New("is out of range") ErrIn = errors.New("is not in the values passed") ErrLen = errors.New("is more length than value passed") ErrDate = errors.New("is not a valid datetime") ErrNotFound = errors.New("not found the value") ErrExists = errors.New("the value exists") ErrUnsupported = errors.New("unsopported type") ErrBadParameter = errors.New("bad parameter") )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.