grafana/pkg/plugins/panel_plugin.go
Marcus Efraimsson 1a810ebfe4
Plugins: Move backend plugin manager to service (#21474)
Moves backend plugin manager to service instead of
global functions in backendplugin package.

Closes #20053
2020-01-13 20:18:45 +01:00

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
}