Documentation
¶
Overview ¶
Package canopyecho mounts Canopy on an Echo router.
Mount registers the Canopy handler at the configured base path. The middleware helpers wrap Canopy's net/http middleware with echo.WrapMiddleware. Session data stays in the request context, so handlers read it with Session or canopy.SessionFromContext.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mount ¶
Mount registers the Canopy handler on the router at the base path from Config.BasePath. Do not wrap the handler with http.StripPrefix.
func OptionalSession ¶
func OptionalSession(a *canopy.Auth) echo.MiddlewareFunc
OptionalSession returns middleware that adds session data to the request context when a valid session is present and continues anonymously otherwise.
func RequireSession ¶
func RequireSession(a *canopy.Auth) echo.MiddlewareFunc
RequireSession returns middleware that adds session data to the request context or ends the request with a 401 JSON error.
Types ¶
This section is empty.