compiler

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package compiler contains a suite of tools for covering parsed representations of CEL Policy Template sources into type-checked and validated in-memory representations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

Compiler type-checks and compiles a raw model.ParsedValue into a strongly typed in-memory representation of a template or policy instance.

func NewCompiler

func NewCompiler(reg *model.Registry, l *limits.Limits, rtOpts ...runtime.TemplateOption) *Compiler

NewCompiler creates a new Compiler instance with the given Registry and CEL evaluation options.

func (*Compiler) CompileEnv

func (c *Compiler) CompileEnv(src *model.Source, parsedEnv *model.ParsedValue) (*model.Env, *cel.Issues)

CompileEnv type-checks and builds model.Env instance from a parsed representation.

The resulting model.Env value may be used to extend a base CEL environment with additional variable, function, and type declarations.

func (*Compiler) CompileInstance

func (c *Compiler) CompileInstance(src *model.Source, parsedInst *model.ParsedValue) (*model.Instance, *cel.Issues)

CompileInstance type-checks and validates a parsed representation of a policy instance whose format and validation logic is also determined by policy template referenced in the policy instance 'kind' field.

func (*Compiler) CompileSchema

func (c *Compiler) CompileSchema(src *model.Source, parsedSchema *model.ParsedValue) (*model.OpenAPISchema, *cel.Issues)

CompileSchema validates a parsed representation of a type schema and produces an OpenAPISchema as output.

func (*Compiler) CompileTemplate

func (c *Compiler) CompileTemplate(src *model.Source, parsedTmpl *model.ParsedValue) (*model.Template, *cel.Issues)

CompileTemplate type-checks and validates a parsed representation of a policy template.

Jump to

Keyboard shortcuts

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