Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidMonth ¶
func InvalidQueryString ¶
func InvalidUUID ¶
Types ¶
type ErrorStatus ¶
type ErrorStatus struct { Err error Status int // Used with http.StatusX for the corresponding HTTP status code }
ErrorStatus is used to return an error with the corresponding HTTP status code to a controller.
func DBError ¶
func DBError(c *gin.Context, err error) ErrorStatus
DBError returns an error message and status code appropriate to the error that has occurred.
func GenericDBError ¶
GenericDBError wraps DBError with a more specific error message for not found errors.
func (ErrorStatus) Body ¶
func (e ErrorStatus) Body() map[string]string
Body returns the the content of the HTTP response body for the error.
func (ErrorStatus) Nil ¶
func (e ErrorStatus) Nil() bool
Nil checks if the ErrorStatus is the zero value.
Click to show internal directories.
Click to hide internal directories.