Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentTypeKey = "Content-Type" ContentLengthKey = "Content-Length" ContentTypeJSON = "application/json" ContentTypeText = "text/plain" )
Variables ¶
This section is empty.
Functions ¶
func Empty ¶
func Empty(w http.ResponseWriter, code int)
Empty is a utility function to serve an empty response
func Error ¶
func Error(w http.ResponseWriter, code int, reason ...string) error
Error is a utility function to serve a JSON error notice
Types ¶
type ErrorResponse ¶
ErrorResponse is a generic error response which is served as JSON using the ServeError method
Click to show internal directories.
Click to hide internal directories.