lang

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package lang chooses a language runtime for expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler interface {
	// Compile creates a compiled expression from a string expression
	Compile(expr string) (compiled.Expression, v1beta1.ValueType, error)
}

Compiler creates a compiled expression from a string expression

func NewBuilder

func NewBuilder(finder ast.AttributeDescriptorFinder, mode LanguageRuntime) Compiler

NewBuilder returns an expression builder

type LanguageRuntime

type LanguageRuntime int

LanguageRuntime enumerates the expression languages supported by istio

const (
	// CEXL is legacy istio expression language
	CEXL LanguageRuntime = iota

	// CEL is Common Expression Language (https://github.com/google/cel-spec)
	CEL

	// COMPAT is a hybrid with CEXL syntax but CEL semantics
	COMPAT

	// LanguageRuntimeAnnotation on config resources to select a language runtime
	LanguageRuntimeAnnotation = "policy.istio.io/lang"
)

func GetLanguageRuntime

func GetLanguageRuntime(annotations map[string]string) LanguageRuntime

GetLanguageRuntime reads an override from a resource annotation

func (LanguageRuntime) String

func (mode LanguageRuntime) String() string

type TypeChecker

type TypeChecker = checker.TypeChecker

TypeChecker interface (bound to legacy one)

func NewTypeChecker

func NewTypeChecker(finder ast.AttributeDescriptorFinder, mode LanguageRuntime) TypeChecker

NewTypeChecker returns a type checker

Jump to

Keyboard shortcuts

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