session

package
v0.0.0-...-8d2fcc7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package session ...

Package session ...

Package session ...

Package session ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewSession

func CreateNewSession(ctx context.Context, req *sessionproto.SessionCreateRequest) (response.RPC, string)

CreateNewSession is a method to to create a session it will accepts the SessionCreateRequest which will have username and password and check whether the credentials are correct also it will check privileges. and then add the session details in DB respond RPC response and error if there is.

func DeleteSession

func DeleteSession(ctx context.Context, req *sessionproto.SessionRequest) response.RPC

DeleteSession is a method to delete a sessiom it will accepts the SessionCreateRequest which will have sessionid and sessiontoken and it will check privileges to delete session and then delete the session respond RPC response and error if there is.

func GetAllActiveSessions

func GetAllActiveSessions(ctx context.Context, req *sessionproto.SessionRequest) response.RPC

GetAllActiveSessions is a method to get session it will accepts the SessionCreateRequest which will have sessionid and sessiontoken and it will check privileges to get session and then get all the active sessions respond RPC response and error if there is.

func GetSession

func GetSession(ctx context.Context, req *sessionproto.SessionRequest) response.RPC

GetSession is a method to get session it will accepts the SessionCreateRequest which will have sessionid and sessiontoken and it will check privileges to get session and then get the session against the sessionID respond RPC response and error if there is.

func GetSessionService

func GetSessionService(ctx context.Context, req *sessionproto.SessionRequest) response.RPC

GetSessionService is a method to get session it will accepts the SessionCreateRequest which will have sessionid and sessiontoken and it will check the session service is enabled or not from the config file. respond RPC response and error if there are.

func GetSessionUserName

GetSessionUserName is a RPC handle to get the session username from the session Token

func GetSessionUserRoleID

GetSessionUserRoleID is a RPC handle to get the session user's role id from the session Token

func UpdateLastUsedTime

func UpdateLastUsedTime(ctx context.Context, token string) error

UpdateLastUsedTime is supposed to be used whenever there is a session usage. The function is for updating the last used time of a session, so that the active sessions won't time out and expire. As the input of the function we are passing the session token. As return, function give backs the error, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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