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

Function protoStructField

common/ast/conversion.go:513–526  ·  view source on GitHub ↗
(id int64, f StructField)

Source from the content-addressed store, hash-verified

511}
512
513func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) {
514 v, err := ExprToProto(f.Value())
515 if err != nil {
516 return nil, err
517 }
518 return &exprpb.Expr_CreateStruct_Entry{
519 Id: id,
520 KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{
521 FieldKey: f.Name(),
522 },
523 Value: v,
524 OptionalEntry: f.IsOptional(),
525 }, nil
526}
527
528// SourceInfoToProto serializes an ast.SourceInfo value to a protobuf SourceInfo object.
529func SourceInfoToProto(info *SourceInfo) (*exprpb.SourceInfo, error) {

Callers 1

EntryExprToProtoFunction · 0.85

Calls 4

ExprToProtoFunction · 0.85
ValueMethod · 0.65
NameMethod · 0.65
IsOptionalMethod · 0.65

Tested by

no test coverage detected