usage.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package types
  2. type UsageMetric string
  3. const (
  4. CPU UsageMetric = "cpu"
  5. Memory UsageMetric = "memory"
  6. Clusters UsageMetric = "clusters"
  7. Users UsageMetric = "users"
  8. )
  9. type ProjectUsage struct {
  10. // The CPU usage, in vCPUs
  11. ResourceCPU uint `json:"resource_cpu"`
  12. // The memory usage, in mibibytes (?)
  13. ResourceMemory uint `json:"resource_memory"`
  14. // The number of clusters
  15. Clusters uint `json:"clusters"`
  16. // The number of users
  17. Users uint `json:"users"`
  18. }
  19. var BasicPlan = ProjectUsage{
  20. ResourceCPU: 10,
  21. // 20 GB converted to Mebibytes
  22. ResourceMemory: 19074,
  23. Clusters: 1,
  24. Users: 1,
  25. }
  26. var TeamPlan = ProjectUsage{
  27. ResourceCPU: 20,
  28. // 40 GB converted to Mebibytes
  29. ResourceMemory: 38148,
  30. Clusters: 3,
  31. Users: 3,
  32. }
  33. var GrowthPlan = ProjectUsage{
  34. ResourceCPU: 80,
  35. // 160 GB converted to Mebibytes
  36. ResourceMemory: 152592,
  37. Clusters: 0,
  38. Users: 5,
  39. }
  40. // all unlimited
  41. var EnterprisePlan = ProjectUsage{
  42. ResourceCPU: 0,
  43. ResourceMemory: 0,
  44. Clusters: 0,
  45. Users: 0,
  46. }
  47. type GetProjectUsageResponse struct {
  48. Current ProjectUsage `json:"current"`
  49. Limit ProjectUsage `json:"limit"`
  50. }