Documentation ¶
Overview ¶
Package account ...
Package account ...
Package account ...
Package account ...
Index ¶
- Variables
- func Delete(ctx context.Context, session *asmodel.Session, accountID string) response.RPC
- func GetAccount(ctx context.Context, session *asmodel.Session, accountID string) response.RPC
- func GetAccountService(ctx context.Context) response.RPC
- func GetAllAccounts(ctx context.Context, session *asmodel.Session) response.RPC
- func TrackConfigFileChanges(errChan chan error)
- type ExternalInterface
Constants ¶
This section is empty.
Variables ¶
var ( // ConfigFilePath holds the value of odim config file path ConfigFilePath string )
Functions ¶
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 TrackConfigFileChanges ¶
func TrackConfigFileChanges(errChan chan error)
Types ¶
type ExternalInterface ¶
type ExternalInterface struct { CreateUser func(asmodel.User) *errors.Error GetUserDetails func(string) (asmodel.User, *errors.Error) GetRoleDetailsByID func(string) (asmodel.Role, *errors.Error) UpdateUserDetails func(asmodel.User, asmodel.User) *errors.Error }
ExternalInterface holds all the external connections account package functions uses
func GetExternalInterface ¶
func GetExternalInterface() *ExternalInterface
GetExternalInterface retrieves all the external connections account package functions uses
func (*ExternalInterface) Create ¶
func (e *ExternalInterface) Create(ctx context.Context, 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 (*ExternalInterface) Update ¶
func (e *ExternalInterface) Update(ctx context.Context, 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.