Documentation ¶
Index ¶
- func AppInfo(app string, org string, version string) func(http.Handler) http.Handler
- func Ping(next http.Handler) http.Handler
- func Recoverer(next http.Handler) http.Handler
- func RenderJSONFromBytes(w http.ResponseWriter, r *http.Request, data []byte) error
- func RenderJSONWithHTML(w http.ResponseWriter, r *http.Request, v interface{}) error
- func SendErrorJSON(w http.ResponseWriter, r *http.Request, code int, err error, details string)
- type JSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Recoverer ¶
Recoverer is a middleware that recovers from panics, logs the panic and returns a HTTP 500 status if possible.
func RenderJSONFromBytes ¶
RenderJSONFromBytes sends binary data as json
func RenderJSONWithHTML ¶
func RenderJSONWithHTML(w http.ResponseWriter, r *http.Request, v interface{}) error
RenderJSONWithHTML allows html tags and forces charset=utf-8
func SendErrorJSON ¶
SendErrorJSON makes {error: blah, details: blah} json body and responds with error code
Types ¶
Click to show internal directories.
Click to hide internal directories.