Merge branch 'master' of github.com:Akilan1999/p2p-rendering-computation into plugin-auto

This commit is contained in:
2021-10-24 23:36:32 +04:00
15 changed files with 341 additions and 11 deletions

View File

@@ -108,6 +108,24 @@ func DetectPlugins()(*Plugins,error){
return plugins,nil
}
// SearchPlugin Detects plugin information based on the
// name provided on the parameter
func SearchPlugin(pluginname string) (*Plugin,error) {
plugins, err := DetectPlugins()
if err != nil {
return nil, err
}
// loop ot find the plugin name that matches
for _, plugin := range plugins.PluginsDetected {
if pluginname == plugin.FolderName {
return plugin, nil
}
}
return nil, errors.New("plugin not detected")
}
// RunPlugin Executes plugins based on the plugin name provided
func RunPlugin(pluginName string ,IPAddresses []*ExecuteIP) (*Plugin,error) {
plugins, err := DetectPlugins()