planner

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package planner contains a query planner for Rego queries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Planner

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

Planner implements a query planner for Rego queries.

func New

func New() *Planner

New returns a new Planner object.

func (*Planner) Plan

func (p *Planner) Plan() (*ir.Policy, error)

Plan returns a IR plan for the policy query.

func (*Planner) WithBuiltinDecls added in v0.15.1

func (p *Planner) WithBuiltinDecls(decls map[string]*ast.Builtin) *Planner

WithBuiltinDecls tells the planner what built-in function may be available inside the execution environment.

func (*Planner) WithDebug added in v0.27.0

func (p *Planner) WithDebug(sink io.Writer) *Planner

WithDebug sets where debug messages are written to.

func (*Planner) WithModules added in v0.11.0

func (p *Planner) WithModules(modules []*ast.Module) *Planner

WithModules sets the module set that contains query dependencies.

func (*Planner) WithQueries

func (p *Planner) WithQueries(queries []QuerySet) *Planner

WithQueries sets the query sets to generate a plan for. The rewritten collection provides a mapping of rewritten query vars for each query set. The planner uses rewritten variables but the result set key will be the original variable name.

type QuerySet added in v0.25.0

type QuerySet struct {
	Name          string
	Queries       []ast.Body
	RewrittenVars map[ast.Var]ast.Var
}

QuerySet represents the input to the planner.

Jump to

Keyboard shortcuts

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