vvalidator-一个轻量级的Go参数验证器,提供validator、is、has三类参数验证,满足各类验证需求。采用MIT开源协议。
下载安装go get github.com/syyongx/vvalidatorApisvalidatorValidateInt(data interface{}, key string, min, max int, def ... int) (int, error)ValidateIntp(data interface{}, key string, min, max int, code int, message string, def ... int) intValidateInt64(data interface{}, key string, min, max int64, def ... int64) (int64, error)ValidateInt64p(data interface{}, key string, min, max int64, code int, message string, def ... int64) int64ValidateFloat(data interface{}, key string, min, max float64, def ... float64) (float64, error)ValidateFloatp(data interface{}, key string, min, max float64, code int, message string, def ... float64) float64ValidateString(data interface{}, key string, min, max int, def ... string) (string, error)ValidateStringp(data interface{}, key string, min, max int, code int, message string, def ... string) stringValidateStringWithPattern(data interface{}, key, pattern string, def ... string) (string, error)ValidateStringWithPatternp(data interface{}, key, pattern string, code int, message string, def ... string) stringValidateEnumInt(data interface{}, key string, validValues []int, def ... int) (int, error)ValidateEnumIntp(data interface{}, key string, validValues []int, code int, message string, def ... int) intValidateEnumInt64(data interface{}, key string, validValues []int64, def ... int64) (int64, error)ValidateEnumInt64p(data interface{}, key string, validValues []int64, code int, message string, def ... int64) int64ValidateEnumString(data interface{}, key string, validValues []string, def ... string) (string, error)ValidateEnumStringp(data interface{}, key string, validValues []string, code int, message string, def ... string) stringValidateSlice(data interface{}, key, sep string, min, max int, def ... string) ([]string, error)ValidateSlicep(data interface{}, key, sep string, min, max int, code int, message string, def ... string) []stringisIsNumeric(str string) boolIsInt(str string) boolIsFloat(str string) boolIsHexadecimal(str string) boolIsAlpha(str string) boolIsAlphanumeric(str string) boolIsIP(str string) boolIsIPv4(str string) boolIsIPv6(str string) boolIsLatitude(str string) boolIsLongitude(str string) boolIsBase64(str string) boolIsPort(str string) boolIsURL(str string) boolIsASCII(str string) boolIsPrintableASCII(str string) boolIsEmail(str string) boolIsWinPath(str string) boolIsUnixPath(str string) boolIsSemver(str string) boolIsFullWidth(str string) boolIsHalfWidth(str string) boolIsHash(str, algorithm string) boolIsMAC(str string) boolIsTime(str string, format string) boolIsRFC3339Time(str string) boolIsRFC3339WithoutZoneTime(str string) boolIsJSON(str string) boolIsUTFLetter(str string) boolIsUTFLetterNumeric(str string) boolIsHexcolor(str string) boolIsRGBcolor(str string) boolIsRGBAcolor(str string) boolIsLowerCase(str string) boolIsUpperCase(str string) boolhasHasLowerCase(str string) boolHasUpperCase(str string) bool点击空白处退出提示
评论