Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFieldRequired = errors.New("field required")
ErrFieldRequired reports that field is required, but not found.
Functions ¶
This section is empty.
Types ¶
type Array ¶
Array validates array length.
func (*Array) SetMaxLength ¶
SetMaxLength sets MaxLength validation.
func (*Array) SetMinLength ¶
SetMinLength sets MinLength validation.
func (Array) ValidateLength ¶
ValidateLength returns error if array length v is invalid.
type FieldError ¶
FieldError is failed validation on field.
type Int ¶
type Int struct {
MultipleOf int
MultipleOfSet bool
Min int64
MinSet bool
MinExclusive bool
Max int64
MaxSet bool
MaxExclusive bool
}
Int validates integers.
func (*Int) SetExclusiveMaximum ¶
SetExclusiveMaximum sets exclusive maximum value.
func (*Int) SetExclusiveMinimum ¶
SetExclusiveMinimum sets exclusive minimum value.
func (*Int) SetMultipleOf ¶
SetMultipleOf sets multipleOf validator.
type String ¶
type String struct {
MinLength int
MinLengthSet bool
MaxLength int
MaxLengthSet bool
Email bool
Regex *regexp.Regexp
Hostname bool
}
String validator.
func (*String) SetMaxLength ¶
SetMaxLength sets maximum string length (in Unicode code points).
func (*String) SetMinLength ¶
SetMinLength sets minimum string length (in Unicode code points).
Click to show internal directories.
Click to hide internal directories.