package expr
import "cloud.google.com/go/expr/apiv1alpha1"
Package expr is an auto-generated package for the Common Expression Language.
NOTE: This package is in alpha. It is not stable, and is likely to change.
Defines common types for the Common Expression Language.
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit godoc.org/cloud.google.com/go.
Index ¶
- func DefaultAuthScopes() []string
- type CelCallOptions
- type CelClient
- func NewCelClient(ctx context.Context, opts ...option.ClientOption) (*CelClient, error)
- func (c *CelClient) Check(ctx context.Context, req *exprpb.CheckRequest, opts ...gax.CallOption) (*exprpb.CheckResponse, error)
- func (c *CelClient) Close() error
- func (c *CelClient) Connection() *grpc.ClientConn
- func (c *CelClient) Eval(ctx context.Context, req *exprpb.EvalRequest, opts ...gax.CallOption) (*exprpb.EvalResponse, error)
- func (c *CelClient) Parse(ctx context.Context, req *exprpb.ParseRequest, opts ...gax.CallOption) (*exprpb.ParseResponse, error)
- type ConformanceCallOptions
- type ConformanceClient
- func NewConformanceClient(ctx context.Context, opts ...option.ClientOption) (*ConformanceClient, error)
- func (c *ConformanceClient) Check(ctx context.Context, req *exprpb.CheckRequest, opts ...gax.CallOption) (*exprpb.CheckResponse, error)
- func (c *ConformanceClient) Close() error
- func (c *ConformanceClient) Connection() *grpc.ClientConn
- func (c *ConformanceClient) Eval(ctx context.Context, req *exprpb.EvalRequest, opts ...gax.CallOption) (*exprpb.EvalResponse, error)
- func (c *ConformanceClient) Parse(ctx context.Context, req *exprpb.ParseRequest, opts ...gax.CallOption) (*exprpb.ParseResponse, error)
Examples ¶
- CelClient.Check
- CelClient.Eval
- CelClient.Parse
- ConformanceClient.Check
- ConformanceClient.Eval
- ConformanceClient.Parse
- NewCelClient
- NewConformanceClient
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type CelCallOptions ¶
type CelCallOptions struct { Parse []gax.CallOption Check []gax.CallOption Eval []gax.CallOption }
CelCallOptions contains the retry settings for each method of CelClient.
type CelClient ¶
type CelClient struct { // The call options for this service. CallOptions *CelCallOptions // contains filtered or unexported fields }
CelClient is a client for interacting with Common Expression Language.
Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewCelClient ¶
NewCelClient creates a new cel service client.
Access a CEL implementation from another process or machine. A CEL implementation is decomposed as a parser, a static checker, and an evaluator. Every CEL implementation is expected to provide a server for this API. The API will be used for conformance testing, utilities, and execution as a service.
func (*CelClient) Check ¶
func (c *CelClient) Check(ctx context.Context, req *exprpb.CheckRequest, opts ...gax.CallOption) (*exprpb.CheckResponse, error)
Check runs static checks on a parsed CEL representation and return
an annotated representation, or a set of issues.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewCelClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.CheckRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Check(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CelClient) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CelClient) Connection ¶
func (c *CelClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*CelClient) Eval ¶
func (c *CelClient) Eval(ctx context.Context, req *exprpb.EvalRequest, opts ...gax.CallOption) (*exprpb.EvalResponse, error)
Eval evaluates a parsed or annotation CEL representation given
values of external bindings.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewCelClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.EvalRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Eval(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*CelClient) Parse ¶
func (c *CelClient) Parse(ctx context.Context, req *exprpb.ParseRequest, opts ...gax.CallOption) (*exprpb.ParseResponse, error)
Parse transforms CEL source text into a parsed representation.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewCelClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.ParseRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Parse(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ConformanceCallOptions ¶
type ConformanceCallOptions struct { Parse []gax.CallOption Check []gax.CallOption Eval []gax.CallOption }
ConformanceCallOptions contains the retry settings for each method of ConformanceClient.
type ConformanceClient ¶
type ConformanceClient struct { // The call options for this service. CallOptions *ConformanceCallOptions // contains filtered or unexported fields }
ConformanceClient is a client for interacting with Common Expression Language.
Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewConformanceClient ¶
func NewConformanceClient(ctx context.Context, opts ...option.ClientOption) (*ConformanceClient, error)
NewConformanceClient creates a new conformance service client.
Access a CEL implementation from another process or machine. A CEL implementation is decomposed as a parser, a static checker, and an evaluator. Every CEL implementation is expected to provide a server for this API. The API will be used for conformance testing and other utilities.
func (*ConformanceClient) Check ¶
func (c *ConformanceClient) Check(ctx context.Context, req *exprpb.CheckRequest, opts ...gax.CallOption) (*exprpb.CheckResponse, error)
Check runs static checks on a parsed CEL representation and return
an annotated representation, or a set of issues.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewConformanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.CheckRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Check(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConformanceClient) Close ¶
func (c *ConformanceClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConformanceClient) Connection ¶
func (c *ConformanceClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*ConformanceClient) Eval ¶
func (c *ConformanceClient) Eval(ctx context.Context, req *exprpb.EvalRequest, opts ...gax.CallOption) (*exprpb.EvalResponse, error)
Eval evaluates a parsed or annotation CEL representation given
values of external bindings.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewConformanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.EvalRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Eval(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConformanceClient) Parse ¶
func (c *ConformanceClient) Parse(ctx context.Context, req *exprpb.ParseRequest, opts ...gax.CallOption) (*exprpb.ParseResponse, error)
Parse transforms CEL source text into a parsed representation.
Code:play
Example¶
package main
import (
"context"
expr "cloud.google.com/go/expr/apiv1alpha1"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func main() {
ctx := context.Background()
c, err := expr.NewConformanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &exprpb.ParseRequest{
// TODO: Fill request struct fields.
}
resp, err := c.Parse(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Source Files ¶
cel_client.go conformance_client.go doc.go
- Version
- v0.49.0
- Published
- Nov 19, 2019
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 25 minutes ago –
Tools for package owners.