Documentation ¶
Index ¶
- func AddRule(name string, inputFunc InputFunc, kinds Kinds)
- func InputInt(kind reflect.Kind, value string) interface{}
- func InputRegexp(kind reflect.Kind, value string) interface{}
- func InputSame(kind reflect.Kind, value string) interface{}
- type Field
- type Fields
- type InputFunc
- type Kinds
- type ValidateValuer
- type ValidationError
- type ValidationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputRegexp ¶
InputRegexp always returns a compiled regular expression
Types ¶
type Field ¶
type Field struct { Index *int Field *reflect.StructField }
Field is always an array/slice index or struct field
type InputFunc ¶
InputFunc is a function that converts the parameter of a validation rule to the desired type
type Kinds ¶
type Kinds map[reflect.Kind]ValidationFunc
Kinds is a map with validation funcs for each reflect.Kind
type ValidateValuer ¶ added in v0.2.0
type ValidateValuer interface {
ValidateValue() interface{}
}
type ValidationError ¶
ValidationError contains information about a failed validation
func (ValidationError) String ¶
func (e ValidationError) String() string
type ValidationFunc ¶
ValidationFunc is a function to validate a field
Click to show internal directories.
Click to hide internal directories.