panel_plugin.go 285 B

123456789101112131415161718
  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. Panels[p.Id] = p
  12. return nil
  13. }