Documentation ¶
Index ¶
- func ClearLastActivity(session *sessions.Session)
- func LastActivityFromSession(session *sessions.Session) time.Time
- func PermissionMappingFromContext(ctx context.Context) rbac.PermissionMapping
- func RequestIDFromContext(ctx context.Context) string
- func SessionFromContext(ctx context.Context) *sessions.Session
- func StoreSessionLastActivity(session *sessions.Session, t time.Time)
- func UserFromContext(ctx context.Context) *model.User
- func WithPermissionMapping(ctx context.Context, p rbac.PermissionMapping) context.Context
- func WithRequestID(ctx context.Context, id string) context.Context
- func WithSession(ctx context.Context, session *sessions.Session) context.Context
- func WithUser(ctx context.Context, u model.User) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearLastActivity ¶
ClearLastActivity clears the session last activity time.
func LastActivityFromSession ¶
LastActivityFromSession extracts the last time the user did something.
func PermissionMappingFromContext ¶
func PermissionMappingFromContext(ctx context.Context) rbac.PermissionMapping
func RequestIDFromContext ¶
func SessionFromContext ¶
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 ¶
StoreSessionLastActivity stores the last time the user did something. This is used to track idle session timeouts.
func UserFromContext ¶
UserFromContext retrieves the user from the context. If no value exists, it returns nil.
func WithPermissionMapping ¶
WithPermissionMapping stores the user's available memberships on the context.
func WithSession ¶
WithSession stores the session on the request's context for retrieval later. Use Session(r) to retrieve the session.
Types ¶
This section is empty.