grafana/pkg/plugins/datasource_plugin.go

27 lines
565 B
Go
Raw Normal View History

package plugins
import "encoding/json"
type DataSourcePlugin struct {
FrontendPluginBase
2016-03-08 11:17:47 -06:00
Annotations bool `json:"annotations"`
Metrics bool `json:"metrics"`
Alerting bool `json:"alerting"`
2016-03-08 11:17:47 -06:00
BuiltIn bool `json:"builtIn"`
Mixed bool `json:"mixed"`
App string `json:"app"`
}
func (p *DataSourcePlugin) 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
}
DataSources[p.Id] = p
return nil
}