Documentation ¶
Overview ¶
Package validate contains the support for validating models.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidID = errors.New("ID is not in its proper form")
ErrInvalidID occurs when an ID is not in a valid form.
Functions ¶
func Check ¶
func Check(val interface{}) error
Check validates the provided model against it's declared tags.
func NewRequestError ¶
NewRequestError wraps a provided error with an HTTP status code. This function should be used when handlers encounter expected errors.
Types ¶
type ErrorResponse ¶
ErrorResponse is the form used for API responses from failures in the API.
type FieldError ¶
FieldError is used to indicate an error with a specific request field.
type FieldErrors ¶
type FieldErrors []FieldError
FieldErrors represents a collection of field errors.
func (FieldErrors) Error ¶
func (fe FieldErrors) Error() string
Error implments the error interface.
type RequestError ¶
RequestError is used to pass an error during the request through the application with web specific context.
func (*RequestError) Error ¶
func (err *RequestError) Error() string
Error implements the error interface. It uses the default message of the wrapped error. This is what will be shown in the services' logs.