panel_plugin.go 372 B

123456789101112131415161718192021
  1. package plugins
  2. import "encoding/json"
  3. type PanelPlugin struct {
  4. FrontendPluginBase
  5. SkipDataQuery bool `json:"skipDataQuery"`
  6. }
  7. func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) error {
  8. if err := decoder.Decode(&p); err != nil {
  9. return err
  10. }
  11. if err := p.registerPlugin(pluginDir); err != nil {
  12. return err
  13. }
  14. Panels[p.Id] = p
  15. return nil
  16. }