1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
1. BytesArePresent // 验证字段字节数是否为空, 属性: Name string, Field []byte, Message string
2. EmailsPresent // 根据正则表达是验证邮箱, 属性: Name string, Field string, Message string
3. EmailLike // 验证邮箱是否包括域名和@符, 属性: Name string, Field string, Message string
4. IntArrayIsPresent // 验证字段是否为空数组, 属性: Name strig, Field []int,Message string
5. IntIsGreaterThan // 验证字段是否大于比较值, 属性: Name string, Field int, Compared int,Message string
6. IntIsLessThan // 验证字段是否小于比较值, 属性: Name string, Field int, Compared int, Message string
7. IntIsPresent //验证字段是否等于0, 属性: Name string, Field int, Message string
8. IntsAreEqual //验证两个整数是否相等, 属性: Name string,ValueOne int,ValueTwo int,Message string
9. IntsAreNotEqual // 验证两个整数是否不相等, 属性: Name string ,ValueOne int ,ValueTwo int,Message string
10. RegexMatch //验证正则规则是否匹配字段, 属性: Name string, Field string,Expr string,Message string
11. StringInclusion //验证字段是否在字符切片内, 属性: Name string, Field string, List []string, Message string
12. StringIsPresent // 验证字符串是否为空, 属性: Name string, Field string,Message string
13. StringLengthInRange //验证字符串长度在某个范围内, 属性: Name string, Field strin ,Max int,Min int,Message string
14. StringsMatch //验证字段是否与字符串匹配, 属性: Name string, Field string,Field2 string Message string
15. TimeAfterTime //验证第一个时间是否在第二个时间后, 属性: FirstName string, FirstTime time.Time, SecondName string, SecondTime time.Time
,Message string
16. TimeIsBeforeTime //验证第一个时间是否在第二个时间之前, 属性: FirstName string,FirstTime time.Time,SecondName string ,SecondTime
time.Time ,Message string
17. TimeIsPresent //验证时间是否有效, 属性: Name string ,Field time.Time,Message string
18. URLIsPresent //验证URL格式是否正确,属性: Name string ,Field string,Message string
19. UUIDIsPresent //验证UUID是都有效, 属性: Name string ,Field uuid.UUID , Message string
20. FuncValiddator //验证是否为方法, 属性: Fn func() bool, Field string,Name string ,Message string
|