3 Star 0 Fork 0

Gitee 极速下载 / go-validator

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/syyongx/vvalidator
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

VValidator

GoDoc Go Report Card MIT licensed

Go parameter validator library.

Download & Install

go get github.com/syyongx/vvalidator

Apis

validator

ValidateInt(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) int
ValidateInt64(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) int64
ValidateFloat(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) float64
ValidateString(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) string
ValidateStringWithPattern(data interface{}, key, pattern string, def ... string) (string, error)
ValidateStringWithPatternp(data interface{}, key, pattern string, code int, message string, def ... string) string
ValidateEnumInt(data interface{}, key string, validValues []int, def ... int) (int, error)
ValidateEnumIntp(data interface{}, key string, validValues []int, code int, message string, def ... int) int
ValidateEnumInt64(data interface{}, key string, validValues []int64, def ... int64) (int64, error)
ValidateEnumInt64p(data interface{}, key string, validValues []int64, code int, message string, def ... int64) int64
ValidateEnumString(data interface{}, key string, validValues []string, def ... string) (string, error)
ValidateEnumStringp(data interface{}, key string, validValues []string, code int, message string, def ... string) string
ValidateSlice(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) []string

is

IsNumeric(str string) bool
IsInt(str string) bool
IsFloat(str string) bool
IsHexadecimal(str string) bool
IsAlpha(str string) bool
IsAlphanumeric(str string) bool
IsIP(str string) bool
IsIPv4(str string) bool
IsIPv6(str string) bool
IsLatitude(str string) bool
IsLongitude(str string) bool
IsBase64(str string) bool
IsPort(str string) bool
IsURL(str string) bool
IsASCII(str string) bool
IsPrintableASCII(str string) bool
IsEmail(str string) bool
IsWinPath(str string) bool
IsUnixPath(str string) bool
IsSemver(str string) bool
IsFullWidth(str string) bool
IsHalfWidth(str string) bool
IsHash(str, algorithm string) bool
IsMAC(str string) bool
IsTime(str string, format string) bool
IsRFC3339Time(str string) bool
IsRFC3339WithoutZoneTime(str string) bool
IsJSON(str string) bool
IsUTFLetter(str string) bool
IsUTFLetterNumeric(str string) bool
IsHexColor(str string) bool
IsRGBColor(str string) bool
IsRGBAColor(str string) bool
IsLowerCase(str string) bool
IsUpperCase(str string) bool

has

HasLowerCase(str string) bool
HasUpperCase(str string) bool

LICENSE

VValidator source code is licensed under the MIT Licence.

MIT License Copyright (c) 2018 syyong.x Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

vvalidator - 一个轻量级的 Go 参数验证器,提供 validator、is、has 三类参数验证,满足各类验证需求 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors/go-validator.git
git@gitee.com:mirrors/go-validator.git
mirrors
go-validator
go-validator
master

搜索帮助