models.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 StaticRootConfig struct {
  16. Url string `json:"url"`
  17. Path string `json:"path"`
  18. }
  19. type ExternalPluginRoute struct {
  20. Path string `json:"path"`
  21. Method string `json:"method"`
  22. ReqSignedIn bool `json:"reqSignedIn"`
  23. ReqGrafanaAdmin bool `json:"reqGrafanaAdmin"`
  24. ReqRole models.RoleType `json:"reqRole"`
  25. Url string `json:"url"`
  26. }
  27. type ExternalPluginJs struct {
  28. Module string `json:"module"`
  29. }
  30. type ExternalPluginMenuItem struct {
  31. Text string `json:"text"`
  32. Icon string `json:"icon"`
  33. Href string `json:"href"`
  34. }
  35. type ExternalPluginCss struct {
  36. Href string `json:"href"`
  37. }
  38. type ExternalPlugin struct {
  39. Routes []*ExternalPluginRoute `json:"routes"`
  40. Js []*ExternalPluginJs `json:"js"`
  41. Css []*ExternalPluginCss `json:"css"`
  42. MenuItems []*ExternalPluginMenuItem `json:"menuItems"`
  43. StaticRootConfig *StaticRootConfig `json:"staticRoot"`
  44. }