Documentation
¶
Overview ¶
Package write provides http-related functions, types, utilities, etc. The package name was deliberately chosen so as to not conflict with net/http, as these two packages are bound to be used together.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeJSON ¶
func EncodeJSON(w http.ResponseWriter, v interface{})
EncodeJSON conveniently writes JSON data responses.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Status int `json:"status"`
StatusText string `json:"statusText"`
Error string `json:"error"`
}
ErrorResponse is the format for JSON error responses, as defined by the wxu-web style guides.