Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HTTPStatusMap = map[string]int{ cerror.ErrorType.Conflict: http.StatusConflict, cerror.ErrorType.Forbidden: http.StatusForbidden, cerror.ErrorType.InternalServer: http.StatusInternalServerError, cerror.ErrorType.NotFound: http.StatusNotFound, cerror.ErrorType.Unauthorized: http.StatusUnauthorized, cerror.ErrorType.Validation: http.StatusBadRequest, }
HTTPStatusMap maps custom error types to relevant HTTP status codes
Functions ¶
func DecodeRequest ¶
DecodeRequest
func EncodeError ¶
func EncodeError(w http.ResponseWriter, r *http.Request, err error)
EncodeError writes error messages to the response writer
func EncodeResponse ¶
EncodeResponse
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.