Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BAD_REQUEST_ERROR = []ErrorContent{ { Status: http.StatusBadRequest, Title: "Bad Request", }, } NOT_FOUND_ERROR = []ErrorContent{ { Status: http.StatusNotFound, Title: "Not Found", }, } METHOD_NOT_ALLOWED_ERROR = []ErrorContent{ { Status: http.StatusMethodNotAllowed, Title: "Method Not Allowed", }, } UNSUPPORTED_MEDIA_TYPE_ERROR = []ErrorContent{ { Status: http.StatusUnsupportedMediaType, Title: "Unsupported Media Type", }, } INTERNAL_SERVER_ERROR = []ErrorContent{ { Status: http.StatusInternalServerError, Title: "Internal Server Error", }, } )
Functions ¶
This section is empty.
Types ¶
type ErrorContent ¶
type HTTPError ¶
type HTTPError struct {
Status int `json:"-"`
Header *http.Header `json:"-"`
Errors *[]ErrorContent `json:"errors"`
}
func NewHTTPError ¶
func NewHTTPError(status int, errors *[]ErrorContent) *HTTPError
func (*HTTPError) Write ¶
func (e *HTTPError) Write(w http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.