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

Function ValueAsAlphaProto

cel/io.go:119–127  ·  view source on GitHub ↗

ValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.Value. The result Value is the serialized proto form. The ref.Val must not be error or unknown.

(res ref.Val)

Source from the content-addressed store, hash-verified

117// ValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.Value.
118// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
119func ValueAsAlphaProto(res ref.Val) (*exprpb.Value, error) {
120 canonical, err := ValueAsProto(res)
121 if err != nil {
122 return nil, err
123 }
124 alpha := &exprpb.Value{}
125 err = convertProto(canonical, alpha)
126 return alpha, err
127}
128
129// RefValToExprValue converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
130// The result ExprValue is the serialized proto form.

Callers 1

RefValueToValueFunction · 0.85

Calls 2

ValueAsProtoFunction · 0.85
convertProtoFunction · 0.70

Tested by

no test coverage detected