Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(c *app.Application) *chi.Mux
All returns the chi.Mux that is going to be used for our HTTP handlers. It's extracted into this function to see quickly which routes exist and where they are registered.
Types ¶
type ErrHandlerFunc ¶
type ErrHandlerFunc func(w http.ResponseWriter, r *http.Request) error
ErrHandlerFunc is an adapted version of the http.HandlerFunc which allows to return an error. This is especially helpful to avoid the pattern of:
err := someMethod() if err != nil { app.HandleError(w, r, err) return }
Instead, the error can be returned, reducing the possibility of forgetting a return statement.
Click to show internal directories.
Click to hide internal directories.