Files
grafana/pkg/plugins/panel_plugin.go
T
Marcus Efraimsson bb849d53bf Backend Plugins: Refactor backend plugin registration and start (#21452)
Moves the details of loading plugins into the backend
plugin manager from the respective plugin (datasource,
transform and renderer).
2020-01-13 17:13:17 +01:00

22 lines
371 B
Go

package plugins
import "encoding/json"
type PanelPlugin struct {
FrontendPluginBase
SkipDataQuery bool `json:"skipDataQuery"`
}
func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) 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
}