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
UserFromCtx returns the user information from the context
func UserFromRequest ¶ added in v0.6.1
UserFromRequest returns the user information from the request context
Click to show internal directories.
Click to hide internal directories.