routes

package
v0.0.0-...-08b4e76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL