| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package plugins
- import (
- "github.com/grafana/grafana/pkg/models"
- )
- type DataSourcePlugin struct {
- Type string `json:"type"`
- Name string `json:"name"`
- ServiceName string `json:"serviceName"`
- Module string `json:"module"`
- Partials map[string]interface{} `json:"partials"`
- DefaultMatchFormat string `json:"defaultMatchFormat"`
- Annotations bool `json:"annotations"`
- Metrics bool `json:"metrics"`
- BuiltIn bool `json:"builtIn"`
- App string `json:"app"`
- PublicContent *PublicContent `json:"public"`
- }
- type PanelPlugin struct {
- Type string `json:"type"`
- Name string `json:"name"`
- Module string `json:"module"`
- PublicContent *PublicContent `json:"public"`
- App string `json:"app"`
- }
- type PublicContent struct {
- UrlFragment string `json:"urlFragment"`
- Dir string `json:"dir"`
- }
- type ApiPluginRoute struct {
- Path string `json:"path"`
- Method string `json:"method"`
- ReqSignedIn bool `json:"reqSignedIn"`
- ReqGrafanaAdmin bool `json:"reqGrafanaAdmin"`
- ReqRole models.RoleType `json:"reqRole"`
- Url string `json:"url"`
- App string `json:"app"`
- }
- type AppPluginPage struct {
- Text string `json:"text"`
- Icon string `json:"icon"`
- Url string `json:"url"`
- ReqRole models.RoleType `json:"reqRole"`
- }
- type AppPluginCss struct {
- Light string `json:"light"`
- Dark string `json:"dark"`
- }
- type ApiPlugin struct {
- Type string `json:"type"`
- Routes []*ApiPluginRoute `json:"routes"`
- App string `json:"app"`
- }
- type AppPlugin struct {
- Type string `json:"type"`
- Enabled bool `json:"enabled"`
- Pinned bool `json:"pinned"`
- Module string `json:"module"`
- Css *AppPluginCss `json:"css"`
- Page *AppPluginPage `json:"page"`
- PublicContent *PublicContent `json:"public"`
- }
- type EnabledPlugins struct {
- Panels []*PanelPlugin
- DataSources map[string]*DataSourcePlugin
- ApiList []*ApiPlugin
- Apps []*AppPlugin
- }
- func NewEnabledPlugins() EnabledPlugins {
- return EnabledPlugins{
- Panels: make([]*PanelPlugin, 0),
- DataSources: make(map[string]*DataSourcePlugin),
- ApiList: make([]*ApiPlugin, 0),
- Apps: make([]*AppPlugin, 0),
- }
- }
|