asset

package
v1.106.0-rc.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFieldByName

func DefaultFieldByName(field AssetField) *ast.Field

DefaultFieldByName returns only default allocation filter fields by name.

func NewAssetFilterParser

func NewAssetFilterParser() ast.FilterParser

NewAssetFilterParser creates a new `ast.FilterParser` implementation which uses asset specific fields

Types

type AssetAlias

type AssetAlias string

AssetAlias represents an alias field type for assets. Filtering based on label aliases (team, department, etc.) should be a responsibility of the query handler. By the time it reaches this structured representation, we shouldn't have to be aware of what is aliased to what.

const (
	DepartmentProp  AssetAlias = "department"
	EnvironmentProp AssetAlias = "environment"
	OwnerProp       AssetAlias = "owner"
	ProductProp     AssetAlias = "product"
	TeamProp        AssetAlias = "team"
)

type AssetField

type AssetField string

AssetField is an enum that represents Asset-specific fields that can be filtered on (namespace, label, etc.)

const (
	FieldName       AssetField = "name"
	FieldType       AssetField = "assetType"
	FieldCategory   AssetField = "category"
	FieldClusterID  AssetField = "cluster"
	FieldProject    AssetField = "project"
	FieldProvider   AssetField = "provider"
	FieldProviderID AssetField = "providerID"
	FieldAccount    AssetField = "account"
	FieldService    AssetField = "service"
	FieldLabel      AssetField = "label"
)

If you add a AssetField, make sure to update field maps to return the correct Asset value does not enforce exhaustive pattern matching on "enum" types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL