mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 16:57:14 -06:00
1a810ebfe4
Moves backend plugin manager to service instead of global functions in backendplugin package. Closes #20053
26 lines
477 B
Go
26 lines
477 B
Go
package plugins
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
|
)
|
|
|
|
type PanelPlugin struct {
|
|
FrontendPluginBase
|
|
SkipDataQuery bool `json:"skipDataQuery"`
|
|
}
|
|
|
|
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string, backendPluginManager backendplugin.Manager) error {
|
|
if err := decoder.Decode(p); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := p.registerPlugin(pluginDir); err != nil {
|
|
return err
|
|
}
|
|
|
|
Panels[p.Id] = p
|
|
return nil
|
|
}
|