Versions in this module Expand all Collapse all v0 v0.0.8 Mar 9, 2022 v0.0.7 Mar 8, 2022 v0.0.6 Mar 4, 2022 v0.0.5 Feb 13, 2022 v0.0.4 Feb 4, 2022 v0.0.3 Jan 28, 2022 Changes in this version + const LabelTag + const ValidTag + var CanSkipFuncs = map[string]struct + var ErrInt64On32 = fmt.Errorf("not support int64 on 32-bit platform") + var MessageTmpls = map[string]string + func AddCustomFunc(name string, f CustomFunc) error + func SetDefaultMessage(msg map[string]string) + type Alpha struct + Key string + func (a Alpha) DefaultMessage() string + func (a Alpha) GetKey() string + func (a Alpha) GetLimitValue() interface{} + func (a Alpha) IsSatisfied(obj interface{}) bool + type AlphaDash struct + Key string + func (a AlphaDash) DefaultMessage() string + func (a AlphaDash) GetKey() string + func (a AlphaDash) GetLimitValue() interface{} + type AlphaNumeric struct + Key string + func (a AlphaNumeric) DefaultMessage() string + func (a AlphaNumeric) GetKey() string + func (a AlphaNumeric) GetLimitValue() interface{} + func (a AlphaNumeric) IsSatisfied(obj interface{}) bool + type Base64 struct + Key string + func (b Base64) DefaultMessage() string + func (b Base64) GetKey() string + func (b Base64) GetLimitValue() interface{} + type CustomFunc func(v *Validation, obj interface{}, key string) + type Email struct + Key string + func (e Email) DefaultMessage() string + func (e Email) GetKey() string + func (e Email) GetLimitValue() interface{} + type Error struct + Field string + Key string + LimitValue interface{} + Message string + Name string + Tmpl string + Value interface{} + func (e *Error) Error() string + func (e *Error) String() string + type Funcs map[string]reflect.Value + func (f Funcs) Call(name string, params ...interface{}) (result []reflect.Value, err error) + type IP struct + Key string + func (i IP) DefaultMessage() string + func (i IP) GetKey() string + func (i IP) GetLimitValue() interface{} + type Length struct + Key string + N int + func (l Length) DefaultMessage() string + func (l Length) GetKey() string + func (l Length) GetLimitValue() interface{} + func (l Length) IsSatisfied(obj interface{}) bool + type Match struct + Key string + Regexp *regexp.Regexp + func (m Match) DefaultMessage() string + func (m Match) GetKey() string + func (m Match) GetLimitValue() interface{} + func (m Match) IsSatisfied(obj interface{}) bool + type Max struct + Key string + Max int + func (m Max) DefaultMessage() string + func (m Max) GetKey() string + func (m Max) GetLimitValue() interface{} + func (m Max) IsSatisfied(obj interface{}) bool + type MaxSize struct + Key string + Max int + func (m MaxSize) DefaultMessage() string + func (m MaxSize) GetKey() string + func (m MaxSize) GetLimitValue() interface{} + func (m MaxSize) IsSatisfied(obj interface{}) bool + type Min struct + Key string + Min int + func (m Min) DefaultMessage() string + func (m Min) GetKey() string + func (m Min) GetLimitValue() interface{} + func (m Min) IsSatisfied(obj interface{}) bool + type MinSize struct + Key string + Min int + func (m MinSize) DefaultMessage() string + func (m MinSize) GetKey() string + func (m MinSize) GetLimitValue() interface{} + func (m MinSize) IsSatisfied(obj interface{}) bool + type Mobile struct + Key string + func (m Mobile) DefaultMessage() string + func (m Mobile) GetKey() string + func (m Mobile) GetLimitValue() interface{} + type NoMatch struct + Key string + func (n NoMatch) DefaultMessage() string + func (n NoMatch) GetKey() string + func (n NoMatch) GetLimitValue() interface{} + func (n NoMatch) IsSatisfied(obj interface{}) bool + type Numeric struct + Key string + func (n Numeric) DefaultMessage() string + func (n Numeric) GetKey() string + func (n Numeric) GetLimitValue() interface{} + func (n Numeric) IsSatisfied(obj interface{}) bool + type Phone struct + Key string + func (p Phone) DefaultMessage() string + func (p Phone) GetKey() string + func (p Phone) GetLimitValue() interface{} + func (p Phone) IsSatisfied(obj interface{}) bool + type Range struct + Key string + func (r Range) DefaultMessage() string + func (r Range) GetKey() string + func (r Range) GetLimitValue() interface{} + func (r Range) IsSatisfied(obj interface{}) bool + type Required struct + Key string + func (r Required) DefaultMessage() string + func (r Required) GetKey() string + func (r Required) GetLimitValue() interface{} + func (r Required) IsSatisfied(obj interface{}) bool + type Result struct + Error *Error + Ok bool + func (r *Result) Key(key string) *Result + func (r *Result) Message(message string, args ...interface{}) *Result + type Tel struct + Key string + func (t Tel) DefaultMessage() string + func (t Tel) GetKey() string + func (t Tel) GetLimitValue() interface{} + type ValidFormer interface + Valid func(*Validation) + type ValidFunc struct + Name string + Params []interface{} + type Validation struct + Errors []*Error + ErrorsMap map[string][]*Error + RequiredFirst bool + func (v *Validation) AddError(key, message string) + func (v *Validation) Alpha(obj interface{}, key string) *Result + func (v *Validation) AlphaDash(obj interface{}, key string) *Result + func (v *Validation) AlphaNumeric(obj interface{}, key string) *Result + func (v *Validation) Base64(obj interface{}, key string) *Result + func (v *Validation) CanSkipAlso(skipFunc string) + func (v *Validation) Check(obj interface{}, checks ...Validator) *Result + func (v *Validation) Clear() + func (v *Validation) Email(obj interface{}, key string) *Result + func (v *Validation) Error(message string, args ...interface{}) *Result + func (v *Validation) ErrorMap() map[string][]*Error + func (v *Validation) HasErrors() bool + func (v *Validation) IP(obj interface{}, key string) *Result + func (v *Validation) Length(obj interface{}, n int, key string) *Result + func (v *Validation) Match(obj interface{}, regex *regexp.Regexp, key string) *Result + func (v *Validation) Max(obj interface{}, max int, key string) *Result + func (v *Validation) MaxSize(obj interface{}, max int, key string) *Result + func (v *Validation) Min(obj interface{}, min int, key string) *Result + func (v *Validation) MinSize(obj interface{}, min int, key string) *Result + func (v *Validation) Mobile(obj interface{}, key string) *Result + func (v *Validation) NoMatch(obj interface{}, regex *regexp.Regexp, key string) *Result + func (v *Validation) Numeric(obj interface{}, key string) *Result + func (v *Validation) Phone(obj interface{}, key string) *Result + func (v *Validation) Range(obj interface{}, min, max int, key string) *Result + func (v *Validation) RecursiveValid(objc interface{}) (bool, error) + func (v *Validation) Required(obj interface{}, key string) *Result + func (v *Validation) SetError(fieldName string, errMsg string) *Error + func (v *Validation) Tel(obj interface{}, key string) *Result + func (v *Validation) Valid(obj interface{}) (b bool, err error) + func (v *Validation) ZipCode(obj interface{}, key string) *Result + type Validator interface + DefaultMessage func() string + GetKey func() string + GetLimitValue func() interface{} + IsSatisfied func(interface{}) bool + type ZipCode struct + Key string + func (z ZipCode) DefaultMessage() string + func (z ZipCode) GetKey() string + func (z ZipCode) GetLimitValue() interface{}