session

package
v0.166.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

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

Clear deletes the session data from the session store and sets the session status to Destroyed. Any further operations in the same request cycle will result in a new session being created.

func GetListArticleFiltersFromSession added in v0.80.3

func GetListArticleFiltersFromSession(ctx context.Context) *models.ListFilters

func GetListSubscriptionFiltersFromSession added in v0.80.3

func GetListSubscriptionFiltersFromSession(ctx context.Context) *models.ListFilters

func LoadAndSave

func LoadAndSave(next http.Handler) http.Handler

LoadAndSave middleware handles loading the session data for a request and saving any modifications.

func NewSessionManager

func NewSessionManager() error

NewSessionManager creates a new session manager.

func Remove added in v0.104.0

func Remove(ctx context.Context, key string)

Remove will remove the value with the given key from the session.

func Renew added in v0.51.0

func Renew(ctx context.Context) error

Renew updates the session data to have a new session token while retaining the current session data. The session lifetime is also reset and the session data status will be set to Modified. The old session token and accompanying data are deleted from the session store.

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 there is an error retrieving the object as the given type a non-nill error containing details will be returned.

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.

func StoreListArticleFiltersInSession added in v0.80.3

func StoreListArticleFiltersInSession(ctx context.Context, filters models.ListFilters)

func StoreListSubscriptionFiltersInSession added in v0.80.3

func StoreListSubscriptionFiltersInSession(ctx context.Context, filters models.ListFilters)

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