controller

package
v0.0.0-...-d595cb9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLastActivity

func ClearLastActivity(session *sessions.Session)

ClearLastActivity clears the session last activity time.

func LastActivityFromSession

func LastActivityFromSession(session *sessions.Session) time.Time

LastActivityFromSession extracts the last time the user did something.

func PermissionMappingFromContext

func PermissionMappingFromContext(ctx context.Context) rbac.PermissionMapping

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

func SessionFromContext

func SessionFromContext(ctx context.Context) *sessions.Session

SessionFromContext retrieves the session on the provided context. If no session exists, or if the value in the context is not of the correct type, it returns nil.

func StoreSessionLastActivity

func StoreSessionLastActivity(session *sessions.Session, t time.Time)

StoreSessionLastActivity stores the last time the user did something. This is used to track idle session timeouts.

func UserFromContext

func UserFromContext(ctx context.Context) *model.User

UserFromContext retrieves the user from the context. If no value exists, it returns nil.

func WithPermissionMapping

func WithPermissionMapping(ctx context.Context, p rbac.PermissionMapping) context.Context

WithPermissionMapping stores the user's available memberships on the context.

func WithRequestID

func WithRequestID(ctx context.Context, id string) context.Context

func WithSession

func WithSession(ctx context.Context, session *sessions.Session) context.Context

WithSession stores the session on the request's context for retrieval later. Use Session(r) to retrieve the session.

func WithUser

func WithUser(ctx context.Context, u model.User) context.Context

WithUser stores the current user on the context.

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