Documentation
¶
Index ¶
- Variables
- type HTTPError
- func NewBadRequestError(message ...string) HTTPError
- func NewConflictError(message ...string) HTTPError
- func NewError(status int, message ...string) HTTPError
- func NewInternalServerError(message ...string) HTTPError
- func NewNotFoundError(message ...string) HTTPError
- func NewUnauthorizedError(message ...string) HTTPError
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultErrorContentTypeResponses = []string{
"application/json",
"application/xml",
"multipart/form-data",
}
View Source
var DefaultErrorResponses = map[int]HTTPError{ http.StatusBadRequest: newErrorResponse(uuid.NewString(), http.StatusBadRequest, "Bad Request"), http.StatusInternalServerError: newErrorResponse(uuid.NewString(), http.StatusInternalServerError, "Internal Server Error"), }
Functions ¶
This section is empty.
Types ¶
type HTTPError ¶
type HTTPError struct {
ID string `form:"id" json:"id" xml:"id"`
Status int `form:"status" json:"status" xml:"status"`
Message string `form:"message" json:"message" xml:"message"`
}
func NewBadRequestError ¶
func NewConflictError ¶
func NewInternalServerError ¶
func NewNotFoundError ¶
func NewUnauthorizedError ¶
func (HTTPError) Description ¶
func (HTTPError) SetMessage ¶
func (HTTPError) StatusCode ¶
Click to show internal directories.
Click to hide internal directories.