fields.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. FieldClusterID AllocationField = "cluster"
  10. FieldNode AllocationField = "node"
  11. FieldNamespace AllocationField = "namespace"
  12. FieldControllerKind AllocationField = "controllerKind"
  13. FieldControllerName AllocationField = "controllerName"
  14. FieldPod AllocationField = "pod"
  15. FieldContainer AllocationField = "container"
  16. FieldProvider AllocationField = "provider"
  17. FieldServices AllocationField = "services"
  18. FieldLabel AllocationField = "label"
  19. FieldAnnotation 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. The aliases correspond to either a label or annotation,
  26. // defined by the user.
  27. type AllocationAlias string
  28. const (
  29. AliasDepartment AllocationAlias = "department"
  30. AliasEnvironment AllocationAlias = "environment"
  31. AliasOwner AllocationAlias = "owner"
  32. AliasProduct AllocationAlias = "product"
  33. AliasTeam AllocationAlias = "team"
  34. )