Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorFactory ¶
type ErrorFactory func(e validator.FieldError) error
type FieldValidation ¶
type FieldValidation func(level validator.FieldLevel) error
type TagErrorMap ¶
type TagErrorMap map[string]ErrorFactory
type ValidationErrorMutator ¶
type ValidationErrorMutator func(*ValidationErrors)
type ValidationErrors ¶
type ValidationErrors []error
func (ValidationErrors) Error ¶
func (v ValidationErrors) Error() string
type Validator ¶
type Validator struct { *validator.Validate // contains filtered or unexported fields }
func NewValidator ¶
func NewValidator() *Validator
func (*Validator) DefaultErrorMessage ¶
func (v *Validator) DefaultErrorMessage(factory ErrorFactory)
Set a default error message template for all validator errors.
func (*Validator) OverrideErrorMessage ¶
func (v *Validator) OverrideErrorMessage(tag string, factory ErrorFactory)
Override the error message factory for a particular validation.
func (*Validator) SetFieldTagValidator ¶
func (v *Validator) SetFieldTagValidator(tag string, validation FieldValidation)
Create a custom field tag validator that returns an error message.
Click to show internal directories.
Click to hide internal directories.