Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckForSessionAvailability ¶
CheckForSessionAvailability checks if the user has active session for provided `sessionFor`. Returns true if session is available.
func DeleteSession ¶
func DeleteSession(userId, sessionFor string)
DeleteSession removes a particular session for user, if present.
func Init ¶
Init initializes sessions with provided cache. Subsequent calls will not have any effect after first initialization.
func Set ¶
Set stores the sessions for provided userId. Session is appended to the list. It does not check if the same session exists or not.
func ValidateSessionFromToken ¶
ValidateSessionFromToken checks for session id in claims against available sessions. Validate only if a nonempty `sessionId` is present. The claims must contain `userId` field if session is present.
Types ¶
Click to show internal directories.
Click to hide internal directories.