grafana/pkg/plugins/models.go

58 lines
1.2 KiB
Go
Raw Normal View History

package plugins
import (
"encoding/json"
)
type PluginLoader interface {
Load(decoder *json.Decoder, pluginDir string) error
}
type PluginBase struct {
Type string `json:"type"`
Name string `json:"name"`
Id string `json:"id"`
Info PluginInfo `json:"info"`
IncludedInAppId string `json:"-"`
PluginDir string `json:"-"`
}
type PluginInfo struct {
2016-01-08 13:57:58 -06:00
Author PluginInfoLink `json:"author"`
Description string `json:"description"`
Links []PluginInfoLink `json:"links"`
Logos PluginLogos `json:"logos"`
2016-01-12 08:39:29 -06:00
Version string `json:"version"`
Updated string `json:"updated"`
}
2016-01-08 13:57:58 -06:00
type PluginInfoLink struct {
Name string `json:"name"`
Url string `json:"url"`
}
type PluginLogos struct {
Small string `json:"small"`
Large string `json:"large"`
}
type PluginStaticRoute struct {
Directory string
PluginId string
}
type EnabledPlugins struct {
2015-12-21 16:09:27 -06:00
Panels []*PanelPlugin
DataSources map[string]*DataSourcePlugin
Apps []*AppPlugin
}
func NewEnabledPlugins() EnabledPlugins {
return EnabledPlugins{
2015-12-21 16:09:27 -06:00
Panels: make([]*PanelPlugin, 0),
DataSources: make(map[string]*DataSourcePlugin),
Apps: make([]*AppPlugin, 0),
}
}