Documentation ¶
Overview ¶
Package evcommon ...
Package evcommon ...
Index ¶
- Variables
- func GenErrorResponse(errorMessage string, statusMessage string, httpStatusCode int32, ...)
- func GenEventErrorResponse(errorMessage string, StatusMessage string, httpStatusCode int, ...)
- func GetEncryptedKey(key []byte) ([]byte, error)
- func GetPluginStatus(ctx context.Context, plugin *common.Plugin) bool
- func GetSearchKey(key, index string) string
- func MockContactClient(ctx context.Context, url, method, token string, odataID string, ...) (*http.Response, error)
- func MockContext() context.Context
- func MockCreateChildTask(ctx context.Context, sessionID, taskid string) (string, error)
- func MockCreateTask(ctx context.Context, sessionusername string) (string, error)
- func MockDeleteDeviceSubscription(hostIP string) error
- func MockDeleteEvtSubscription(key string) error
- func MockDeleteUndeliveredEvents(destination string) error
- func MockDeleteUndeliveredEventsFlag(destination string) error
- func MockGetAggregateDatacData(aggregateID string) (evmodel.Aggregate, error)
- func MockGetAggregateHosts(aggregateIP string) ([]string, error)
- func MockGetAllFabrics() ([]string, error)
- func MockGetAllKeysFromTable(table string) ([]string, error)
- func MockGetAllMatchingDetails(table, pattern string, dbtype common.DbType) ([]string, *errors.Error)
- func MockGetAllSystems() ([]string, error)
- func MockGetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
- func MockGetEvtSubscriptions(searchKey string) ([]evmodel.SubscriptionResource, error)
- func MockGetFabricData(fabricID string) (evmodel.Fabric, error)
- func MockGetPluginData(pluginID string) (*common.Plugin, *errors.Error)
- func MockGetSessionUserName(ctx context.Context, sessionToken string) (string, error)
- func MockGetSingleSystem(id string) (string, error)
- func MockGetTarget(uuid string) (*common.Target, error)
- func MockGetUndeliveredEvents(destination string) (string, error)
- func MockGetUndeliveredEventsFlag(destination string) (bool, error)
- func MockGetUndeliveredEventsKeyList(table, pattern string, dbtype common.DbType, nextCursor int) ([]string, int, *errors.Error)
- func MockIsAuthorized(ctx context.Context, sessionToken string, privileges, oemPrivileges []string) (response.RPC, error)
- func MockSaveAggregateSubscription(aggregateID string, hostIP []string) error
- func MockSaveDeviceSubscription(common.DeviceSubscription) error
- func MockSaveEventSubscription(evtSubscription evmodel.SubscriptionResource) error
- func MockSaveUndeliveredEvents(key string, event []byte) error
- func MockSetUndeliveredEventsFlag(destination string) error
- func MockUpdateDeviceSubscriptionLocation(devSubscription common.DeviceSubscription) error
- func MockUpdateEventSubscription(evtSubscription evmodel.SubscriptionResource) error
- func MockUpdateTask(context context.Context, task common.TaskData) error
- func ProcessCtrlMsg(ctx context.Context, data interface{}) bool
- func TrackConfigFileChanges(ctx context.Context, errChan chan error)
- type EmbTopic
- type PluginContactRequest
- type PluginToken
- type SavedSystems
- type StartUpInterface
- type StartUpMap
Constants ¶
This section is empty.
Variables ¶
var ( DefaultSubscriptionID = "0" SubscriptionChannelKey = "__key*__:Subscription" DeviceSubscriptionChannelKey = "__key*__:DeviceSubscription" AggregateToHostChannelKey = "__key*__:AggregateToHost" RedisNotifierType = "notify-keyspace-events" RedisNotifierFilterKey = "Kz" )
global variables
var ( //GetAllPluginsFunc is pointer function evmodel.GetAllPlugins GetAllPluginsFunc = evmodel.GetAllPlugins // ConfigFilePath holds the value of odim config file path ConfigFilePath string )
var PluginStartUp = false
PluginStartUp is used to call plugin "Startup" only on plugin restart and not on every status check
Functions ¶
func GenErrorResponse ¶
func GenErrorResponse(errorMessage string, statusMessage string, httpStatusCode int32, msgArgs []interface{}, respPtr *response.RPC)
GenErrorResponse generates the error response in event service
func GenEventErrorResponse ¶
func GenEventErrorResponse(errorMessage string, StatusMessage string, httpStatusCode int, respPtr *evresponse.EventResponse, argsParams []interface{})
GenEventErrorResponse generates the error response in event service
func GetEncryptedKey ¶
GetEncryptedKey is for mocking up of getting encrypted key
func GetPluginStatus ¶
GetPluginStatus checks the status of given plugin in configured interval
func GetSearchKey ¶
GetSearchKey will return search key with regular expression for filtering
func MockContactClient ¶
func MockContactClient(ctx context.Context, url, method, token string, odataID string, body interface{}, credentials map[string]string) (*http.Response, error)
MockContactClient is for mocking up of contacting client
func MockCreateChildTask ¶
MockCreateChildTask is for mocking up of crete child task
func MockCreateTask ¶
MockCreateTask is for mocking up of crete task
func MockDeleteDeviceSubscription ¶
MockDeleteDeviceSubscription is for mocking up of delete device subscription
func MockDeleteEvtSubscription ¶
MockDeleteEvtSubscription is for mocking up of delete event subscription
func MockDeleteUndeliveredEvents ¶
MockDeleteUndeliveredEvents is for mocking up of deleting undelivered events
func MockDeleteUndeliveredEventsFlag ¶
MockDeleteUndeliveredEventsFlag is for mocking up of deleting undelivered events flag
func MockGetAggregateDatacData ¶
MockGetAggregateDatacData is for mocking up of get aggregate data against the aggregate id
func MockGetAggregateHosts ¶
MockGetAggregateHosts is for mocking up of get all matching details from the given table
func MockGetAllFabrics ¶
MockGetAllFabrics is for mocking up of get all fabric details
func MockGetAllKeysFromTable ¶
MockGetAllKeysFromTable is for mocking up of get all keys from the given table
func MockGetAllMatchingDetails ¶
func MockGetAllMatchingDetails(table, pattern string, dbtype common.DbType) ([]string, *errors.Error)
MockGetAllMatchingDetails is for mocking up of get all matching details from the given table
func MockGetAllSystems ¶
MockGetAllSystems is for mocking up of get all system info
func MockGetDeviceSubscriptions ¶
func MockGetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
MockGetDeviceSubscriptions is for mocking up of get device subscription
func MockGetEvtSubscriptions ¶
func MockGetEvtSubscriptions(searchKey string) ([]evmodel.SubscriptionResource, error)
MockGetEvtSubscriptions is for mocking up of get event subscription
func MockGetFabricData ¶
MockGetFabricData is for mocking up of get fabric data against the fabric id
func MockGetPluginData ¶
MockGetPluginData is for mocking up of get plugin data of particural plugin id
func MockGetSessionUserName ¶
MockGetSessionUserName is for mocking up of session user name
func MockGetSingleSystem ¶
MockGetSingleSystem is for mocking up of get system info
func MockGetTarget ¶
MockGetTarget is for mocking up of getting target info
func MockGetUndeliveredEvents ¶
MockGetUndeliveredEvents is for mocking up of get undelivered events
func MockGetUndeliveredEventsFlag ¶
MockGetUndeliveredEventsFlag is for mocking up of getting undelivered events flag
func MockGetUndeliveredEventsKeyList ¶
func MockGetUndeliveredEventsKeyList(table, pattern string, dbtype common.DbType, nextCursor int) ([]string, int, *errors.Error)
MockGetUndeliveredEventsKeyList is for mocking up of get all matching details from the given table
func MockIsAuthorized ¶
func MockIsAuthorized(ctx context.Context, sessionToken string, privileges, oemPrivileges []string) (response.RPC, error)
MockIsAuthorized is for mocking up of authorization
func MockSaveAggregateSubscription ¶
MockSaveAggregateSubscription is for mocking up of get all matching details from the given table
func MockSaveDeviceSubscription ¶
func MockSaveDeviceSubscription(common.DeviceSubscription) error
MockSaveDeviceSubscription is for mocking up of save undelivered events
func MockSaveEventSubscription ¶
func MockSaveEventSubscription(evtSubscription evmodel.SubscriptionResource) error
MockSaveEventSubscription is for mocking up of save event subscription
func MockSaveUndeliveredEvents ¶
MockSaveUndeliveredEvents is for mocking up of save undelivered events
func MockSetUndeliveredEventsFlag ¶
MockSetUndeliveredEventsFlag is for mocking up of setting undelivered events flag
func MockUpdateDeviceSubscriptionLocation ¶
func MockUpdateDeviceSubscriptionLocation(devSubscription common.DeviceSubscription) error
MockUpdateDeviceSubscriptionLocation is for mocking up of updating device subscription based on location
func MockUpdateEventSubscription ¶
func MockUpdateEventSubscription(evtSubscription evmodel.SubscriptionResource) error
MockUpdateEventSubscription is for mocking up of update event subscription
func MockUpdateTask ¶
MockUpdateTask is for mocking up of update task
func ProcessCtrlMsg ¶
ProcessCtrlMsg is for processing the ODIM control message and to perform required action
func TrackConfigFileChanges ¶
TrackConfigFileChanges monitors the config changes using fsnotfiy
Types ¶
type EmbTopic ¶
type EmbTopic struct { TopicsList map[string]bool EMBConsume func(context.Context, string) // contains filtered or unexported fields }
EmbTopic hold the list all consuming topics after
var EMBTopics EmbTopic
EMBTopics used to store the list of all topics
type PluginContactRequest ¶
type PluginContactRequest struct { URL string HTTPMethodType string ContactClient func(string, string, string, string, interface{}, map[string]string) (*http.Response, error) PostBody interface{} LoginCredential map[string]string Token string Plugin *common.Plugin }
PluginContactRequest holds the details required to contact the plugin
type PluginToken ¶
PluginToken interface to hold the token
var Token PluginToken
Token variable hold the all the XAuthToken against the plguin ID
func (*PluginToken) GetToken ¶
func (p *PluginToken) GetToken(pluginID string) string
GetToken to get the token from map
func (*PluginToken) StoreToken ¶
func (p *PluginToken) StoreToken(plguinID, token string)
StoreToken to store the token ioto the map
type SavedSystems ¶
type SavedSystems struct { ManagerAddress string Password []byte UserName string DeviceUUID string PluginID string }
SavedSystems holds the resource details of the saved system
type StartUpInterface ¶
type StartUpInterface struct { DecryptPassword func([]byte) ([]byte, error) EMBConsume func(context.Context, string) GetAllPlugins func() ([]common.Plugin, *errors.Error) GetAllSystems func() ([]string, error) GetSingleSystem func(string) (string, error) GetPluginData func(string) (*common.Plugin, *errors.Error) GetEvtSubscriptions func(string) ([]evmodel.SubscriptionResource, error) GetDeviceSubscriptions func(string) (*common.DeviceSubscription, error) UpdateDeviceSubscriptionLocation func(common.DeviceSubscription) error }
StartUpInterface Holds the function pointer of external interface functions
func (*StartUpInterface) GetAllPluginStatus ¶
func (st *StartUpInterface) GetAllPluginStatus(ctx context.Context)
GetAllPluginStatus ...
func (*StartUpInterface) SubscribePluginEMB ¶
func (st *StartUpInterface) SubscribePluginEMB(ctx context.Context)
SubscribePluginEMB is for subscribing to plugin EMB
type StartUpMap ¶
type StartUpMap struct { Location string EventTypes []string Device SavedSystems }
StartUpMap holds required data for plugin startup