models.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package plugins
  2. import "github.com/grafana/grafana/pkg/models"
  3. type DataSourcePlugin struct {
  4. Type string `json:"type"`
  5. Name string `json:"name"`
  6. ServiceName string `json:"serviceName"`
  7. Module string `json:"module"`
  8. Partials map[string]interface{} `json:"partials"`
  9. DefaultMatchFormat string `json:"defaultMatchFormat"`
  10. Annotations bool `json:"annotations"`
  11. Metrics bool `json:"metrics"`
  12. BuiltIn bool `json:"builtIn"`
  13. StaticRootConfig *StaticRootConfig `json:"staticRoot"`
  14. }
  15. type PanelPlugin struct {
  16. Type string `json:"type"`
  17. Name string `json:"name"`
  18. Module string `json:"module"`
  19. StaticRootConfig *StaticRootConfig `json:"staticRoot"`
  20. }
  21. type StaticRootConfig struct {
  22. Url string `json:"url"`
  23. Path string `json:"path"`
  24. }
  25. type ExternalPluginRoute struct {
  26. Path string `json:"path"`
  27. Method string `json:"method"`
  28. ReqSignedIn bool `json:"reqSignedIn"`
  29. ReqGrafanaAdmin bool `json:"reqGrafanaAdmin"`
  30. ReqRole models.RoleType `json:"reqRole"`
  31. Url string `json:"url"`
  32. }
  33. type ExternalPluginJs struct {
  34. Module string `json:"module"`
  35. }
  36. type ExternalPluginNavLink struct {
  37. Text string `json:"text"`
  38. Icon string `json:"icon"`
  39. Href string `json:"href"`
  40. }
  41. type ExternalPluginCss struct {
  42. Href string `json:"href"`
  43. }
  44. type ExternalPlugin struct {
  45. Type string `json:"type"`
  46. Routes []*ExternalPluginRoute `json:"routes"`
  47. Js []*ExternalPluginJs `json:"js"`
  48. Css []*ExternalPluginCss `json:"css"`
  49. MainNavLinks []*ExternalPluginNavLink `json:"mainNavLinks"`
  50. StaticRootConfig *StaticRootConfig `json:"staticRoot"`
  51. }