Documentation ¶
Overview ¶
Package session ...
Package session ...
Package session ...
Package session ...
Index ¶
- func CreateNewSession(ctx context.Context, req *sessionproto.SessionCreateRequest) (response.RPC, string)
- func DeleteSession(ctx context.Context, req *sessionproto.SessionRequest) response.RPC
- func GetAllActiveSessions(ctx context.Context, req *sessionproto.SessionRequest) response.RPC
- func GetSession(ctx context.Context, req *sessionproto.SessionRequest) response.RPC
- func GetSessionService(ctx context.Context, req *sessionproto.SessionRequest) response.RPC
- func GetSessionUserName(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUserName, error)
- func GetSessionUserRoleID(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUsersRoleID, error)
- func UpdateLastUsedTime(ctx context.Context, token string) error
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 ¶
func GetSessionUserName(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUserName, error)
GetSessionUserName is a RPC handle to get the session username from the session Token
func GetSessionUserRoleID ¶
func GetSessionUserRoleID(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUsersRoleID, error)
GetSessionUserRoleID is a RPC handle to get the session user's role id from the session Token
func UpdateLastUsedTime ¶
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.