Documentation
¶
Overview ¶
Package planner contains a query planner for Rego queries.
Index ¶
- type 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
- func (p *Planner) WithUnplannedRules(yes bool) *Planner
- type QuerySet
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 (*Planner) WithBuiltinDecls ¶ added in v0.15.1
WithBuiltinDecls tells the planner what built-in function may be available inside the execution environment.
func (*Planner) WithModules ¶ added in v0.11.0
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.
func (*Planner) WithUnplannedRules ¶ added in v1.20.0
WithUnplannedRules controls whether the resulting policy includes the list of rules that were parsed but never planned (i.e. not reachable from any entrypoint). Disabled by default.