conformance

package
v1.36.11-2025110320484... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: unknown License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const EvalRequest_CheckedExpr_case case_EvalRequest_ExprKind = 2
View Source
const EvalRequest_ExprKind_not_set_case case_EvalRequest_ExprKind = 0
View Source
const EvalRequest_ParsedExpr_case case_EvalRequest_ExprKind = 1

Variables

View Source
var (
	IssueDetails_Severity_name = map[int32]string{
		0: "SEVERITY_UNSPECIFIED",
		1: "DEPRECATION",
		2: "WARNING",
		3: "ERROR",
	}
	IssueDetails_Severity_value = map[string]int32{
		"SEVERITY_UNSPECIFIED": 0,
		"DEPRECATION":          1,
		"WARNING":              2,
		"ERROR":                3,
	}
)

Enum value maps for IssueDetails_Severity.

View Source
var File_cel_expr_conformance_conformance_service_proto protoreflect.FileDescriptor
View Source
var File_cel_expr_conformance_env_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CheckRequest

type CheckRequest struct {

	// Required. The parsed representation of the CEL program.
	ParsedExpr *expr.ParsedExpr `protobuf:"bytes,1,opt,name=parsed_expr,json=parsedExpr,proto3" json:"parsed_expr,omitempty"`
	// Declarations of types for external variables and functions.
	// Required if program uses external variables or functions
	// not in the default environment.
	TypeEnv []*expr.Decl `protobuf:"bytes,2,rep,name=type_env,json=typeEnv,proto3" json:"type_env,omitempty"`
	// The protocol buffer context.  See "Name Resolution" in the
	// Language Definition.
	Container string `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"`
	// If true, use only the declarations in [type_env][cel.expr.conformance.CheckRequest.type_env].  If false (default),
	// add declarations for the standard definitions to the type environment.  See
	// "Standard Definitions" in the Language Definition.
	NoStdEnv bool `protobuf:"varint,4,opt,name=no_std_env,json=noStdEnv,proto3" json:"no_std_env,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Check method.

func (*CheckRequest) ClearParsedExpr

func (x *CheckRequest) ClearParsedExpr()

func (*CheckRequest) GetContainer

func (x *CheckRequest) GetContainer() string

func (*CheckRequest) GetNoStdEnv

func (x *CheckRequest) GetNoStdEnv() bool

func (*CheckRequest) GetParsedExpr

func (x *CheckRequest) GetParsedExpr() *expr.ParsedExpr

func (*CheckRequest) GetTypeEnv

func (x *CheckRequest) GetTypeEnv() []*expr.Decl

func (*CheckRequest) HasParsedExpr

func (x *CheckRequest) HasParsedExpr() bool

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

func (x *CheckRequest) ProtoReflect() protoreflect.Message

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) SetContainer

func (x *CheckRequest) SetContainer(v string)

func (*CheckRequest) SetNoStdEnv

func (x *CheckRequest) SetNoStdEnv(v bool)

func (*CheckRequest) SetParsedExpr

func (x *CheckRequest) SetParsedExpr(v *expr.ParsedExpr)

func (*CheckRequest) SetTypeEnv

func (x *CheckRequest) SetTypeEnv(v []*expr.Decl)

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckRequest_builder

type CheckRequest_builder struct {

	// Required. The parsed representation of the CEL program.
	ParsedExpr *expr.ParsedExpr
	// Declarations of types for external variables and functions.
	// Required if program uses external variables or functions
	// not in the default environment.
	TypeEnv []*expr.Decl
	// The protocol buffer context.  See "Name Resolution" in the
	// Language Definition.
	Container string
	// If true, use only the declarations in [type_env][cel.expr.conformance.CheckRequest.type_env].  If false (default),
	// add declarations for the standard definitions to the type environment.  See
	// "Standard Definitions" in the Language Definition.
	NoStdEnv bool
	// contains filtered or unexported fields
}

func (CheckRequest_builder) Build

func (b0 CheckRequest_builder) Build() *CheckRequest

type CheckResponse

type CheckResponse struct {

	// The annotated representation, or unset if checking failed.
	CheckedExpr *expr.CheckedExpr `protobuf:"bytes,1,opt,name=checked_expr,json=checkedExpr,proto3" json:"checked_expr,omitempty"`
	// Any number of issues with [StatusDetails][] as the details.
	Issues *expr.ErrorSet `protobuf:"bytes,2,opt,name=issues,proto3" json:"issues,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Check method.

func (*CheckResponse) ClearCheckedExpr

func (x *CheckResponse) ClearCheckedExpr()

func (*CheckResponse) ClearIssues

func (x *CheckResponse) ClearIssues()

func (*CheckResponse) GetCheckedExpr

func (x *CheckResponse) GetCheckedExpr() *expr.CheckedExpr

func (*CheckResponse) GetIssues

func (x *CheckResponse) GetIssues() *expr.ErrorSet

func (*CheckResponse) HasCheckedExpr

func (x *CheckResponse) HasCheckedExpr() bool

func (*CheckResponse) HasIssues

func (x *CheckResponse) HasIssues() bool

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

func (x *CheckResponse) ProtoReflect() protoreflect.Message

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) SetCheckedExpr

