Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Response ¶
type Response struct { Status int `json:"-"` Message string `json:"message"` Details interface{} `json:"details,omitempty"` }
Response is the response that represents an error.
func BadRequest ¶
BadRequest creates a new error response representing a bad request (HTTP 400)
func Forbidden ¶
Forbidden creates a new error response representing an authorization failure (HTTP 403)
func InternalServerError ¶
InternalServerError creates a new error response representing an internal server error (HTTP 500)
func InvalidInput ¶
func InvalidInput(errs validation.Errors) Response
InvalidInput creates a new error response representing a data validation error (HTTP 400).
func NotFound ¶
NotFound creates a new error response representing a resource-not-found error (HTTP 404)
func SuccessMessage ¶
func SuccessMessage() Response
SuccessMessage returns the struct for success response with only message
func Unauthorized ¶
Unauthorized creates a new error response representing an authentication/authorization failure (HTTP 401)
func (Response) StatusCode ¶
StatusCode is required by routing.HTTPError interface.