Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoField is returned when a field could not be found ErrNoField = errors.New("no field found") // ErrFieldRequired is returned when a field is required ErrFieldRequired = errors.New("field is required") )
Functions ¶
This section is empty.
Types ¶
type ValidationError ¶
type ValidationError struct {
Err error
}
ValidationError is returned when a value is not valid. This does look a little unnecessary, but it's useful to be able to distinguish errors we should present to the user versus errors that should just be in the logs
func (*ValidationError) Error ¶
func (v *ValidationError) Error() string
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates values
func (*Validator) ValidateAll ¶
ValidateAll validates all the values in the fields, erroring on any extra
func (*Validator) ValidateField ¶
ValidateField validates a single field against the schema contained therein
Click to show internal directories.
Click to hide internal directories.