func (x *CheckResponse) SetCheckedExpr(v *expr.CheckedExpr)

func (*CheckResponse) SetIssues

func (x *CheckResponse) SetIssues(v *expr.ErrorSet)

func (*CheckResponse) String

func (x *CheckResponse) String() string

type CheckResponse_builder

type CheckResponse_builder struct {

	// The annotated representation, or unset if checking failed.
	CheckedExpr *expr.CheckedExpr
	// Any number of issues with [StatusDetails][] as the details.
	Issues *expr.ErrorSet
	// contains filtered or unexported fields
}

func (CheckResponse_builder) Build

type Environment

type Environment struct {

	// Name of the environment
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Description for the current environment
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// Sets the namespace (container) for the expression.
	// This is used to simplify resolution.
	// For example with container
	//
	//	 `google.rpc.context`
	//	an identifier of `google.rpc.context.AttributeContext` could be referred
	//	to simply as `AttributeContext` in the CEL expression.
	Container string `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"`
	// List of abbreviations to be added to the CEL environment
	Imports []*Environment_Import `protobuf:"bytes,4,rep,name=imports,proto3" json:"imports,omitempty"`
	// Set of options to subset a subsettable library
	Stdlib *LibrarySubset `protobuf:"bytes,5,opt,name=stdlib,proto3" json:"stdlib,omitempty"`
	// List of extensions to enable in the CEL environment.
	Extensions []*Extension `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"`
	// If set, adds a context declaration from a proto message.
	//
	// Context messages have all of their top-level fields available as variables
	// in the type checker.
	ContextVariable *Environment_ContextVariable `protobuf:"bytes,7,opt,name=context_variable,json=contextVariable,proto3" json:"context_variable,omitempty"`
	// List of declarations to be configured in the CEL environment.
	//
	// Note: The CEL environment can be configured with either the
	// context_variable or a set of ident_decls provided as part of declarations.
	// Providing both will result in an error.
	Declarations []*expr.Decl `protobuf:"bytes,8,rep,name=declarations,proto3" json:"declarations,omitempty"`
	// List of validators for validating the parsed ast.
	Validators []*Validator `protobuf:"bytes,9,rep,name=validators,proto3" json:"validators,omitempty"`
	// List of feature flags to be enabled or disabled.
	Features []*Feature `protobuf:"bytes,10,rep,name=features,proto3" json:"features,omitempty"`
	// Disables including the declarations from the standard CEL environment.
	//
	// NOTE: Do not disable the standard CEL declarations unless you are aware of
	// the implications and have discussed your use case on cel-discuss@
	// or with the members of the cel-governance-team@
	//
	// Deprecated: Use LibrarySubset to disable standard cel declarations instead:
	//
	//	stdlib = LibrarySubset{ disable: true }
	DisableStandardCelDeclarations bool `` /* 157-byte string literal not displayed */
	// If provided, uses the provided FileDescriptorSet to extend types available
	// the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
	// are known to the CEL compiler, but all others must be provided for type
	// checking.
	MessageTypeExtension *descriptorpb.FileDescriptorSet `protobuf:"bytes,12,opt,name=message_type_extension,json=messageTypeExtension,proto3" json:"message_type_extension,omitempty"`
	// When macro call tracking is enabled, the resulting SourceInfo in the
	// CheckedExpr will contain a collection of expressions representing the
	// function calls which were replaced by macros.
	//
	// Deprecated: Use Feature to enable macro call tracking
	//
	//	Feature{ name: "cel.feature.macro_call_tracking", enabled: true }
	EnableMacroCallTracking bool `` /* 136-byte string literal not displayed */
	// contains filtered or unexported fields
}

Representation of a CEL Environment, defining what features and extensions are available for conformance testing.

func (*Environment) ClearContextVariable

func (x *Environment) ClearContextVariable()

func (*Environment) ClearMessageTypeExtension

func (x *Environment) ClearMessageTypeExtension()

func (*Environment) ClearStdlib

func (x *Environment) ClearStdlib()

func (*Environment) GetContainer

func (x *Environment) GetContainer() string

func (*Environment) GetContextVariable

func (x *Environment) GetContextVariable() *Environment_ContextVariable

func (*Environment) GetDeclarations

func (x *Environment) GetDeclarations() []*expr.Decl

func (*Environment) GetDescription

func (x *Environment) GetDescription() string

func (*Environment) GetDisableStandardCelDeclarations

func (x *Environment) GetDisableStandardCelDeclarations() bool

func (*Environment) GetEnableMacroCallTracking

func (x *Environment) GetEnableMacroCallTracking() bool

func (*Environment) GetExtensions

func (x *Environment) GetExtensions() []*Extension

func (*Environment) GetFeatures

func (x *Environment) GetFeatures() []*Feature

func (*Environment) GetImports

func (x *Environment) GetImports() []*Environment_Import

func (*Environment) GetMessageTypeExtension

