Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeRequest ¶
DecodeRequest decodes the request body as JSON into the provided value.
func EncodeResponse ¶
EncodeResponse sets the Content-Type header field to application/json, and writes to the response writer with the given status code and data encoded as JSON.
If data is nil, only the status code is written and no data is encoded.
If data is of type io.Reader or []byte, it is assumed to be encoded JSON and is written directly to the response writer.
Types ¶
type HandlerFunc ¶
HandlerFunc is like http.HandlerFunc, but returns a status code and an error.
Click to show internal directories.
Click to hide internal directories.