Documentation
¶
Overview ¶
Package session contains methods and objects for managing user sessions.
Index ¶
- func Clear(ctx context.Context) error
- func Commit(ctx context.Context) error
- func GetListArticleFiltersFromSession(ctx context.Context) *models.ListFilters
- func GetListSubscriptionFiltersFromSession(ctx context.Context) *models.ListFilters
- func LoadAndSave(next http.Handler) http.Handler
- func NewSessionManager() error
- func Renew(ctx context.Context) error
- func Restore[T any](ctx context.Context, key string) (T, error)
- func Save[T any](ctx context.Context, key string, obj T)
- func StoreListArticleFiltersInSession(ctx context.Context, filters models.ListFilters)
- func StoreListSubscriptionFiltersInSession(ctx context.Context, filters models.ListFilters)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clear ¶
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 ¶
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 Renew ¶ added in v0.51.0
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 ¶
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 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.