# Functions
Alpha 全部都是英文字符.
And 以与的形式串联多个验证器函数.
ASCII ASCII 码.
BankCard 是否为正确的银行卡号.
Between 判断数值区间 (min, max).
BetweenEqual 判断数值区间 [min, max].
CNMobile 验证中国大陆的手机号码.
CNPhone 验证中国大陆的电话号码
支持如下格式:
0578-12345678-1234 057812345678-1234
若存在分机号,则分机号的连接符不能省略。.
CNTel 验证手机和电话类型.
Digit 判断字符串是否都为数字.
No description provided by the author
Empty 字符串是否为空.
No description provided by the author
Equal 生成判断值是否等于 v 的验证器.
FileExists path 是否存在.
FileExistsFS 判断文件是否存在于 fsys.
GB11643 判断一个身份证是否符合 gb11643 标准
若是 15 位则当作一代身份证,仅简单地判断各位是否都是数字; 若是 18 位则当作二代身份证,会计算校验位是否正确;.
GB32100 统一信用代码校验.
No description provided by the author
No description provided by the author
Hex 是否符合 16 进制数字.
HexColor 判断一个字符串是否为合法的 16 进制颜色表示法.
HTTPStatus 是否为有效的 HTTP 状态码.
In 声明枚举类型的验证规则
要求验证的值必须包含在 element 元素中,如果不存在,则返回 msg 的内容。.
IP 判断是否 IP 地址
同时支持 [IP4] 和 [IP6].
No description provided by the author
No description provided by the author
ISBN 判断是否为合法的 [ISBN] 串号
可以同时判断 [ISBN10] 和 [ISBN13]
[ISBN]: https://zh.wikipedia.org/wiki/%E5%9B%BD%E9%99%85%E6%A0%87%E5%87%86%E4%B9%A6%E5%8F%B7.
No description provided by the author
No description provided by the author
IsDir path 是否为一个目录.
IsDirFS 判断 fsys 中的 path 是否为目录.
JSON 验证是否为正确的 JSON 内容.
LanguageTag 是否能解析为 [language.Tag] 变量.
No description provided by the author
No description provided by the author
Luhn 验证 [luhn] 算法
[luhn]: https://en.wikipedia.org/wiki/Luhn_algorithm.
Match 为正则生成验证函数.
MV 同 [filter.MV].
Nil 是否为 nil.
Not 验证器的取反.
NotIn 声明不在枚举中的验证规则.
Or 以或的形式并联多个验证器函数.
Regexp 是否为一个正确的正则表达式.
Semver [semver] 版本号验证
[semver]: https://semver.org/lang/zh-CN/.
SemverCompatible 创建一个验证 [semver] 是否兼容 val 的验证器.
SemverGreat 判断版本号是否大于 ver.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Strength 声明密码强度的验证对象
length 对长度的最小要求; upper 对大写字符的最小要求; lower 对小写字符的最小要求; punct 对符号的最小要求;.
SV 同 [filter.SV].
Timezone 是否为一个正确的时区变量.
No description provided by the author
UUID 验证 UUID 格式是否正确.
V 同 [filter.V].
Zero 是否为零值
采用 [reflect.Value.IsZero] 判断。.
ZeroOr 判断值为零值或是非零情况下符合 v 的要求.