Documentation ¶
Overview ¶
package req provides request body validation facilities. Using struct tags you may define rules in order to validate structured user input.
Index ¶
Constants ¶
View Source
const ( // StructTagName is the name of the tags package req bases its behavior // on. StructTagName = "req" // StructTagNonZero indicates that a field with a zero value shall fail // validation. StructTagNonZero = "nonzero" )
Variables ¶
Functions ¶
Types ¶
type FieldValidationError ¶
type FieldValidationError struct { Field reflect.StructField Err error }
FieldValidationError signals that a field failed to validate.
func (FieldValidationError) Error ¶
func (fve FieldValidationError) Error() string
type ValidationError ¶
type ValidationError []error
ValidationError is an error representing one or more validation errors.
func (ValidationError) Error ¶
func (ve ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.