Documentation
¶
Index ¶
Constants ¶
View Source
const CUSTOM_RULE = "CUSTOM_RULE:"
View Source
const EQ = "EQ"
View Source
const GE = "GE"
View Source
const GT = "GT"
View Source
const LE = "LE"
View Source
const LT = "LT"
View Source
const NE = "NE"
View Source
const NOT_EMPTY = "notEmpty"
View Source
const REGEXP = "regexp"
Variables ¶
View Source
var ErrIsEmpty = errors.New("is empty")
View Source
var ErrLenNotValid = errors.New("len is not valid")
View Source
var ErrRegexp = errors.New("regexp fail")
Functions ¶
func RegexpMatch ¶
Types ¶
type Comparable ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func (*Validator) AddCustomRule ¶
func (a *Validator) AddCustomRule(customRule map[string]func(st interface{}, targetField reflect.Value, rule string) (err error)) Validator
customRule key format must be <NAME>=<VALUE> e.x: IS_FLOAT_FORCE_DECIMAL=2
func (*Validator) RemoveCustomRule ¶
Click to show internal directories.
Click to hide internal directories.