Documentation ¶
Index ¶
- Variables
- func ErrorFromMap(errMap map[string]error) error
- func Struct(str interface{}) (bool, map[string]error)
- type ValFunc
- func Each(valFuncs ...ValFunc) ValFunc
- func Gt(v interface{}) ValFunc
- func Gte(v interface{}) ValFunc
- func HasKey(k interface{}) ValFunc
- func In(list []interface{}) ValFunc
- func Len(l int) ValFunc
- func Lt(v interface{}) ValFunc
- func Lte(v interface{}) ValFunc
- func Matches(regex string) ValFunc
- func MaxLen(l int) ValFunc
- func MinLen(l int) ValFunc
- func NotIn(list []interface{}) ValFunc
- func Panic(valFuncs ...ValFunc) ValFunc
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var Alpha = Matches(regexAlpha)
View Source
var AlphaNum = combineValFuncs(Matches("[a-zA-Z]+"), Matches("[0-9]+"))
View Source
var Email = Matches(regexEmail)
View Source
var HexColor = Matches(regexHexColor)
View Source
var Ip = Matches(regexIp)
View Source
var Lat = combineValFuncs(
numericalMatch("<=", 90.0),
numericalMatch(">=", -90.0))
View Source
var Lon = combineValFuncs(
numericalMatch("<=", 180.0),
numericalMatch(">=", -180.0))
View Source
var Nonzero = func(k string, v interface{}) error { m := &matchers.BeZeroMatcher{} zero, _ := m.Match(v) if zero { return formatError(k) } return nil }
View Source
var Num = Matches(regexNum)
View Source
var Url = Matches(regexUrl)
Functions ¶
func ErrorFromMap ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.