allocation

package
v0.0.0-...-8b28c38 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 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 AllocationField) *ast.Field

DefaultFieldByName returns only default allocation filter fields by name.

func NewAllocationFilterParser

func NewAllocationFilterParser() ast.FilterParser

NewAllocationFilterParser creates a new `ast.FilterParser` implementation which uses allocation specific fields

Types

type AllocationAlias

type AllocationAlias string

AllocationAlias represents an alias field type for allocations. 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. The aliases correspond to either a label or annotation, defined by the user.

const (
	AliasDepartment  AllocationAlias = "department"
	AliasEnvironment AllocationAlias = "environment"
	AliasOwner       AllocationAlias = "owner"
	AliasProduct     AllocationAlias = "product"
	AliasTeam        AllocationAlias = "team"
)

type AllocationField

type AllocationField string

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

const (
	FieldClusterID      AllocationField = "cluster"
	FieldNode           AllocationField = "node"
	FieldNamespace      AllocationField = "namespace"
	FieldControllerKind AllocationField = "controllerKind"
	FieldControllerName AllocationField = "controllerName"
	FieldPod            AllocationField = "pod"
	FieldContainer      AllocationField = "container"
	FieldProvider       AllocationField = "provider"
	FieldServices       AllocationField = "services"
	FieldLabel          AllocationField = "label"
	FieldAnnotation     AllocationField = "annotation"
)

If you add a AllocationFilterField, make sure to update field maps to return the correct Allocation 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