models.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. Directive string `json:"Directive"`
  36. }
  37. type ExternalPluginNavLink struct {
  38. Text string `json:"text"`
  39. Icon string `json:"icon"`
  40. Href string `json:"href"`
  41. ReqRole models.RoleType `json:"reqRole"`
  42. }
  43. type ExternalPluginCss struct {
  44. Light string `json:"light"`
  45. Dark string `json:"dark"`
  46. }
  47. type ExternalPlugin struct {
  48. Type string `json:"type"`
  49. Routes []*ExternalPluginRoute `json:"routes"`
  50. Js []*ExternalPluginJs `json:"js"`
  51. Css []*ExternalPluginCss `json:"css"`
  52. MainNavLinks []*ExternalPluginNavLink `json:"mainNavLinks"`
  53. StaticRootConfig *StaticRootConfig `json:"staticRoot"`
  54. }