Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
Error holds a custom error for the application which is helpful in returning a consistent error type/message from API endpoints
func NewConflict ¶
NewConflict to create 409 erros
func NewNotFound ¶
NewNotFound to create an error for 404
type Type ¶
type Type string
Type holds a type string and integer code for the error
const ( BadRequest Type = "BADREQUEST" // Validation errors Internal Type = "INTERNAL" // Server (500) and fallback errors NotFound Type = "NOTFOUND" // For not finding resource Forbidden Type = "FORBIDDEN" // The client has no access rights to the content so the server is refusing to respond Conflict Type = "CONFLICT" // Already exists - 409 )
Set of valid errorTypes
Click to show internal directories.
Click to hide internal directories.