func (x *Environment) GetMessageTypeExtension() *descriptorpb.FileDescriptorSet

func (*Environment) GetName

func (x *Environment) GetName() string

func (*Environment) GetStdlib

func (x *Environment) GetStdlib() *LibrarySubset

func (*Environment) GetValidators

func (x *Environment) GetValidators() []*Validator

func (*Environment) HasContextVariable

func (x *Environment) HasContextVariable() bool

func (*Environment) HasMessageTypeExtension

func (x *Environment) HasMessageTypeExtension() bool

func (*Environment) HasStdlib

func (x *Environment) HasStdlib() bool

func (*Environment) ProtoMessage

func (*Environment) ProtoMessage()

func (*Environment) ProtoReflect

func (x *Environment) ProtoReflect() protoreflect.Message

func (*Environment) Reset

func (x *Environment) Reset()

func (*Environment) SetContainer

func (x *Environment) SetContainer(v string)

func (*Environment) SetContextVariable

func (x *Environment) SetContextVariable(v *Environment_ContextVariable)

func (*Environment) SetDeclarations

func (x *Environment) SetDeclarations(v []*expr.Decl)

func (*Environment) SetDescription

func (x *Environment) SetDescription(v string)

func (*Environment) SetDisableStandardCelDeclarations

func (x *Environment) SetDisableStandardCelDeclarations(v bool)

func (*Environment) SetEnableMacroCallTracking

func (x *Environment) SetEnableMacroCallTracking(v bool)

func (*Environment) SetExtensions

func (x *Environment) SetExtensions(v []*Extension)

func (*Environment) SetFeatures

func (x *Environment) SetFeatures(v []*Feature)

func (*Environment) SetImports

func (x *Environment) SetImports(v []*Environment_Import)

func (*Environment) SetMessageTypeExtension

func (x *Environment) SetMessageTypeExtension(v *descriptorpb.FileDescriptorSet)

func (*Environment) SetName

func (x *Environment) SetName(v string)

func (*Environment) SetStdlib

func (x *Environment) SetStdlib(v *LibrarySubset)

func (*Environment) SetValidators

func (x *Environment) SetValidators(v []*Validator)

func (*Environment) String

func (x *Environment) String() string

type Environment_ContextVariable

type Environment_ContextVariable struct {

	// Fully qualified type name of the context proto.
	TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"`
	// contains filtered or unexported fields
}

ContextVariable represents a message type to be made available as a context variable to the CEL environment.

func (*Environment_ContextVariable) GetTypeName

func (x *Environment_ContextVariable) GetTypeName() string

func (*Environment_ContextVariable) ProtoMessage

func (*Environment_ContextVariable) ProtoMessage()

func (*Environment_ContextVariable) ProtoReflect

func (*Environment_ContextVariable) Reset

func (x *Environment_ContextVariable) Reset()

func (*Environment_ContextVariable) SetTypeName

func (x *Environment_ContextVariable) SetTypeName(v string)

func (*Environment_ContextVariable) String

func (x *Environment_ContextVariable) String() string

type Environment_ContextVariable_builder

type Environment_ContextVariable_builder struct {

	// Fully qualified type name of the context proto.
	TypeName string
	// contains filtered or unexported fields
}

func (Environment_ContextVariable_builder) Build

type Environment_Import

