datasource.go 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package models
  2. import "time"
  3. const (
  4. DS_GRAPHITE = "graphite"
  5. DS_INFLUXDB = "influxdb"
  6. DS_ES = "es"
  7. DS_ACCESS_DIRECT = "direct"
  8. DS_ACCESS_PROXY = "proxy"
  9. )
  10. type DsType string
  11. type DsAccess string
  12. type DataSource struct {
  13. Id int64
  14. AccountId int64
  15. Name string
  16. Type DsType
  17. Access DsAccess
  18. Url string
  19. Password string
  20. User string
  21. BasicAuth bool
  22. Created time.Time
  23. Updated time.Time
  24. }
  25. type GetDataSourcesQuery struct {
  26. AccountId int64
  27. Result []*DataSource
  28. }
  29. type AddDataSourceCommand struct {
  30. AccountId int64
  31. Name string
  32. Type DsType
  33. Access DsAccess
  34. Url string
  35. Password string
  36. User string
  37. }
  38. type UpdateDataSourceCommand struct {
  39. Id int64
  40. AccountId int64
  41. Name string
  42. Type DsType
  43. Access DsAccess
  44. Url string
  45. Password string
  46. User string
  47. }
  48. type DeleteDataSourceCommand struct {
  49. Id int64
  50. AccountId int64
  51. }