package planner
import "github.com/open-policy-agent/opa/internal/planner"
Package planner contains a query planner for Rego queries.
Index ¶
- type Planner
- func New() *Planner
- func (p *Planner) Plan() (*ir.Policy, error)
- func (p *Planner) WithBuiltinDecls(decls map[string]*ast.Builtin) *Planner
- func (p *Planner) WithDebug(sink io.Writer) *Planner
- func (p *Planner) WithModules(modules []*ast.Module) *Planner
- func (p *Planner) WithQueries(queries []QuerySet) *Planner
- type QuerySet
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 ¶
Plan returns a IR plan for the policy query.
func (*Planner) WithBuiltinDecls ¶
WithBuiltinDecls tells the planner what built-in function may be available inside the execution environment.
func (*Planner) WithDebug ¶
WithDebug sets where debug messages are written to.
func (*Planner) WithModules ¶
WithModules sets the module set that contains query dependencies.
func (*Planner) WithQueries ¶
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 ¶
QuerySet represents the input to the planner.
Source Files ¶
planner.go rules.go varstack.go
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 6 hours ago –
Tools for package owners.