Documentation
¶
Overview ¶
Package account ...
Package account ...
Package account ...
Package account ...
Index ¶
- func Create(req *accountproto.CreateAccountRequest, session *asmodel.Session) (response.RPC, error)
- func Delete(session *asmodel.Session, accountID string) response.RPC
- func GetAccount(session *asmodel.Session, accountID string) response.RPC
- func GetAccountService() response.RPC
- func GetAllAccounts(session *asmodel.Session) response.RPC
- func Update(req *accountproto.UpdateAccountRequest, session *asmodel.Session) response.RPC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(req *accountproto.CreateAccountRequest, session *asmodel.Session) (response.RPC, error)
Create defines creation of a new account. The function is supposed to be used as part of RPC.
For creating an account, two parameters need to be passed CreateAccountRequest and Session. New account UserName, Password and RoleId will be part of CreateAccountRequest, and Session parameter will have all session related data, espically the privileges. For creating new account the ConfigureUsers privilege is mandatory.
There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.
func Delete ¶
Delete defines deletion of an existing account.
Two parameters need to be passed to the function which are the Session, which contains all the session related data, espically the ConfigureUsers privilege and the accountID which is used for identifing the account to be deleted.
As return parameters RPC response, which contains status code, message, headers and data, error will be passed back.
func GetAccount ¶
GetAccount defines the viewing of a particular account which is identified by the account id.
As input parameters we need to pass Session, which contains all session data especially configureUsers privilege and the accountID which is used to identify the account which is supposed to be viewed.
As return parameters RPC response, which contains status code, message, headers and data, error will be passed back.
func GetAccountService ¶
GetAccountService defines the functionality for knowing whether the account service is enabled or not
As return parameters RPC response, which contains status code, message, headers and data, error will be passed back.
func GetAllAccounts ¶
GetAllAccounts defines the admin functionality of listing of all accounts.
As input parameters we need to pass Session, which contains all session data especially configureUsers privilege.
As return parameters RPC response, which contains status code, message, headers and data, error will be passed back.
func Update ¶
func Update(req *accountproto.UpdateAccountRequest, session *asmodel.Session) response.RPC
Update defines the updation of the account details. Every account details can be updated other than the UserName if the session parameter have sufficient privileges.
For updating an account, two parameters need to be passed UpdateAccountRequest and Session. New Password and RoleId will be part of UpdateAccountRequest, and Session parameter will have all session related data, espically the privileges.
Output is the RPC response, which contains the status code, status message, headers and body.
Types ¶
This section is empty.