Documentation ¶
Overview ¶
Package ucommon ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CallPluginFunc function pointer for calling the plugin CallPluginFunc = callPlugin // IOUtilReadAllFunc function pointer for calling the files IOUtilReadAllFunc = ioutil.ReadAll )
View Source
var ( // ConfigFilePath holds the value of odim config file path ConfigFilePath string )
Functions ¶
func TrackConfigFileChanges ¶
func TrackConfigFileChanges(errChan chan error)
Types ¶
type CommonInterface ¶
type CommonInterface struct { GetTarget func(string) (*umodel.Target, *errors.Error) GetPluginData func(string) (umodel.Plugin, *errors.Error) ContactPlugin func(context.Context, PluginContactRequest, string) ([]byte, string, ResponseStatus, error) }
CommonInterface holds the pointers for functions with DB opearations
func (*CommonInterface) GetResourceInfoFromDevice ¶
func (i *CommonInterface) GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest) (string, error)
GetResourceInfoFromDevice will contact to the and gets the Particual resource info from device
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) PostBody interface{} Plugin umodel.Plugin HTTPMethodType string }
PluginContactRequest hold the request of contact plugin
type ResourceInfoRequest ¶
type ResourceInfoRequest struct { URL string UUID string SystemID string ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) DevicePassword func([]byte) ([]byte, error) ResourceName string }
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.