Documentation ¶
Overview ¶
Package response provides a set of utilities for writing responses to an http.ResponseWriter.
Index ¶
- func ServeETagJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})
- func ServeJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})
- func ServeNoContent(w http.ResponseWriter, r *http.Request, statusCode int)
- func ServeString(w http.ResponseWriter, r *http.Request, statusCode int, data string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeETagJSON ¶
func ServeETagJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})
ServeETagJSON serves the supplied data as JSON and includes an ETag for 2xx status codes
func ServeJSON ¶
func ServeJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})
ServeJSON serves the supplied data as JSON
func ServeNoContent ¶
func ServeNoContent(w http.ResponseWriter, r *http.Request, statusCode int)
ServeNoContent serves the status code only, with no content body or Content-Type headers.
func ServeString ¶
ServeString serves the data parameter as the output from the request with no processing on the data.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.