grafana/pkg/plugins/panel_plugin.go
Arve Knudsen 531c579341
Plugins: Let descendant plugins inherit their root's signature (#27970)
* plugins: Let descendant plugins inherit their root's signature

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-05 13:28:18 +02:00

26 lines
472 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, base *PluginBase, backendPluginManager backendplugin.Manager) error {
if err := decoder.Decode(p); err != nil {
return err
}
if err := p.registerPlugin(base); err != nil {
return err
}
Panels[p.Id] = p
return nil
}