Documentation ¶
Index ¶
- func EncodedJSON(w http.ResponseWriter, buf []byte)
- func Error(w http.ResponseWriter, status int, err error)
- func HTMLText(w http.ResponseWriter, status int, text string)
- func JSON(w http.ResponseWriter, status int, v interface{})
- func JSONAndCache(mc *memcache.Client, w http.ResponseWriter, key string, v interface{})
- func JSONText(w http.ResponseWriter, status int, message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodedJSON ¶
func EncodedJSON(w http.ResponseWriter, buf []byte)
EncodedJSON writes a response from a buffer with json encoded content.
The status is predefined as 200 (OK).
func Error ¶
func Error(w http.ResponseWriter, status int, err error)
Error is the function used to send error resposes.
func HTMLText ¶
func HTMLText(w http.ResponseWriter, status int, text string)
HTMLText is the function used to send html text resposes.
func JSON ¶
func JSON(w http.ResponseWriter, status int, v interface{})
JSON is the function used to send JSON responses.
func JSONAndCache ¶
func JSONAndCache(mc *memcache.Client, w http.ResponseWriter, key string, v interface{})
JSONAndCache works just like JSON but saves the encoding of v to the cache before writing the response.
The status should always be 200 (OK).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.