Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
Validate checks HTTP request method and header. Validate returns both error and corresponded StatusCode when validation fails. The StatusCode can be set as a status code for a HTTP response.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, statusCode int, v interface{}) error
WriteResponse writes StatusCode and JSON body to response. It also sets Content-Type header to application/json.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.