Documentation ¶
Overview ¶
Package rpc ...
Package rpc ...
Package rpc ...
Package rpc ...
Index ¶
- Variables
- type Account
- func (a *Account) Create(ctx context.Context, req *accountproto.CreateAccountRequest) (*accountproto.AccountResponse, error)
- func (a *Account) Delete(ctx context.Context, req *accountproto.DeleteAccountRequest) (*accountproto.AccountResponse, error)
- func (a *Account) GetAccount(ctx context.Context, req *accountproto.GetAccountRequest) (*accountproto.AccountResponse, error)
- func (a *Account) GetAccountServices(ctx context.Context, req *accountproto.AccountRequest) (*accountproto.AccountResponse, error)
- func (a *Account) GetAllAccounts(ctx context.Context, req *accountproto.AccountRequest) (*accountproto.AccountResponse, error)
- func (a *Account) Update(ctx context.Context, req *accountproto.UpdateAccountRequest) (*accountproto.AccountResponse, error)
- type Auth
- type Role
- func (r *Role) CreateRole(ctx context.Context, req *roleproto.RoleRequest) (*roleproto.RoleResponse, error)
- func (r *Role) DeleteRole(ctx context.Context, req *roleproto.DeleteRoleRequest) (*roleproto.RoleResponse, error)
- func (r *Role) GetAllRoles(ctx context.Context, req *roleproto.GetRoleRequest) (*roleproto.RoleResponse, error)
- func (r *Role) GetRole(ctx context.Context, req *roleproto.GetRoleRequest) (*roleproto.RoleResponse, error)
- func (r *Role) UpdateRole(ctx context.Context, req *roleproto.UpdateRoleRequest) (*roleproto.RoleResponse, error)
- type Session
- func (s *Session) CreateSession(ctx context.Context, req *sessionproto.SessionCreateRequest) (*sessionproto.SessionCreateResponse, error)
- func (s *Session) DeleteSession(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
- func (s *Session) GetAllActiveSessions(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
- func (s *Session) GetSession(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
- func (s *Session) GetSessionService(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
- func (s *Session) GetSessionUserName(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUserName, error)
- func (s *Session) GetSessionUserRoleID(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionUsersRoleID, error)
Constants ¶
This section is empty.
Variables ¶
var ( GetAllAccountsFunc = account.GetAllAccounts GetAccountFunc = account.GetAccount GetAccountServiceFunc = account.GetAccountService AccDeleteFunc = account.Delete )
var ( CheckSessionTimeOutFunc = auth.CheckSessionTimeOut UpdateLastUsedTimeFunc = session.UpdateLastUsedTime CreateFunc = role.Create GetRoleFunc = role.GetRole GetAllRolesFunc = role.GetAllRoles DeleteFunc = role.Delete UpdateFunc = role.Update )
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 )
var (
AuthFunc = auth.Auth
)
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct{}
Account struct helps to register service
func (*Account) Create ¶
func (a *Account) Create(ctx context.Context, req *accountproto.CreateAccountRequest) (*accountproto.AccountResponse, error)
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 ¶
func (a *Account) Delete(ctx context.Context, req *accountproto.DeleteAccountRequest) (*accountproto.AccountResponse, error)
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 ¶
func (a *Account) GetAccount(ctx context.Context, req *accountproto.GetAccountRequest) (*accountproto.AccountResponse, error)
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 ¶
func (a *Account) GetAllAccounts(ctx context.Context, req *accountproto.AccountRequest) (*accountproto.AccountResponse, error)
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 ¶
func (a *Account) Update(ctx context.Context, req *accountproto.UpdateAccountRequest) (*accountproto.AccountResponse, error)
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 ¶
func (r *Role) DeleteRole(ctx context.Context, req *roleproto.DeleteRoleRequest) (*roleproto.RoleResponse, error)
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 ¶
func (r *Role) GetRole(ctx context.Context, req *roleproto.GetRoleRequest) (*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) (*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 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 ¶
func (s *Session) CreateSession(ctx context.Context, req *sessionproto.SessionCreateRequest) (*sessionproto.SessionCreateResponse, error)
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 ¶
func (s *Session) DeleteSession(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
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 ¶
func (s *Session) GetSession(ctx context.Context, req *sessionproto.SessionRequest) (*sessionproto.SessionResponse, error)
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) (*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) (*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