canopygin

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 canopygin mounts Canopy on a Gin router.

Mount registers the Canopy handler at the configured base path. The middleware helpers bridge Canopy's net/http middleware into Gin handler functions. 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

func Mount(r gin.IRouter, 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) gin.HandlerFunc

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) gin.HandlerFunc

RequireSession returns middleware that adds session data to the request context or ends the request with a 401 JSON error.

func Session

func Session(c *gin.Context) (*canopy.SessionData, bool)

Session returns the session data that the middleware stored on the request context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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