Documentation ¶
Index ¶
- Constants
- Variables
- func XValidParseToString(fl validator.FieldLevel) (string, error)
- func XValid_Register_Regex(fl validator.FieldLevel, verificationStr string) (bool, string)
- func XValid_Register_Regex_Reverse(fl validator.FieldLevel, verificationStr string) (bool, string)
- func XValidator(u interface{}, showFirstError bool) (error, *[]xresponse.ParamError)
- func XValidatorInit() error
Constants ¶
View Source
const ( // 正则 UserNameRegexp = `^[a-zA-Z][a-zA-Z0-9_-]{3,15}$` PasswordRegexp = `^[a-fA-F0-9]{32,64}$` EmailRegexp = `^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$` //PhoneRegexp = `^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$` MobileRegexp = `^(1)\d{10}$` PhoneRegexp = "" /* 156-byte string literal not displayed */ )
Variables ¶
View Source
var (
Validator *validator.Validate
)
Functions ¶
func XValidParseToString ¶ added in v1.1.0
解析为字符串
func XValid_Register_Regex ¶ added in v1.0.9
正则验证器匹配验证
func XValid_Register_Regex_Reverse ¶ added in v1.0.9
正则验证器不匹配验证
func XValidator ¶
func XValidator(u interface{}, showFirstError bool) (error, *[]xresponse.ParamError)
* 通过xvalid_error注入需要自定义显示的错误信息
func XValidatorInit ¶
func XValidatorInit() error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.