sessioninfo

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package sessioninfo handles session information.

Index

Constants

View Source
const (
	// CtxSessionInfo is the key used to store the SessionInfo in the context.
	CtxSessionInfo ctxKey = "sessionInfo"
	// CtxUserInfo is the key used to store the UserInfo in the context.
	CtxUserInfo ctxKey = "userInfo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionInfo

type SessionInfo struct {
	ID        ccc.UUID
	Username  string
	CreatedAt time.Time
	UpdatedAt time.Time
	Expired   bool
}

SessionInfo struct contains information about a session

func FromCtx added in v0.1.2

func FromCtx(ctx context.Context) *SessionInfo

FromCtx returns the session information from the context.

func FromRequest

func FromRequest(r *http.Request) *SessionInfo

FromRequest returns the session information from the request context.

type UserInfo added in v0.6.1

type UserInfo struct {
	ID       ccc.UUID `spanner:"Id"           db:"Id"`
	Username string   `spanner:"Username"     db:"Username"`
	Disabled bool     `spanner:"Disabled"     db:"Disabled"`
}

UserInfo struct contains information about a user

func UserFromCtx added in v0.6.1

func UserFromCtx(ctx context.Context) *UserInfo

UserFromCtx returns the user information from the context

func UserFromRequest added in v0.6.1

func UserFromRequest(r *http.Request) *UserInfo

UserFromRequest returns the user information from the request context

Jump to

Keyboard shortcuts

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