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

Method build

cel/env.go:215–235  ·  view source on GitHub ↗

build derives the estimation and tracking options. A cost.ModelOption serves both, so the two lists hold the same options.

()

Source from the content-addressed store, hash-verified

213// build derives the estimation and tracking options. A cost.ModelOption serves both, so the two
214// lists hold the same options.
215func (c *costConfig) build() costModelOptions {
216 var opts []cost.ModelOption
217 if len(c.models) > 0 {
218 opts = append(opts, cost.Model(c.models...))
219 }
220 if c.strategy != nil {
221 opts = append(opts, cost.WithSizingStrategy(c.strategy))
222 }
223 if c.version != nil {
224 opts = append(opts, cost.ModelVersion(*c.version))
225 }
226 built := costModelOptions{
227 estimate: make([]cost.Option, len(opts)),
228 tracker: make([]cost.TrackerOption, len(opts)),
229 }
230 for i, opt := range opts {
231 built.estimate[i] = opt
232 built.tracker[i] = opt
233 }
234 return built
235}
236
237// costModelOptions are the options which apply the environment's cost models, sizing strategy, and
238// revision to estimation and tracking. They precede the caller's options so the caller may

Callers 1

configureMethod · 0.80

Calls 3

ModelFunction · 0.92
WithSizingStrategyFunction · 0.92
ModelVersionFunction · 0.92

Tested by

no test coverage detected