How to store the AST? #897
-
Hi there, I'm just starting to use cel-go and was reading https://codelabs.developers.google.com/codelabs/cel-go#1, which mentions
How should the AST be stored? Is there a code example for serializing the AST? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's normally stored or transferred between programs in the protobuf format. See cel.AstToCheckedExpr for converting from the go object to proto. The conformance server harness has some examples (though the proto serialization is handled by grpc). See https://github.com/google/cel-go/blob/master/server/server.go and https://github.com/google/cel-spec/blob/master/tools/celrpc/celrpc.go The protobuf dev guide has examples for reading/writing the serialized messages. |
Beta Was this translation helpful? Give feedback.
It's normally stored or transferred between programs in the protobuf format. See cel.AstToCheckedExpr for converting from the go object to proto. The conformance server harness has some examples (though the proto serialization is handled by grpc). See https://github.com/google/cel-go/blob/master/server/server.go and https://github.com/google/cel-spec/blob/master/tools/celrpc/celrpc.go
The protobuf dev guide has examples for reading/writing the serialized messages.