Documentation ¶
Overview ¶
Package tcommon ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ConfigFilePath holds the value of odim config file path ConfigFilePath string )
Functions ¶
func GetPluginStatus ¶
GetPluginStatus checks the status of given plugin in configured interval
func GetResourceInfoFromDevice ¶
func GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest) ([]byte, error)
GetResourceInfoFromDevice will contact to the southbound client and gets the Particular resource info from device
func TrackConfigFileChanges ¶
func TrackConfigFileChanges(errChan chan error)
TrackConfigFileChanges monitors the host file using fsnotfiy
Types ¶
type PluginContactRequest ¶
type PluginContactRequest struct { Token string OID string DeviceInfo interface{} BasicAuth map[string]string ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) GetPluginStatus func(context.Context, tmodel.Plugin) bool Plugin tmodel.Plugin HTTPMethodType string }
PluginContactRequest hold the request of contact plugin
type ResourceInfoRequest ¶
type ResourceInfoRequest struct { URL string ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) DevicePassword func([]byte) ([]byte, error) GetPluginStatus func(context.Context, tmodel.Plugin) bool ResourceName string GetAllKeysFromTable func(context.Context, string, common.DbType) ([]string, error) GetPluginData func(string) (tmodel.Plugin, *errors.Error) GetResource func(context.Context, string, string, common.DbType) (string, *errors.Error) GenericSave func(context.Context, []byte, string, string) error }
ResourceInfoRequest hold the request of getting Resource
type ResponseStatus ¶
ResponseStatus holds the response of Contact Plugin
func ContactPlugin ¶
func ContactPlugin(ctx context.Context, req PluginContactRequest, errorMessage string) ([]byte, string, ResponseStatus, error)
ContactPlugin is commons which handles the request and response of Contact Plugin usage
Click to show internal directories.
Click to hide internal directories.