Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
func NewValidation ¶
func NewValidation() *Validation
func (*Validation) GetJSON ¶
func (v *Validation) GetJSON(structure interface{}, w http.ResponseWriter, r *http.Request, log *logrus.Logger) error
Helper that decodes and validates incoming JSON request body
func (*Validation) Validate ¶
func (v *Validation) Validate(i interface{}) ValidationErrors
type ValidationError ¶
type ValidationError struct {
validator.FieldError
}
ValidationError wraps the validators FieldError so we do not expose this
func (ValidationError) Error ¶
func (v ValidationError) Error() string
type ValidationErrorResp ¶
type ValidationErrorResp struct {
Messages []string `json:"messages"`
}
ValidationError is a collection of validation error messages
type ValidationErrors ¶
type ValidationErrors []ValidationError
func (ValidationErrors) Errors ¶
func (v ValidationErrors) Errors() []string
Errors converts the slice into a string slice
Click to show internal directories.
Click to hide internal directories.