Documentation ¶
Index ¶
- func FindTranslator(locales ...string) (trans ut.Translator)
- func RegisterTranslation(tag string, registerFn validator.RegisterTranslationsFunc, ...) error
- func RegisterValidation(tag string, fn validator.Func, callValidationEvenIfNull ...bool) error
- func Struct(i interface{}) error
- func ValidateChinaMobilePhoneNum(fl validator.FieldLevel) bool
- func ValidateDBType(field reflect.Value) (val interface{})
- func ValidateIdCard(fl validator.FieldLevel) bool
- func ValidateUniq(fl validator.FieldLevel) bool
- type TsValidator
- func (v *TsValidator) Engine() interface{}
- func (v *TsValidator) RegisterTranslation(tag string, registerFn validator.RegisterTranslationsFunc, ...) error
- func (v *TsValidator) RegisterValidation(tag string, fn validator.Func, callValidationEvenIfNull ...bool) error
- func (v *TsValidator) Struct(obj interface{}) error
- func (v *TsValidator) Validate(i interface{}) error
- func (v *TsValidator) Var(field interface{}, tag string) error
- func (v *TsValidator) VarWithValue(field interface{}, other interface{}, tag string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindTranslator ¶
func FindTranslator(locales ...string) (trans ut.Translator)
func RegisterTranslation ¶
func RegisterValidation ¶
func ValidateChinaMobilePhoneNum ¶
func ValidateChinaMobilePhoneNum(fl validator.FieldLevel) bool
func ValidateDBType ¶
ValidateDBType 验证数据库类型
func ValidateIdCard ¶
func ValidateIdCard(fl validator.FieldLevel) bool
func ValidateUniq ¶
func ValidateUniq(fl validator.FieldLevel) bool
Types ¶
type TsValidator ¶
type TsValidator struct {
// contains filtered or unexported fields
}
func Validate ¶
func Validate() *TsValidator
func (*TsValidator) Engine ¶
func (v *TsValidator) Engine() interface{}
func (*TsValidator) RegisterTranslation ¶
func (v *TsValidator) RegisterTranslation(tag string, registerFn validator.RegisterTranslationsFunc, translationFn validator.TranslationFunc, locales ...string) error
func (*TsValidator) RegisterValidation ¶
func (v *TsValidator) RegisterValidation(tag string, fn validator.Func, callValidationEvenIfNull ...bool) error
func (*TsValidator) Struct ¶
func (v *TsValidator) Struct(obj interface{}) error
func (*TsValidator) Validate ¶
func (v *TsValidator) Validate(i interface{}) error
Validate For echo
func (*TsValidator) Var ¶
func (v *TsValidator) Var(field interface{}, tag string) error
func (*TsValidator) VarWithValue ¶
func (v *TsValidator) VarWithValue(field interface{}, other interface{}, tag string) error
Click to show internal directories.
Click to hide internal directories.