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

Function ValueAsAlphaProto

cel/io.go:143–151  ·  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

141// ValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.Value.
142// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
143func ValueAsAlphaProto(res ref.Val) (*exprpb.Value, error) {
144 canonical, err := ValueAsProto(res)
145 if err != nil {
146 return nil, err
147 }
148 alpha := &exprpb.Value{}
149 err = convertProto(canonical, alpha)
150 return alpha, err
151}
152
153// RefValToExprValue converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
154// 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