account

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

Documentation

Overview

Package account ...

Package account ...

Package account ...

Package account ...

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfigFilePath holds the value of odim config file path
	ConfigFilePath string
)

Functions

func Delete

func Delete(ctx context.Context, session *asmodel.Session, accountID string) response.RPC

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

func GetAccount(ctx context.Context, session *asmodel.Session, accountID string) response.RPC

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

func GetAccountService(ctx context.Context) response.RPC

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

func GetAllAccounts(ctx context.Context, session *asmodel.Session) response.RPC

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

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

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.

Jump to

Keyboard shortcuts

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