package cel
import "k8s.io/dynamic-resource-allocation/cel"
Index ¶
Functions ¶
func GetCompiler ¶
func GetCompiler() *compiler
Types ¶
type CompilationResult ¶
type CompilationResult struct { Program cel.Program Error *apiservercel.Error Expression string OutputType *cel.Type Environment *cel.Env // MaxCost represents the worst-case cost of the compiled MessageExpression in terms of CEL's cost units, // as used by cel.EstimateCost. MaxCost uint64 // contains filtered or unexported fields }
CompilationResult represents a compiled expression.
func (CompilationResult) DeviceMatches ¶
func (c CompilationResult) DeviceMatches(ctx context.Context, input Device) (bool, *cel.EvalDetails, error)
type Device ¶
type Device struct { // Driver gets used as domain for any attribute which does not already // have a domain prefix. If set, then it is also made available as a // string attribute. Driver string Attributes map[resourceapi.QualifiedName]resourceapi.DeviceAttribute Capacity map[resourceapi.QualifiedName]resource.Quantity }
Device defines the input values for a CEL selector expression.
type Options ¶
type Options struct { // EnvType allows to override the default environment type [environment.StoredExpressions]. EnvType *environment.Type // CostLimit allows overriding the default runtime cost limit [resourceapi.CELSelectorExpressionMaxCost]. CostLimit *uint64 }
Options contains several additional parameters for [CompileCELExpression]. All of them have reasonable defaults.
Source Files ¶
compile.go
- Version
- v0.32.0-alpha.3
- Published
- Oct 29, 2024
- Platform
- js/wasm
- Imports
- 20 packages
- Last checked
- 58 seconds ago –
Tools for package owners.