Documentation ¶
Index ¶
- func BadRequest(w http.ResponseWriter, r *http.Request, err error)
- func CommReply(w http.ResponseWriter, r *http.Request, status int, message string)
- func Conflict(w http.ResponseWriter, r *http.Request, err error)
- func Forbidden(w http.ResponseWriter, r *http.Request, err error)
- func InternalError(w http.ResponseWriter, r *http.Request, err error)
- func NotAcceptable(w http.ResponseWriter, r *http.Request, err error)
- func OK(w http.ResponseWriter, r *http.Request, message string)
- func ProcessError(w http.ResponseWriter, r *http.Request, err error)
- func Reply(w http.ResponseWriter, r *http.Request, status int, v interface{})
- func ResourceNotFound(w http.ResponseWriter, r *http.Request, message string)
- func ServiceUnavailable(w http.ResponseWriter, r *http.Request, err error)
- func SetRequestID(w http.ResponseWriter, requestID string)
- func Unauthorized(w http.ResponseWriter, r *http.Request, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, r *http.Request, err error)
BadRequest will return an error message indicating that the request is invalid
func Forbidden ¶
func Forbidden(w http.ResponseWriter, r *http.Request, err error)
Forbidden will block user access the resource, not authorized
func InternalError ¶
func InternalError(w http.ResponseWriter, r *http.Request, err error)
InternalError will return an error message indicating that the something is error inside the controller
func NotAcceptable ¶
func NotAcceptable(w http.ResponseWriter, r *http.Request, err error)
NotAcceptable xxx
func ProcessError ¶
func ProcessError(w http.ResponseWriter, r *http.Request, err error)
ProcessError xxx
func Reply ¶
func Reply(w http.ResponseWriter, r *http.Request, status int, v interface{})
Reply can be used for replying response Rename this to "reply" in the future because should call ResponseReply instead
func ResourceNotFound ¶
func ResourceNotFound(w http.ResponseWriter, r *http.Request, message string)
ResourceNotFound will return an error message indicating that the resource is not exist
func ServiceUnavailable ¶
func ServiceUnavailable(w http.ResponseWriter, r *http.Request, err error)
ServiceUnavailable will return an error message indicating that the service is not available now
func SetRequestID ¶
func SetRequestID(w http.ResponseWriter, requestID string)
SetRequestID will set the response header of the requestID
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, r *http.Request, err error)
Unauthorized will block user access the api, not login
Types ¶
This section is empty.