mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 19:00:54 -06:00
27 lines
565 B
Go
27 lines
565 B
Go
package plugins
|
|
|
|
import "encoding/json"
|
|
|
|
type DataSourcePlugin struct {
|
|
FrontendPluginBase
|
|
Annotations bool `json:"annotations"`
|
|
Metrics bool `json:"metrics"`
|
|
Alerting bool `json:"alerting"`
|
|
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
|
|
}
|