Documentation
¶
Overview ¶
The validation package handles validating data with validators from the validator package. For more info on validators or the tag syntax for validating struct fields please see the documentation for the validator package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterValidator ¶
func RegisterValidator(name string, customValidatorFactory validator.ValidatorFactory)
This allows you to register custom validator to be read from struct field tag validatoin data.
Types ¶
type ValidationError ¶
type ValidationError struct {
DataType string
Errors validationErrorMap
}
ValidationError represents the overall validation state of a value.
func Validate ¶
func Validate(v *validationparams.ValidationParams) (*ValidationError, error)
The Validator parameter is present to allow for validating non struct values. In this function A Validator pointer can be passed in and evaluated on a non struct value like an individual int or string.
func ValidateStructWithTag ¶
func ValidateStructWithTag(s interface{}) *ValidationError
This function validates an input struct based on the validation tags is has in its tag data.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error produces a string that relays all of the validation failures from validation.