panel_plugin.go 309 B

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