Documentation ¶
Index ¶
Constants ¶
View Source
const ( STATUS_INVALID = 400 STATUS_PERMISSION_DENIED = 401 STATUS_NOTFOUND = 404 STATUS_INERNAL_ERROR = 500 MESSAGE_ACCESS_DENIED = "access denied" MESSAGE_NOT_FOUND = "not found" MESSAGE_UNAUTHORIZED = "unauthorized" MESSAGE_INTERNAL_ERROR = "internal server error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Status int `json:"-"` Message string `json:"error"` Details []string `json:"details"` }
func InternalError ¶
func InternalError(message string) ErrorResponse
InternalError creates a 500 Internal Server Error response with an optional message.
func Invalid ¶
func Invalid(message string, details []string) ErrorResponse
Invalid creates an ErrorResponse for an invalid request.
func Unauthorized ¶
func Unauthorized(message string) ErrorResponse
Unauthorized creates a 401 Unauthorized response with an optional message.
Click to show internal directories.
Click to hide internal directories.