Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonHandler ¶
JsonHandler is a handler that returns a response.
func (JsonHandler) ServeHTTP ¶
func (h JsonHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
type Option ¶
type Option func(*Response)
Option is a function that modifies a response.
func SetBody ¶
func SetBody(body interface{}) Option
SetBody will marshal the body to JSON if the content-type is application/json.
Click to show internal directories.
Click to hide internal directories.