rpc

package
v0.0.0-...-695150b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package rpc ...

Package rpc ...

Package rpc ...

Package rpc ...

Index

Constants

This section is empty.

Variables

This section is empty.

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 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) 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 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) GetAccountServices

func (a *Account) GetAccountServices(ctx context.Context, req *accountproto.AccountRequest, resp *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 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) 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 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.

type Auth

type Auth struct{}

Auth struct helps to register service

func (*Auth) IsAuthorized

func (a *Auth) IsAuthorized(ctx context.Context, req *authproto.AuthRequest, resp *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, resp *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

func (r *Role) DeleteRole(ctx context.Context, req *roleproto.DeleteRoleRequest, resp *roleproto.RoleResponse) error

DeleteRole handles the RPC call from the client

func (*Role) GetAllRoles

func (r *Role) GetAllRoles(ctx context.Context, req *roleproto.GetRoleRequest, resp *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 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) GetRole

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

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

func (r *Role) UpdateRole(ctx context.Context, req *roleproto.UpdateRoleRequest, resp *roleproto.RoleResponse) error

UpdateRole defines the operations which handles the RPC request response for the update of a particular 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.

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, resp *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

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

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, resp *sessionproto.SessionUserName) error

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

Jump to

Keyboard shortcuts

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