-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.go
More file actions
24 lines (21 loc) · 741 Bytes
/
map.go
File metadata and controls
24 lines (21 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package sentinal
import (
"reflect"
"github.com/asaskevich/govalidator"
)
var functions = map[string]func(reflect.Value, string) (bool, string, error){
"max": maxInclusive,
"min": minInclusive,
"maxExclusive": maxExclusive,
"minExclusive": minExclusive,
"from": from,
"notFrom": notFrom,
"notEmpty": notEmpty,
"maxLen": maxLength,
"minLen": minLength,
"contains": contains,
"notContains": notContains,
"isEmail": isEmail,
"hasUpperCase": simpleOverlay(govalidator.HasUpperCase, "Field does not have uppercase characters"),
"notHasUpperCase": simpleOverlayReverse(govalidator.HasUpperCase, "Field has uppercase characters"),
}