canopychi

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package canopychi mounts Canopy on a chi router.

chi routes standard net/http handlers, so this adapter is a thin convenience layer. Mount registers the Canopy handler at the configured base path without http.StripPrefix, which Canopy forbids. The session middleware helpers return the root Canopy middleware unchanged so the call site names the framework consistently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(r chi.Router, a *canopy.Auth)

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) func(http.Handler) http.Handler

OptionalSession returns middleware that adds session data to the request context when a valid session is present and continues anonymously otherwise. Read the session with canopy.SessionFromContext.

func RequireSession

func RequireSession(a *canopy.Auth) func(http.Handler) http.Handler

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.

Jump to

Keyboard shortcuts

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