Add support for sending health check to datasource plugins. (#22771)

closes #21519
ref grafana/grafana-plugin-sdk-go#93
This commit is contained in:
Carl Bergquist
2020-03-13 12:31:44 +01:00
committed by GitHub
parent 2693f44a03
commit ebc9549cbc
17 changed files with 890 additions and 46 deletions

View File

@ -188,6 +188,15 @@ func (pm *PluginManager) scan(pluginDir string) error {
return nil
}
// GetDatasource returns a datasource based on passed pluginID if it exists
//
// This function fetches the datasource from the global variable DataSources in this package.
// Rather then refactor all dependencies on the global variable we can use this as an transition.
func (pm *PluginManager) GetDatasource(pluginID string) (*DataSourcePlugin, bool) {
ds, exist := DataSources[pluginID]
return ds, exist
}
func (scanner *PluginScanner) walker(currentPath string, f os.FileInfo, err error) error {
// We scan all the subfolders for plugin.json (with some exceptions) so that we also load embedded plugins, for
// example https://github.com/raintank/worldping-app/tree/master/dist/grafana-worldmap-panel worldmap panel plugin