opa: github.com/open-policy-agent/opa/internal/planner Index | Files

package planner

import "github.com/open-policy-agent/opa/internal/planner"

Package planner contains a query planner for Rego queries.

Index

Package Files

planner.go rules.go varstack.go

type Planner Uses

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

Planner implements a query planner for Rego queries.

func New Uses

func New() *Planner

New returns a new Planner object.

func (*Planner) Plan Uses

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

Plan returns a IR plan for the policy query.

func (*Planner) WithBuiltinDecls Uses

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) WithModules Uses

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

WithModules sets the module set that contains query dependencies.

func (*Planner) WithQueries Uses

func (p *Planner) WithQueries(queries []ast.Body) *Planner

WithQueries sets the query set to generate a plan for.

func (*Planner) WithRewrittenVars Uses

func (p *Planner) WithRewrittenVars(vs map[ast.Var]ast.Var) *Planner

WithRewrittenVars sets a mapping of rewritten query vars on the planner. The plan will use the rewritten variable name but the result set key will be the original variable name.

Package planner imports 5 packages (graph) and is imported by 2 packages. Updated 2019-11-21. Refresh now. Tools for package owners.