Documentation ¶
Overview ¶
Package response provides convenience functions to write into a http.ResponseWriter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Empty ¶
func Empty(rw http.ResponseWriter) *httperror.HandlerError
Empty merely sets the response code to NoContent (204).
func JSON ¶
func JSON(rw http.ResponseWriter, data interface{}) *httperror.HandlerError
JSON encodes data to rw in JSON format. Returns a pointer to a HandlerError if encoding fails.
func YAML ¶
func YAML(rw http.ResponseWriter, data interface{}) *httperror.HandlerError
JSON encodes data to rw in YAML format. Returns a pointer to a HandlerError if encoding fails.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.