Documentation ¶
Index ¶
- func ErrorResponse(w http.ResponseWriter, r *http.Request, error string, code int)
- func HandleError(w http.ResponseWriter, err error, statusCode int) bool
- func JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
- func JSONResponseCode(w http.ResponseWriter, r *http.Request, result interface{}, responseCode int)
- func Sleep(mean time.Duration, stdDev time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
func HandleError ¶
func HandleError(w http.ResponseWriter, err error, statusCode int) bool
HandleError checks if the error is not nil, writes it to the output with the specified status code, and returns true. If error is nil it returns false.
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
func JSONResponseCode ¶
func JSONResponseCode(w http.ResponseWriter, r *http.Request, result interface{}, responseCode int)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.