-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.go
67 lines (61 loc) · 2.56 KB
/
tag.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package csv
// tag is struct tag name.
type tag string
const (
// validateTag is the struct tag name for validation rules.
validateTag tag = "validate"
)
// tagValue is the struct tag value.
type tagValue string
const (
// booleanTagValue is the struct tag value for boolean rule.
booleanTagValue tagValue = "boolean"
// alphaTagValue is the struct tag name for alpha only fields.
alphaTagValue tagValue = "alpha"
// numericTagValue is the struct tag name for numeric fields.
numericTagValue tagValue = "numeric"
// alphanumericTagValue is the struct tag name for alphanumeric fields.
alphanumericTagValue tagValue = "alphanumeric"
// requiredTagValue is the struct tag name for required fields.
requiredTagValue tagValue = "required"
// equalTagValue is the struct tag name for equal fields.
equalTagValue tagValue = "eq"
// notEqualTagValue is the struct tag name for not equal fields.
notEqualTagValue tagValue = "ne"
// greaterThanTagValue is the struct tag name for greater than fields.
greaterThanTagValue tagValue = "gt"
// greaterThanEqualTagValue is the struct tag name for greater than or equal fields.
greaterThanEqualTagValue tagValue = "gte"
// lessThanTagValue is the struct tag name for less than fields.
lessThanTagValue tagValue = "lt"
// lessThanEqualTagValue is the struct tag name for less than or equal fields.
lessThanEqualTagValue tagValue = "lte"
// minTagValue is the struct tag name for minimum fields.
minTagValue tagValue = "min"
// maxTagValue is the struct tag name for maximum fields.
maxTagValue tagValue = "max"
// lengthTagValue is the struct tag name for length fields.
lengthTagValue tagValue = "len"
// oneOfTagValue is the struct tag name for one of fields.
oneOfTagValue tagValue = "oneof"
// lowercaseTagValue is the struct tag name for lowercase fields.
lowercaseTagValue tagValue = "lowercase"
// uppercaseTagValue is the struct tag name for uppercase fields.
uppercaseTagValue tagValue = "uppercase"
// asciiTagValue is the struct tag name for ascii fields.
asciiTagValue tagValue = "ascii"
// emailTagValue is the struct tag name for email fields.
emailTagValue tagValue = "email"
// containsTagValue is the struct tag name for contains fields.
containsTagValue tagValue = "contains"
// containsAnyTagValue is the struct tag name for contains any fields.
containsAnyTagValue tagValue = "containsany"
)
// String returns the string representation of the tag.
func (t tag) String() string {
return string(t)
}
// String returns the string representation of the tag value.
func (t tagValue) String() string {
return string(t)
}