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

Method AddSerializableOption

repl/evaluator.go:680–689  ·  view source on GitHub ↗

AddSerializableOption adds an option to the basic environment that is flagged as YAML compatible.

(opt Optioner)

Source from the content-addressed store, hash-verified

678
679// AddSerializableOption adds an option to the basic environment that is flagged as YAML compatible.
680func (e *Evaluator) AddSerializableOption(opt Optioner) error {
681 cpy := e.ctx.copy()
682 cpy.addOption(opt, true)
683 err := updateContextPlans(cpy, e.env)
684 if err != nil {
685 return err
686 }
687 e.ctx = *cpy
688 return nil
689}
690
691// EnablePartialEval enables the option to allow partial evaluations.
692func (e *Evaluator) EnablePartialEval() error {

Callers 6

TestSetOptionFunction · 0.95
TestSetOptionErrorFunction · 0.95
parseYAMLConfigMethod · 0.95
setOptionMethod · 0.95
loadContainerOptionMethod · 0.95

Calls 3

updateContextPlansFunction · 0.85
addOptionMethod · 0.80
copyMethod · 0.45

Tested by 2

TestSetOptionFunction · 0.76
TestSetOptionErrorFunction · 0.76