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 ¶
- type Compiler
- func (c *Compiler) CompileEnv(src *model.Source, parsedEnv *model.ParsedValue) (*model.Env, *cel.Issues)
- func (c *Compiler) CompileInstance(src *model.Source, parsedInst *model.ParsedValue) (*model.Instance, *cel.Issues)
- func (c *Compiler) CompileSchema(src *model.Source, parsedSchema *model.ParsedValue) (*model.OpenAPISchema, *cel.Issues)
- func (c *Compiler) CompileTemplate(src *model.Source, parsedTmpl *model.ParsedValue) (*model.Template, *cel.Issues)
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 ¶
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.