session

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 1 module, 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 session contains methods and objects for managing user sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(ctx context.Context) error

func LoadAndSave

func LoadAndSave(next http.Handler) http.Handler

func NewSessionManager

func NewSessionManager() error

NewSessionManager creates a new session manager.

func Restore

func Restore[T any](ctx context.Context, key string) (T, error)

Restore retrieves an object from the session storage with the given key. If the object cannot be retrieved, then the defaultFunc is used to generate a new default value.

func Save

func Save[T any](ctx context.Context, key string, obj T)

Save saves the given object to the session storage with the given key.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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