Documentation ¶
Overview ¶
Package celenv provides standard CEL environments to evaluate CEL expressions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DiskLocator = sync.OnceValue(func() *cel.Env { var diskSpec block.DiskSpec env, err := cel.NewEnv( slices.Concat( []cel.EnvOption{ cel.Types(&diskSpec), cel.Variable("disk", cel.ObjectType(string(diskSpec.ProtoReflect().Descriptor().FullName()))), cel.Variable("system_disk", types.BoolType), cel.Function("glob", cel.Overload("glob_string_string", []*cel.Type{cel.StringType, cel.StringType}, cel.BoolType, cel.BinaryBinding(func(arg1, arg2 ref.Val) ref.Val { return types.Bool(glob.Glob(string(arg1.(types.String)), string(arg2.(types.String)))) }), ), ), }, celUnitMultipliersConstants(), )..., ) if err != nil { panic(err) } return env })
DiskLocator is a disk locator CEL environment.
View Source
var Empty = sync.OnceValue(func() *cel.Env { env, err := cel.NewEnv() if err != nil { panic(err) } return env })
Empty is an empty CEL environment.
View Source
var VolumeLocator = sync.OnceValue(func() *cel.Env { var volumeSpec block.DiscoveredVolumeSpec env, err := cel.NewEnv( slices.Concat( []cel.EnvOption{ cel.Types(&volumeSpec), cel.Variable("volume", cel.ObjectType(string(volumeSpec.ProtoReflect().Descriptor().FullName()))), }, celUnitMultipliersConstants(), )..., ) if err != nil { panic(err) } return env })
VolumeLocator is a volume locator CEL environment.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.