compilers

package
v0.0.4-0...-bd9932a Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompilerCEL = expression.CompilerCEL
	CompilerJP  = expression.CompilerJP
)

Variables

View Source
var DefaultCompilers = Compilers{
	Jp:  jp.NewCompiler(),
	Cel: cel.NewCompiler(cel.DefaultEnv),
}

Functions

func Execute

func Execute(statement string, value any, bindings binding.Bindings, compiler Compiler) (any, error)

Types

type Compiler

type Compiler interface {
	Compile(string) (Program, error)
}

type Compilers

type Compilers struct {
	Jp      jp.Compiler
	Cel     cel.Compiler
	Default cel.Compiler
}

func (Compilers) Compiler

func (c Compilers) Compiler(compiler string) Compiler

func (Compilers) WithDefaultCompiler

func (c Compilers) WithDefaultCompiler(defaultCompiler string) Compilers

type Program

type Program = func(any, binding.Bindings) (any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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