Documentation ¶
Index ¶
- func New(statusCode int, errorsMap *map[string]string) error
- func NewForBadRequest(err *map[string]string) error
- func NewForBadRequestWithSingleField(field string, message string) error
- func NewForForbiddenWithSingleField(field string, message string) error
- func NewForGoneWithSingleField(field string, message string) error
- func NewForLockedWithSingleField(field string, message string) error
- func NewForNotFoundWithSingleField(field string, message string) error
- func NewForServiceUnavailableWithSingleField(field string, message string) error
- func NewForSingleField(statusCode int, field string, message string) error
- func NewForUnauthorizedWithSingleField(field string, message string) error
- func ResponseError(rw http.ResponseWriter, err error)
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewForBadRequest ¶
NewForBadRequest create a new HTTPError instance pertaining to 403 bad requests with the multi-errors. This is a convinience constructor.
func NewForBadRequestWithSingleField ¶
NewForBadRequestWithSingleField create a new HTTPError instance pertaining to 403 bad requests for a single field. This is a convinience constructor.
func NewForForbiddenWithSingleField ¶
NewForForbiddenWithSingleField create a new HTTPError instance pertaining to 403 bad requests for a single field. This is a convinience constructor.
func NewForGoneWithSingleField ¶
NewForGoneWithSingleField create a new HTTPError instance pertaining to 410 gone for a single field. This is a convinience constructor.
func NewForLockedWithSingleField ¶
NewForLockedWithSingleField create a new HTTPError instance pertaining to 424 locked for a single field. This is a convinience constructor.
func NewForNotFoundWithSingleField ¶
NewForNotFoundWithSingleField create a new HTTPError instance pertaining to 404 not found for a single field. This is a convinience constructor.
func NewForServiceUnavailableWithSingleField ¶
NewForServiceUnavailableWithSingleField create a new HTTPError instance pertaining service unavailable for a single field. This is a convinience constructor.
func NewForSingleField ¶
NewForSingleField create a new HTTPError instance for a single field. This is a convinience constructor.
func NewForUnauthorizedWithSingleField ¶
NewForUnauthorizedWithSingleField create a new HTTPError instance pertaining to 401 unauthorized for a single field. This is a convinience constructor.
func ResponseError ¶
func ResponseError(rw http.ResponseWriter, err error)
ResponseError function returns the HTTP error response based on the httpcode used.