Versions in this module Expand all Collapse all v1 v1.0.0 Jul 28, 2018 Changes in this version + const ASCII + const Alpha + const Alphanumeric + const Base64 + const CreditCard + const DNSName + const DataURI + const Email + const Float + const FullWidth + const FuncSeparator + const HalfWidth + const Hexadecimal + const Hexcolor + const Hostname + const IP + const Int + const MongoDBObjectID + const Multibyte + const Numeric + const PrintableASCII + const RGBcolor + const RequiredKey + const URL + const URLIP + const URLPath + const URLPort + const URLSchema + const URLSubdomain + const URLUsername + const ValidIgnor + const ValidTag + var ErrBadEmailFormat = errors.New("email format is not valid") + var ErrBadMondogObjectIDFormat = errors.New("mongodb object id format is not valid") + var ErrBadNameFormat = errors.New("name len should between [2-500]") + var ErrBadURLFormat = errors.New("url format is not valid") + var ErrRequired = errors.New("field can't be empty or zero") + var ErrValidater = errors.New("validater should not be nil") + var ErrValidaterExists = errors.New("validater exist") + var ErrValidaterNoFound = errors.New("validater not found") + func AddValidater(name string, validater ValidaterFunc) error + func EnableDebug(flag bool) + func NewErrWrongType(expect string, value interface{}) error + func ValidateStruct(v interface{}) (bool, error) + type CustomValidators struct + func (cvm *CustomValidators) AddValidater(name string, validater ValidaterFunc) error + type ErrOnlyStrcut struct + Type reflect.Type + func (err *ErrOnlyStrcut) Error() string + type ErrUnsupportedType struct + Type reflect.Type + func (err *ErrUnsupportedType) Error() string + type ErrWrongExpectType struct + ExpectType string + PassValue interface{} + func (err *ErrWrongExpectType) Error() string + type Error struct + Err error + FieldName string + Value interface{} + func (err *Error) String() string + type Validater interface + Validater func() error + type ValidaterFunc func(v interface{}) error + type Validation struct + Errors []*Error + func NewValidation() *Validation + func (mv *Validation) ErrMsg() string + func (mv *Validation) Errs() []*Error + func (mv *Validation) HasError() bool + func (mv *Validation) Reset() + func (mv *Validation) Validate(obj interface{}) bool