Documentation
¶
Index ¶
- func RenderHTTPResponse(w http.ResponseWriter, v interface{}, t *template.Template, r *http.Request)
- func StreamWriteYAMLResponse(w http.ResponseWriter, iter chan interface{}, logger log.Logger)
- func WriteHTMLResponse(w http.ResponseWriter, message string)
- func WriteJSONResponse(w http.ResponseWriter, v interface{})
- func WriteTextResponse(w http.ResponseWriter, message string)
- func WriteYAMLResponse(w http.ResponseWriter, v interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderHTTPResponse ¶
func RenderHTTPResponse(w http.ResponseWriter, v interface{}, t *template.Template, r *http.Request)
RenderHTTPResponse either responds with JSON or a rendered HTML page using the passed in template by checking the Accepts header.
func StreamWriteYAMLResponse ¶
func StreamWriteYAMLResponse(w http.ResponseWriter, iter chan interface{}, logger log.Logger)
StreamWriteYAMLResponse stream writes data as http response
func WriteHTMLResponse ¶
func WriteHTMLResponse(w http.ResponseWriter, message string)
WriteHTMLResponse sends message as text/html response with 200 status code.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, v interface{})
WriteJSONResponse writes some JSON as a HTTP response.
func WriteTextResponse ¶
func WriteTextResponse(w http.ResponseWriter, message string)
WriteTextResponse sends message as text/plain response with 200 status code.
func WriteYAMLResponse ¶
func WriteYAMLResponse(w http.ResponseWriter, v interface{})
WriteYAMLResponse writes some YAML as a HTTP response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.