models.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. }
  14. type ExternalPluginRoute struct {
  15. Path string `json:"path"`
  16. Method string `json:"method"`
  17. ReqSignedIn bool `json:"req_signed_in"`
  18. ReqGrafanaAdmin bool `json:"req_grafana_admin"`
  19. ReqRole models.RoleType `json:"req_role"`
  20. Url string `json:"url"`
  21. }
  22. type ExternalPluginJs struct {
  23. Src string `json:"src"`
  24. }
  25. type ExternalPluginMenuItem struct {
  26. Text string `json:"text"`
  27. Icon string `json:"icon"`
  28. Href string `json:"href"`
  29. }
  30. type ExternalPluginCss struct {
  31. Href string `json:"href"`
  32. }
  33. type ExternalPluginSettings struct {
  34. Routes []*ExternalPluginRoute `json:"routes"`
  35. Js []*ExternalPluginJs `json:"js"`
  36. Css []*ExternalPluginCss `json:"css"`
  37. MenuItems []*ExternalPluginMenuItem `json:"menu_items"`
  38. }
  39. type ExternalPlugin struct {
  40. PluginType string `json:"pluginType"`
  41. Settings ExternalPluginSettings `json:"settings"`
  42. }