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

Function exprStruct

common/ast/conversion.go:261–271  ·  view source on GitHub ↗
(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct)

Source from the content-addressed store, hash-verified

259}
260
261func exprStruct(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) {
262 fields := make([]EntryExpr, len(s.GetEntries()))
263 var err error
264 for i, field := range s.GetEntries() {
265 fields[i], err = exprStructField(factory, field.GetId(), field)
266 if err != nil {
267 return nil, err
268 }
269 }
270 return factory.NewStruct(id, s.GetMessageName(), fields), nil
271}
272
273func exprStructField(factory ExprFactory, id int64, f *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
274 v, err := exprInternal(factory, f.GetValue())

Callers 1

exprInternalFunction · 0.85

Calls 4

exprStructFieldFunction · 0.85
GetIdMethod · 0.65
NewStructMethod · 0.65
GetEntriesMethod · 0.45

Tested by

no test coverage detected