type Environment_Import struct {

	// Qualified type name which will be abbreviated
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Import represents a type name that will be abbreviated by its simple name making it easier to reference simple type names from packages other than the expression container. For ex:

Import{name: 'google.rpc.Status'}

The above import will ensure that `google.rpc.Status` is available by the simple name `Status` within CEL expressions.

func (*Environment_Import) GetName

func (x *Environment_Import) GetName() string

func (*Environment_Import) ProtoMessage

func (*Environment_Import) ProtoMessage()

func (*Environment_Import) ProtoReflect

func (x *Environment_Import) ProtoReflect() protoreflect.Message

func (*Environment_Import) Reset

func (x *Environment_Import) Reset()

func (*Environment_Import) SetName

func (x *Environment_Import) SetName(v string)

func (*Environment_Import) String

func (x *Environment_Import) String() string

type Environment_Import_builder

type Environment_Import_builder struct {

	// Qualified type name which will be abbreviated
	Name string
	// contains filtered or unexported fields
}

func (Environment_Import_builder) Build

type Environment_builder

type Environment_builder struct {

	// Name of the environment
	Name string
	// Description for the current environment
	Description string
	// Sets the namespace (container) for the expression.
	// This is used to simplify resolution.
	// For example with container
	//
	//	 `google.rpc.context`
	//	an identifier of `google.rpc.context.AttributeContext` could be referred
	//	to simply as `AttributeContext` in the CEL expression.
	Container string
	// List of abbreviations to be added to the CEL environment
	Imports []*Environment_Import
	// Set of options to subset a subsettable library
	Stdlib *LibrarySubset
	// List of extensions to enable in the CEL environment.
	Extensions []*Extension
	// If set, adds a context declaration from a proto message.
	//
	// Context messages have all of their top-level fields available as variables
	// in the type checker.
	ContextVariable *Environment_ContextVariable
	// List of declarations to be configured in the CEL environment.
	//
	// Note: The CEL environment can be configured with either the
	// context_variable or a set of ident_decls provided as part of declarations.
	// Providing both will result in an error.
	Declarations []*expr.Decl
	// List of validators for validating the parsed ast.
	Validators []*Validator
	// List of feature flags to be enabled or disabled.
	Features []*Feature
	// Disables including the declarations from the standard CEL environment.
	//
	// NOTE: Do not disable the standard CEL declarations unless you are aware of
	// the implications and have discussed your use case on cel-discuss@
	// or with the members of the cel-governance-team@
	//
	// Deprecated: Use LibrarySubset to disable standard cel declarations instead:
	//
	//	stdlib = LibrarySubset{ disable: true }
	DisableStandardCelDeclarations bool
	// If provided, uses the provided FileDescriptorSet to extend types available
	// the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
	// are known to the CEL compiler, but all others must be provided for type
	// checking.
	MessageTypeExtension *descriptorpb.FileDescriptorSet
	// When macro call tracking is enabled, the resulting SourceInfo in the
	// CheckedExpr will contain a collection of expressions representing the
	// function calls which were replaced by macros.
	//
	// Deprecated: Use Feature to enable macro call tracking
	//
	//	Feature{ name: "cel.feature.macro_call_tracking", enabled: true }
	EnableMacroCallTracking bool
	// contains filtered or unexported fields
}

func (Environment_builder) Build

func (b0 Environment_builder) Build() *Environment

type EvalRequest

type EvalRequest struct {

	// Required. Either the parsed or annotated representation of the CEL program.
	//
	// Types that are valid to be assigned to ExprKind:
	//
	//	*EvalRequest_ParsedExpr
	//	*EvalRequest_CheckedExpr
	ExprKind isEvalRequest_ExprKind `protobuf_oneof:"expr_kind"`
	// Bindings for the external variables.  The types SHOULD be compatible
	// with the type environment in [CheckRequest][cel.expr.conformance.CheckRequest], if checked.
	Bindings map[string]*expr.ExprValue `` /* 143-byte string literal not displayed */
	// SHOULD be the same container as used in [CheckRequest][cel.expr.conformance.CheckRequest], if checked.
	Container string `protobuf:"bytes,4,opt,name=container,proto3" json:"container,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Eval method.

func (*EvalRequest) ClearCheckedExpr

func (x *EvalRequest) ClearCheckedExpr()

func (*EvalRequest) ClearExprKind

func (x *EvalRequest) ClearExprKind()

func (*EvalRequest) ClearParsedExpr

func (x *EvalRequest) ClearParsedExpr()

func (*EvalRequest) GetBindings

func (x *EvalRequest) GetBindings() map[string]*expr.ExprValue

func (*EvalRequest) GetCheckedExpr

func (x *EvalRequest) GetCheckedExpr() *expr.CheckedExpr

func (*EvalRequest) GetContainer

func (x *EvalRequest) GetContainer() string

func (*EvalRequest) GetExprKind

func (x *EvalRequest) GetExprKind() isEvalRequest_ExprKind

func (*EvalRequest) GetParsedExpr

func (x *EvalRequest) GetParsedExpr() *expr.ParsedExpr

func (*EvalRequest) HasCheckedExpr

func (x *EvalRequest) HasCheckedExpr() bool

func (*EvalRequest) HasExprKind

func (x *EvalRequest) HasExprKind() bool

func (*EvalRequest) HasParsedExpr

func (x *EvalRequest) HasParsedExpr() bool

func (*EvalRequest) ProtoMessage

func (*EvalRequest) ProtoMessage()

func (*EvalRequest) ProtoReflect

func (x *EvalRequest) ProtoReflect() protoreflect.Message

func (*EvalRequest) Reset

func (x *EvalRequest) Reset()

func (*EvalRequest) SetBindings

func (x *EvalRequest) SetBindings(v map[string]*expr.ExprValue)

func (*EvalRequest) SetCheckedExpr

func (x *EvalRequest) SetCheckedExpr(v *expr.CheckedExpr)

func (*EvalRequest) SetContainer

func (x *EvalRequest) SetContainer(v string)

func (*EvalRequest) SetParsedExpr

func (x *EvalRequest) SetParsedExpr(v *expr.ParsedExpr)

func (*EvalRequest) String

func (x *EvalRequest) String() string

func (*EvalRequest) WhichExprKind

func (x *EvalRequest) WhichExprKind() case_EvalRequest_ExprKind

type EvalRequest_CheckedExpr

type EvalRequest_CheckedExpr struct {
	// Evaluate based on the checked representation.
	CheckedExpr *expr.CheckedExpr `protobuf:"bytes,2,opt,name=checked_expr,json=checkedExpr,proto3,oneof"`
}

type EvalRequest_ParsedExpr

type EvalRequest_ParsedExpr struct {
	// Evaluate based on the parsed representation.
	ParsedExpr *expr.ParsedExpr `protobuf:"bytes,1,opt,name=parsed_expr,json=parsedExpr,proto3,oneof"`
}

type EvalRequest_builder

type EvalRequest_builder struct {

	// Fields of oneof ExprKind:
	// Evaluate based on the parsed representation.
	ParsedExpr *expr.ParsedExpr
	// Evaluate based on the checked representation.
	CheckedExpr *expr.CheckedExpr
	// -- end of ExprKind
	// Bindings for the external variables.  The types SHOULD be compatible
	// with the type environment in [CheckRequest][cel.expr.conformance.CheckRequest], if checked.
	Bindings map[string]*expr.ExprValue
	// SHOULD be the same container as used in [CheckRequest][cel.expr.conformance.CheckRequest], if checked.
	Container string
	// contains filtered or unexported fields
}

func (EvalRequest_builder) Build

func (b0 EvalRequest_builder) Build() *EvalRequest

type EvalResponse

type EvalResponse struct {

	// The execution result, or unset if execution couldn't start.
	Result *expr.ExprValue `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// Any number of issues with [StatusDetails][] as the details.
	// Note that CEL execution errors are reified into [ExprValue][].
	// Nevertheless, we'll allow out-of-band issues to be raised,
	// which also makes the replies more regular.
	Issues *expr.ErrorSet `protobuf:"bytes,2,opt,name=issues,proto3" json:"issues,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Eval method.

func (*EvalResponse) ClearIssues

func (x *EvalResponse) ClearIssues()

func (*EvalResponse) ClearResult

func (x *EvalResponse) ClearResult()

func (*EvalResponse) GetIssues

func (x *EvalResponse) GetIssues() *expr.ErrorSet

func (*EvalResponse) GetResult

func (x *EvalResponse) GetResult() *expr.ExprValue

func (*EvalResponse) HasIssues

func (x *EvalResponse) HasIssues() bool

func (*EvalResponse) HasResult

func (x *EvalResponse) HasResult() bool

func (*EvalResponse) ProtoMessage

func (*EvalResponse) ProtoMessage()

func (*EvalResponse) ProtoReflect

func (x *EvalResponse) ProtoReflect() protoreflect.Message

func (*EvalResponse) Reset

func (x *EvalResponse) Reset()

func (*EvalResponse) SetIssues

func (x *EvalResponse) SetIssues(v *expr.ErrorSet)

func (*EvalResponse) SetResult

func (x *EvalResponse) SetResult(v *expr.ExprValue)

func (*EvalResponse) String

func (x *EvalResponse) String() string

type EvalResponse_builder

type EvalResponse_builder struct {

	// The execution result, or unset if execution couldn't start.
	Result *expr.ExprValue
	// Any number of issues with [StatusDetails][] as the details.
	// Note that CEL execution errors are reified into [ExprValue][].
	// Nevertheless, we'll allow out-of-band issues to be raised,
	// which also makes the replies more regular.
	Issues *expr.ErrorSet
	// contains filtered or unexported fields
}

func (EvalResponse_builder) Build

func (b0 EvalResponse_builder) Build() *EvalResponse

type Extension

type Extension struct {

	// Name of the extension library.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Version of the extension library.
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

Extension represents a versioned extension library reference to enable in the CEL environment.

func (*Extension) GetName

func (x *Extension) GetName() string

func (*Extension) GetVersion

func (x *Extension) GetVersion() string

func (*Extension) ProtoMessage

func (*Extension) ProtoMessage()

func (*Extension) ProtoReflect

func (x *Extension) ProtoReflect() protoreflect.Message

func (*Extension) Reset

func (x *Extension) Reset()

func (*Extension) SetName

func (x *Extension) SetName(v string)

func (*Extension) SetVersion

func (x *Extension) SetVersion(v string)

func (*Extension) String

func (x *Extension) String() string

type Extension_builder

type Extension_builder struct {

	// Name of the extension library.
	Name string
	// Version of the extension library.
	Version string
	// contains filtered or unexported fields
}

func (Extension_builder) Build

func (b0 Extension_builder) Build() *Extension

type Feature

type Feature struct {

	// Name of the feature flag.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// State of the feature flab.
	Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// contains filtered or unexported fields
}

Represents a named boolean feature flag supported by CEL. Naming convention followed by features:

<domain>.feature.<feature_name>

For ex:

`cel.feature.cross_type_numeric_comparisons`

func (*Feature) GetEnabled

func (x *Feature) GetEnabled() bool

func (*Feature) GetName

func (x *Feature) GetName() string

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) ProtoReflect

func (x *Feature) ProtoReflect() protoreflect.Message

func (*Feature) Reset

func (x *Feature) Reset()

func (*Feature) SetEnabled

func (x *Feature) SetEnabled(v bool)

func (*Feature) SetName

func (x *Feature) SetName(v string)

func (*Feature) String

func (x *Feature) String() string

type Feature_builder

type Feature_builder struct {

	// Name of the feature flag.
	Name string
	// State of the feature flab.
	Enabled bool
	// contains filtered or unexported fields
}

func (Feature_builder) Build

func (b0 Feature_builder) Build() *Feature

type IssueDetails

type IssueDetails struct {

	// The severity of the issue.
	Severity IssueDetails_Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=cel.expr.conformance.IssueDetails_Severity" json:"severity,omitempty"`
	// Position in the source, if known.
	Position *SourcePosition `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"`
	// Expression ID from [Expr][], 0 if unknown.
	Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Warnings or errors in service execution are represented by [google.rpc.Status][google.rpc.Status] messages, with the following message in the details field.

func (*IssueDetails) ClearPosition

func (x *IssueDetails) ClearPosition()

func (*IssueDetails) GetId

func (x *IssueDetails) GetId() int64

func (*IssueDetails) GetPosition

func (x *IssueDetails) GetPosition() *SourcePosition

func (*IssueDetails) GetSeverity

func (x *IssueDetails) GetSeverity() IssueDetails_Severity

func (*IssueDetails) HasPosition

func (x *IssueDetails) HasPosition() bool

func (*IssueDetails) ProtoMessage

func (*IssueDetails) ProtoMessage()

func (*IssueDetails) ProtoReflect

func (x *IssueDetails) ProtoReflect() protoreflect.Message

func (*IssueDetails) Reset

func (x *IssueDetails) Reset()

func (*IssueDetails) SetId

func (x *IssueDetails) SetId(v int64)

func (*IssueDetails) SetPosition

func (x *IssueDetails) SetPosition(v *SourcePosition)

func (*IssueDetails) SetSeverity

func (x *IssueDetails) SetSeverity(v IssueDetails_Severity)

func (*IssueDetails) String

func (x *IssueDetails) String() string

type IssueDetails_Severity

type IssueDetails_Severity int32

Severities of issues.

const (
	// An unspecified severity.
	IssueDetails_SEVERITY_UNSPECIFIED IssueDetails_Severity = 0
	// Deprecation issue for statements and method that may no longer be
	// supported or maintained.
	IssueDetails_DEPRECATION IssueDetails_Severity = 1
	// Warnings such as: unused variables.
	IssueDetails_WARNING IssueDetails_Severity = 2
	// Errors such as: unmatched curly braces or variable redefinition.
	IssueDetails_ERROR IssueDetails_Severity = 3
)

func (IssueDetails_Severity) Descriptor

func (IssueDetails_Severity) Enum

func (IssueDetails_Severity) Number

func (IssueDetails_Severity) String

func (x IssueDetails_Severity) String() string

func (IssueDetails_Severity) Type

type IssueDetails_builder

type IssueDetails_builder struct {

	// The severity of the issue.
	Severity IssueDetails_Severity
	// Position in the source, if known.
	Position *SourcePosition
	// Expression ID from [Expr][], 0 if unknown.
	Id int64
	// contains filtered or unexported fields
}

func (IssueDetails_builder) Build

func (b0 IssueDetails_builder) Build() *IssueDetails

type LibrarySubset

type LibrarySubset struct {

	// Indicates whether the library has been disabled, typically only
	// used for default-enabled libraries like stdlib.
	Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"`
	// Disables macros for the given library.
	DisableMacros bool `protobuf:"varint,2,opt,name=disable_macros,json=disableMacros,proto3" json:"disable_macros,omitempty"`
	// Specifies a set of macro function names to include in the subset.
	IncludeMacros []string `protobuf:"bytes,3,rep,name=include_macros,json=includeMacros,proto3" json:"include_macros,omitempty"`
	// Specifies a set of macro function names to exclude from the subset.
	// Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
	ExcludeMacros []string `protobuf:"bytes,4,rep,name=exclude_macros,json=excludeMacros,proto3" json:"exclude_macros,omitempty"`
	// Specifies a set of functions to include in the subset.
	//
	// Note: the overloads specified in the subset need only specify their ID.
	// Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
	IncludeFunctions []*expr.Decl `protobuf:"bytes,5,rep,name=include_functions,json=includeFunctions,proto3" json:"include_functions,omitempty"`
	// Specifies the set of functions to exclude from the subset.
	//
	// Note: the overloads specified in the subset need only specify their ID.
	ExcludeFunctions []*expr.Decl `protobuf:"bytes,6,rep,name=exclude_functions,json=excludeFunctions,proto3" json:"exclude_functions,omitempty"`
	// contains filtered or unexported fields
}

LibrarySubset indicates a subset of the macros and functions supported by a subsettable library.

func (*LibrarySubset) GetDisableMacros

func (x *LibrarySubset) GetDisableMacros() bool

func (*LibrarySubset) GetDisabled

func (x *LibrarySubset) GetDisabled() bool

func (*LibrarySubset) GetExcludeFunctions

func (x *LibrarySubset) GetExcludeFunctions() []*expr.Decl

func (*LibrarySubset) GetExcludeMacros

func (x *LibrarySubset) GetExcludeMacros() []string

func (*LibrarySubset) GetIncludeFunctions

func (x *LibrarySubset) GetIncludeFunctions() []*expr.Decl

func (*LibrarySubset) GetIncludeMacros

func (x *LibrarySubset) GetIncludeMacros() []string

func (*LibrarySubset) ProtoMessage

func (*LibrarySubset) ProtoMessage()

func (*LibrarySubset) ProtoReflect

func (x *LibrarySubset) ProtoReflect() protoreflect.Message

func (*LibrarySubset) Reset

func (x *LibrarySubset) Reset()

func (*LibrarySubset) SetDisableMacros

func (x *LibrarySubset) SetDisableMacros(v bool)

func (*LibrarySubset) SetDisabled

func (x *LibrarySubset) SetDisabled(v bool)

func (*LibrarySubset) SetExcludeFunctions

func (x *LibrarySubset) SetExcludeFunctions(v []*expr.Decl)

func (*LibrarySubset) SetExcludeMacros

func (x *LibrarySubset) SetExcludeMacros(v []string)

func (*LibrarySubset) SetIncludeFunctions

func (x *LibrarySubset) SetIncludeFunctions(v []*expr.Decl)

func (*LibrarySubset) SetIncludeMacros

func (x *LibrarySubset) SetIncludeMacros(v []string)

func (*LibrarySubset) String

func (x *LibrarySubset) String() string

type LibrarySubset_builder

type LibrarySubset_builder struct {

	// Indicates whether the library has been disabled, typically only
	// used for default-enabled libraries like stdlib.
	Disabled bool
	// Disables macros for the given library.
	DisableMacros bool
	// Specifies a set of macro function names to include in the subset.
	IncludeMacros []string
	// Specifies a set of macro function names to exclude from the subset.
	// Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
	ExcludeMacros []string
	// Specifies a set of functions to include in the subset.
	//
	// Note: the overloads specified in the subset need only specify their ID.
	// Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
	IncludeFunctions []*expr.Decl
	// Specifies the set of functions to exclude from the subset.
	//
	// Note: the overloads specified in the subset need only specify their ID.
	ExcludeFunctions []*expr.Decl
	// contains filtered or unexported fields
}

func (LibrarySubset_builder) Build

type ParseRequest

type ParseRequest struct {

	// Required. Source text in CEL syntax.
	CelSource string `protobuf:"bytes,1,opt,name=cel_source,json=celSource,proto3" json:"cel_source,omitempty"`
	// Tag for version of CEL syntax, for future use.
	SyntaxVersion string `protobuf:"bytes,2,opt,name=syntax_version,json=syntaxVersion,proto3" json:"syntax_version,omitempty"`
	// File or resource for source text, used in [SourceInfo][google.api.SourceInfo].
	SourceLocation string `protobuf:"bytes,3,opt,name=source_location,json=sourceLocation,proto3" json:"source_location,omitempty"`
	// Prevent macro expansion.  See "Macros" in Language Defiinition.
	DisableMacros bool `protobuf:"varint,4,opt,name=disable_macros,json=disableMacros,proto3" json:"disable_macros,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Parse method.

func (*ParseRequest) GetCelSource

func (x *ParseRequest) GetCelSource() string

func (*ParseRequest) GetDisableMacros

func (x *ParseRequest) GetDisableMacros() bool

func (*ParseRequest) GetSourceLocation

func (x *ParseRequest) GetSourceLocation() string

func (*ParseRequest) GetSyntaxVersion

func (x *ParseRequest) GetSyntaxVersion() string

func (*ParseRequest) ProtoMessage

func (*ParseRequest) ProtoMessage()

func (*ParseRequest) ProtoReflect

func (x *ParseRequest) ProtoReflect() protoreflect.Message

func (*ParseRequest) Reset

func (x *ParseRequest) Reset()

func (*ParseRequest) SetCelSource

func (x *ParseRequest) SetCelSource(v string)

func (*ParseRequest) SetDisableMacros

func (x *ParseRequest) SetDisableMacros(v bool)

func (*ParseRequest) SetSourceLocation

func (x *ParseRequest) SetSourceLocation(v string)

func (*ParseRequest) SetSyntaxVersion

func (x *ParseRequest) SetSyntaxVersion(v string)

func (*ParseRequest) String

func (x *ParseRequest) String() string

type ParseRequest_builder

type ParseRequest_builder struct {

	// Required. Source text in CEL syntax.
	CelSource string
	// Tag for version of CEL syntax, for future use.
	SyntaxVersion string
	// File or resource for source text, used in [SourceInfo][google.api.SourceInfo].
	SourceLocation string
	// Prevent macro expansion.  See "Macros" in Language Defiinition.
	DisableMacros bool
	// contains filtered or unexported fields
}

func (ParseRequest_builder) Build

func (b0 ParseRequest_builder) Build() *ParseRequest

type ParseResponse

type ParseResponse struct {

	// The parsed representation, or unset if parsing failed.
	ParsedExpr *expr.ParsedExpr `protobuf:"bytes,1,opt,name=parsed_expr,json=parsedExpr,proto3" json:"parsed_expr,omitempty"`
	// Any number of issues with [StatusDetails][] as the details.
	Issues *expr.ErrorSet `protobuf:"bytes,2,opt,name=issues,proto3" json:"issues,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Parse method.

func (*ParseResponse) ClearIssues

func (x *ParseResponse) ClearIssues()

func (*ParseResponse) ClearParsedExpr

func (x *ParseResponse) ClearParsedExpr()

func (*ParseResponse) GetIssues

func (x *ParseResponse) GetIssues() *expr.ErrorSet

func (*ParseResponse) GetParsedExpr

func (x *ParseResponse) GetParsedExpr() *expr.ParsedExpr

func (*ParseResponse) HasIssues

func (x *ParseResponse) HasIssues() bool

func (*ParseResponse) HasParsedExpr

func (x *ParseResponse) HasParsedExpr() bool

func (*ParseResponse) ProtoMessage

func (*ParseResponse) ProtoMessage()

func (*ParseResponse) ProtoReflect

func (x *ParseResponse) ProtoReflect() protoreflect.Message

func (*ParseResponse) Reset

func (x *ParseResponse) Reset()

func (*ParseResponse) SetIssues

func (x *ParseResponse) SetIssues(v *expr.ErrorSet)

func (*ParseResponse) SetParsedExpr

func (x *ParseResponse) SetParsedExpr(v *expr.ParsedExpr)

func (*ParseResponse) String

func (x *ParseResponse) String() string

type ParseResponse_builder

type ParseResponse_builder struct {

	// The parsed representation, or unset if parsing failed.
	ParsedExpr *expr.ParsedExpr
	// Any number of issues with [StatusDetails][] as the details.
	Issues *expr.ErrorSet
	// contains filtered or unexported fields
}

func (ParseResponse_builder) Build

type SourcePosition

type SourcePosition struct {

	// The source location name (e.g. file name).
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	// The UTF-8 code unit offset.
	Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// The 1-based index of the starting line in the source text
	// where the issue occurs, or 0 if unknown.
	Line int32 `protobuf:"varint,3,opt,name=line,proto3" json:"line,omitempty"`
	// The 0-based index of the starting position within the line of source text
	// where the issue occurs.  Only meaningful if line is nonzero.
	Column int32 `protobuf:"varint,4,opt,name=column,proto3" json:"column,omitempty"`
	// contains filtered or unexported fields
}

A specific position in source.

func (*SourcePosition) GetColumn

func (x *SourcePosition) GetColumn() int32

func (*SourcePosition) GetLine

func (x *SourcePosition) GetLine() int32

func (*SourcePosition) GetLocation

func (x *SourcePosition) GetLocation() string

func (*SourcePosition) GetOffset

func (x *SourcePosition) GetOffset() int32

func (*SourcePosition) ProtoMessage

func (*SourcePosition) ProtoMessage()

func (*SourcePosition) ProtoReflect

func (x *SourcePosition) ProtoReflect() protoreflect.Message

func (*SourcePosition) Reset

func (x *SourcePosition) Reset()

func (*SourcePosition) SetColumn

func (x *SourcePosition) SetColumn(v int32)

func (*SourcePosition) SetLine

func (x *SourcePosition) SetLine(v int32)

func (*SourcePosition) SetLocation

func (x *SourcePosition) SetLocation(v string)

func (*SourcePosition) SetOffset

func (x *SourcePosition) SetOffset(v int32)

func (*SourcePosition) String

func (x *SourcePosition) String() string

type SourcePosition_builder

type SourcePosition_builder struct {

	// The source location name (e.g. file name).
	Location string
	// The UTF-8 code unit offset.
	Offset int32
	// The 1-based index of the starting line in the source text
	// where the issue occurs, or 0 if unknown.
	Line int32
	// The 0-based index of the starting position within the line of source text
	// where the issue occurs.  Only meaningful if line is nonzero.
	Column int32
	// contains filtered or unexported fields
}

func (SourcePosition_builder) Build

type Validator

type Validator struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional configurations to be included as part of the validation
	Config map[string]*structpb.Value `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a named validator with an optional map-based configuration object. Naming convention followed by validators:

<domain>.validator.<validator_name>

For ex:

`cel.validator.timestamp`

Note: the map-keys must directly correspond to the internal representation of the original validator, and should only use primitive scalar types as values at this time.

func (*Validator) GetConfig

func (x *Validator) GetConfig() map[string]*structpb.Value

func (*Validator) GetName

func (x *Validator) GetName() string

func (*Validator) ProtoMessage

func (*Validator) ProtoMessage()

func (*Validator) ProtoReflect

func (x *Validator) ProtoReflect() protoreflect.Message

func (*Validator) Reset

func (x *Validator) Reset()

func (*Validator) SetConfig

func (x *Validator) SetConfig(v map[string]*structpb.Value)

func (*Validator) SetName

func (x *Validator) SetName(v string)

func (*Validator) String

func (x *Validator) String() string

type Validator_builder

type Validator_builder struct {
	Name string
	// Additional configurations to be included as part of the validation
	Config map[string]*structpb.Value
	// contains filtered or unexported fields
}

func (Validator_builder) Build

func (b0 Validator_builder) Build() *Validator

Source Files

  • conformance_service.pb.go
  • env_config.pb.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL