Documentation
¶
Overview ¶
Package validator 符合 web/validation 的验证方法
Index ¶
- func BankCard(val any) bool
- func CNMobile(val any) bool
- func CNPhone(val any) bool
- func CNTel(val any) bool
- func Email(val any) bool
- func GB11643(val any) bool
- func GB32100(val any) bool
- func HexColor(val any) bool
- func IP(val any) bool
- func IP4(val any) bool
- func IP6(val any) bool
- func ISBN(val any) bool
- func ISBN10(val any) bool
- func ISBN13(val any) bool
- func Luhn(val any) bool
- func URL(val any) bool
- type F
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CNPhone ¶
CNPhone 验证中国大陆的电话号码
支持如下格式:
0578-12345678-1234 057812345678-1234
若存在分机号,则分机号的连接符不能省略。
Types ¶
type F ¶
type F = validation.ValidateFunc
F 是 Validator 的函数形式
func In ¶
func In[T comparable](element ...T) F
In 声明枚举类型的验证规则
要求验证的值必须包含在 element 元素中,如果不存在,则返回 msg 的内容。
type Validator ¶
type Validator = validation.Validator
Click to show internal directories.
Click to hide internal directories.