rpc

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: 19 Imported by: 0

Documentation

Overview

Package rpc ...

Package rpc ...

Package rpc ...

Package rpc ...

Index

Constants

This section is empty.

Variables

View Source
var (
	GetAllAccountsFunc    = account.GetAllAccounts
	GetAccountFunc        = account.GetAccount
	GetAccountServiceFunc = account.GetAccountService
	AccDeleteFunc         = account.Delete
)
View Source
var (
	CheckSessionTimeOutFunc = auth.CheckSessionTimeOut
	UpdateLastUsedTimeFunc  = session.UpdateLastUsedTime
	CreateFunc              = role.Create
	GetRoleFunc             = role.GetRole
	GetAllRolesFunc         = role.GetAllRoles
	DeleteFunc              = role.Delete
	UpdateFunc              = role.Update
)
View Source
var (
	CreateNewSessionFunc     = session.CreateNewSession
	DeleteSessionFunc        = session.DeleteSession
	GetSessionFunc           = session.GetSession
	GetAllActiveSessionsFunc = session.GetAllActiveSessions
	GetSessionServiceFunc    = session.GetSessionService
	GetSessionUserNameFunc   = session.GetSessionUserName
	GetSessionUserRoleIDFunc = session.GetSessionUserRoleID
	MarshalFunc              = json.Marshal
)
View Source
var (
	AuthFunc = auth.Auth
)

Functions

This section is empty.

Types

type Account

type Account struct{}

Account struct helps to register service

func (*Account) Create

Create defines the operations which handles the RPC request response for the create account service of account-session micro service. The functionality retrives the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Account) Delete

Delete defines the operations which handles the RPC request response for the delete of a particular account service of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Account) GetAccount

GetAccount defines the operations which handles the RPC request response for the view of a particular account service of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Account) GetAccountServices

func (a *Account) GetAccountServices(ctx context.Context, req *accountproto.AccountRequest) (*accountproto.AccountResponse, error)

GetAccountServices defines the operations which handles the RPC request response for checking the availability of account-session micro service. The functionality retrives the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Account) GetAllAccounts

GetAllAccounts defines the operations which handles the RPC request response for the list all account service of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Account) Update

Update defines the operations which handles the RPC request response for the update of a particular account service of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

type Auth

type Auth struct{}

Auth struct helps to register service

func (*Auth) IsAuthorized

func (a *Auth) IsAuthorized(ctx context.Context, req *authproto.AuthRequest) (*authproto.AuthResponse, error)

IsAuthorized will accepts the request and send a request to Auth method from session package, if its authorized then respond with the status code.

type Role

type Role struct {
}

Role struct helps to register service

func (*Role) CreateRole

func (r *Role) CreateRole(ctx context.Context, req *roleproto.RoleRequest) (*roleproto.RoleResponse, error)

CreateRole defines the operations which handles the RPC request response for the create role of account-session micro service. The functionality retrives the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Role) DeleteRole

DeleteRole handles the RPC call from the client

func (*Role) GetAllRoles

func (r *Role) GetAllRoles(ctx context.Context, req *roleproto.GetRoleRequest) (*roleproto.RoleResponse, error)

GetAllRoles defines the operations which handles the RPC request response for the list all roles of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Role) GetRole

GetRole defines the operations which handles the RPC request response for the view of a role of account-session micro service. The functionality retrives the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

func (*Role) UpdateRole

UpdateRole defines the operations which handles the RPC request response for the update of a particular role of account-session micro service. The functionality retrieves the request and return backs the response to RPC according to the protoc file defined in the util-lib package. The function also checks for the session time out of the token which is present in the request.

type Session

type Session struct{}

Session struct helps to register service

func (*Session) CreateSession

CreateSession is a rpc call to create session and It will check the credentials of user, if user is authorized then create session for the same

func (*Session) DeleteSession

DeleteSession is a rpc call to delete session It will get all the session tokens from the db and from the session token get the session details if session id is matched with recieved session id ten delete the session

func (*Session) GetAllActiveSessions

func (s *Session) GetAllActiveSessions(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)

GetAllActiveSessions is a rpc call to get all active sessions This method will accepts the sessionrequest which has session id and session token and it will call GetAllActiveSessions from the session package and respond all the sessionresponse values along with error if there is.

func (*Session) GetSession

GetSession is a rpc call to get session It will get all the session tokens from the db and from the session token get the session details if session id is matched with recieved session id then delete the session

func (*Session) GetSessionService

GetSessionService is a rpc call to get session service which basically checks if the session service is enabled or not

func (*Session) GetSessionUserName

func (s *Session) GetSessionUserName(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUserName, error)

GetSessionUserName is a rpc call to get session username It will get all the session username from the session

func (*Session) GetSessionUserRoleID

func (s *Session) GetSessionUserRoleID(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUsersRoleID, error)

GetSessionUserRoleID is a rpc call to get session user's role ID It will get the session username's role id from the session

Jump to

Keyboard shortcuts

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