Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStatusOK = &ErrorResponse{StatusCode: http.StatusOK, Message: "Status OK"} ErrBadRequest = &ErrorResponse{StatusCode: http.StatusBadRequest, Message: "Bad request"} ErrForbidden = &ErrorResponse{StatusCode: http.StatusForbidden, Message: "Access forbidden"} ErrNotFound = &ErrorResponse{StatusCode: http.StatusNotFound, Message: "Resource not found"} ErrMethodNotAllowed = &ErrorResponse{StatusCode: http.StatusMethodNotAllowed, Message: "Method not allowed"} ErrInternalServer = &ErrorResponse{StatusCode: http.StatusInternalServerError, Message: "Internal Server Error"} ErrStrAuthIncorrect = "Auth data incorrect" )
Functions ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Err error `json:"-"` StatusCode int `json:"-"` StatusText string `json:"status_text"` Message string `json:"message"` }
func ErrorRenderer ¶
func ErrorRenderer(err error) *ErrorResponse
func ServerErrorRenderer ¶
func ServerErrorRenderer(err error) *ErrorResponse
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
}
Click to show internal directories.
Click to hide internal directories.