fields.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package allocation
  2. // AllocationField is an enum that represents Allocation-specific fields that can be
  3. // filtered on (namespace, label, etc.)
  4. type AllocationField string
  5. // If you add a AllocationFilterField, make sure to update field maps to return the correct
  6. // Allocation value
  7. // does not enforce exhaustive pattern matching on "enum" types.
  8. const (
  9. AllocationFieldClusterID AllocationField = "cluster"
  10. AllocationFieldNode AllocationField = "node"
  11. AllocationFieldNamespace AllocationField = "namespace"
  12. AllocationFieldControllerKind AllocationField = "controllerKind"
  13. AllocationFieldControllerName AllocationField = "controllerName"
  14. AllocationFieldPod AllocationField = "pod"
  15. AllocationFieldContainer AllocationField = "container"
  16. AllocationFieldProvider AllocationField = "provider"
  17. AllocationFieldServices AllocationField = "services"
  18. AllocationFieldLabel AllocationField = "label"
  19. AllocationFieldAnnotation AllocationField = "annotation"
  20. )
  21. // AllocationAlias represents an alias field type for allocations.
  22. // Filtering based on label aliases (team, department, etc.) should be a
  23. // responsibility of the query handler. By the time it reaches this
  24. // structured representation, we shouldn't have to be aware of what is
  25. // aliased to what.
  26. type AllocationAlias string
  27. const (
  28. AllocationAliasDepartment AllocationAlias = "department"
  29. AllocationAliasEnvironment AllocationAlias = "environment"
  30. AllocationAliasOwner AllocationAlias = "owner"
  31. AllocationAliasProduct AllocationAlias = "product"
  32. AllocationAliasTeam AllocationAlias = "team"
  33. )