Documentation ¶
Index ¶
- func ErrorHandler(handler func(http.ResponseWriter, *http.Request) error) http.HandlerFunc
- func MethodNotAllowedHandler() http.HandlerFunc
- func MountAssets(r chi.Router)
- func MountData(r chi.Router, rcs ...*zip.ReadCloser)
- func NotFoundHandler() http.HandlerFunc
- func TrailingSlashRedirect(w http.ResponseWriter, r *http.Request)
- func WriteResponseBody(w http.ResponseWriter, b []byte) error
- func WriteTemplateResponse(w http.ResponseWriter, tmpl Template, data interface{}) error
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler(handler func(http.ResponseWriter, *http.Request) error) http.HandlerFunc
ErrorHandler converts a handler with an error return to a http.HandlerFunc, sending a HTTP error code and a JSON formatted RFC 7807 problem detail document to the client appropriate for a given error.
func MethodNotAllowedHandler ¶
func MethodNotAllowedHandler() http.HandlerFunc
MethodNotAllowedHandler returns a handler that serves a 405 Method Not Allowed error.
func MountAssets ¶
func NotFoundHandler ¶
func NotFoundHandler() http.HandlerFunc
NotFoundHandler returns a handler that serves a 404 Not Found error.
func TrailingSlashRedirect ¶
func TrailingSlashRedirect(w http.ResponseWriter, r *http.Request)
func WriteResponseBody ¶
func WriteResponseBody(w http.ResponseWriter, b []byte) error
func WriteTemplateResponse ¶
func WriteTemplateResponse(w http.ResponseWriter, tmpl Template, data interface{}) error
Types ¶
Click to show internal directories.
Click to hide internal directories.