kubernetes/staging/src/k8s.io/dynamic-resource-allocation/cel/compile.go

const deviceVar

const driverVar

const attributesVar

const capacityVar

var lazyCompilerInit

var lazyCompiler

func GetCompiler() *compiler {}

type CompilationResult

type Device

type compiler

func newCompiler() *compiler {}

type Options

// CompileCELExpression returns a compiled CEL expression. It evaluates to bool.
//
// TODO (https://github.com/kubernetes/kubernetes/issues/125826): validate AST to detect invalid attribute names.
func (c compiler) CompileCELExpression(expression string, options Options) CompilationResult {}

// getAttributeValue returns the native representation of the one value that
// should be stored in the attribute, otherwise an error. An error is
// also returned when there is no supported value.
func getAttributeValue(attr resourceapi.DeviceAttribute) (any, error) {}

var boolType

func (c CompilationResult) DeviceMatches(ctx context.Context, input Device) (bool, *cel.EvalDetails, error) {}

func mustBuildEnv() *environment.EnvSet {}

// parseQualifiedName splits into domain and identified, using the default domain
// if the name does not contain one.
func parseQualifiedName(name resourceapi.QualifiedName, defaultDomain string) (string, string) {}

// newStringInterfaceMapWithDefault is like
// https://pkg.go.dev/github.com/google/[email protected]/common/types#NewStringInterfaceMap,
// except that looking up an unknown key returns a default value.
func newStringInterfaceMapWithDefault(adapter types.Adapter, value map[string]any, defaultValue ref.Val) traits.Mapper {}

type mapper

// Find wraps the mapper's Find so that a default empty map is returned when
// the lookup did not find the entry.
func (m mapper) Find(key ref.Val) (ref.Val, bool) {}