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

Function KeyTotal

common/cost/model.go:427–429  ·  view source on GitHub ↗

KeyTotal creates an expression referencing the combined size of every key of a map. A value which is not a map has no keys. The operand must be Arg, Target or Result; see OverloadModel.Validate. The estimate is derived from the operand's size under the sizing strategy; see totalEstimate. At runtime

(expr QuantityExpr)

Source from the content-addressed store, hash-verified

425// from the operand's size under the sizing strategy; see totalEstimate. At runtime this reports
426// the exact total.
427func KeyTotal(expr QuantityExpr) QuantityExpr {
428 return keyTotalExpr{expr: expr}
429}
430
431// lengthExpr represents the shallow top-level length of a single value (its CEL size()): the
432// number of code points of a string, the number of bytes of a bytes value, the number of top-level

Callers 6

TestTotalsWithinEstimateFunction · 0.85
TestKeyTotalFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestTotalsWithinEstimateFunction · 0.68
TestKeyTotalFunction · 0.68