Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMethodNotAllowed = &ErrorResponse{StatusCode: 405, Message: "Method not allowed"} ErrNotFound = &ErrorResponse{StatusCode: 404, Message: "Resource not found"} )
Functions ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Err error `json:"-"` StatusCode int `json:"-"` StatusText string `json:"status_text"` Message string `json:"message"` }
func ErrorBadRequest ¶
func ErrorBadRequest(err error) *ErrorResponse
func ErrorRenderer ¶
func ErrorRenderer(err error) *ErrorResponse
func ServerErrorRenderer ¶
func ServerErrorRenderer(err error) *ErrorResponse
func (*ErrorResponse) Render ¶
func (e *ErrorResponse) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.