MCPcopy Create free account
hub / github.com/cel-expr/cel-go / CompileOptions

Method CompileOptions

cel/cost_test.go:858–877  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

856}
857
858func (l sinceVersionLib) CompileOptions() []EnvOption {
859 legacy := cost.FixedCostEstimate(*l.legacyCost)
860 return []EnvOption{
861 Function("handoff", Overload("handoff_string", []*Type{StringType}, IntType,
862 UnaryBinding(func(ref.Val) ref.Val { return types.Int(1) }))),
863 CostModel(cost.Overload("handoff_string",
864 cost.EvalCost(cost.Const(7)),
865 cost.BeforeVersion(1, cost.ManualCost(
866 func(cost.Estimator, *cost.AstNode, []cost.AstNode) *cost.CallEstimate {
867 return cost.NewCallEstimate(legacy, nil)
868 },
869 func([]ref.Val, ref.Val) *uint64 { return l.legacyCost },
870 )),
871 cost.BeforeVersion(2,
872 cost.EvalCost(cost.Const(15)),
873 cost.ResultSize(cost.Const(1)),
874 ),
875 )),
876 }
877}
878
879func (l sinceVersionLib) ProgramOptions() []ProgramOption {
880 return nil

Callers

nothing calls this directly

Calls 13

FixedCostEstimateFunction · 0.92
IntTypeAlias · 0.92
OverloadFunction · 0.92
EvalCostFunction · 0.92
ConstFunction · 0.92
BeforeVersionFunction · 0.92
ManualCostFunction · 0.92
NewCallEstimateFunction · 0.92
ResultSizeFunction · 0.92
CostModelFunction · 0.85
FunctionFunction · 0.70
OverloadFunction · 0.70

Tested by

no test coverage detected