Documentation
¶
Index ¶
Constants ¶
View Source
const ( CodeOk = 0 // OK CodeErr = -1 // general error CodeAuthErr = -2 // unauthenticated request )
Variables ¶
This section is empty.
Functions ¶
func ErrorJSON ¶
func ErrorJSON(w http.ResponseWriter, code int, err string, status int)
ErrorCode writes the json-encoded error message to the response.
func GzJSON ¶
func GzJSON(w http.ResponseWriter, v interface{}, status int)
GzJSON writes the json-encoded error message to the response with a 400 bad request status code.
func JSON ¶
func JSON(w http.ResponseWriter, v interface{}, status int)
JSON writes the json-encoded error message to the response with a 400 bad request status code.
Types ¶
Click to show internal directories.
Click to hide internal directories.