fields.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package asset
  2. // AssetField is an enum that represents Asset-specific fields that can be
  3. // filtered on (namespace, label, etc.)
  4. type AssetField string
  5. // If you add a AssetField, make sure to update field maps to return the correct
  6. // Asset value does not enforce exhaustive pattern matching on "enum" types.
  7. const (
  8. FieldName AssetField = "name"
  9. FieldType AssetField = "assetType"
  10. FieldCategory AssetField = "category"
  11. FieldClusterID AssetField = "cluster"
  12. FieldProject AssetField = "project"
  13. FieldProvider AssetField = "provider"
  14. FieldProviderID AssetField = "providerID"
  15. FieldAccount AssetField = "account"
  16. FieldService AssetField = "service"
  17. FieldLabel AssetField = "label"
  18. )
  19. // AssetAlias represents an alias field type for assets.
  20. // Filtering based on label aliases (team, department, etc.) should be a
  21. // responsibility of the query handler. By the time it reaches this
  22. // structured representation, we shouldn't have to be aware of what is
  23. // aliased to what.
  24. type AssetAlias string
  25. const (
  26. DepartmentProp AssetAlias = "department"
  27. EnvironmentProp AssetAlias = "environment"
  28. OwnerProp AssetAlias = "owner"
  29. ProductProp AssetAlias = "product"
  30. TeamProp AssetAlias = "team"
  31. )