engine

package
v0.0.0-...-748ee5e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PackageMain = "main"

PackageMain is the name of the main package. To ease the usage, we will only use rules from main package.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryOptions

type QueryOptions struct {
}

QueryOptions controls the query behavior.

type Queryer

type Queryer interface {
	// Query executes the query.
	// The query call is expected to concurrent safe.
	Query(
		ctx context.Context,
		source source.Source,
		opts ...*QueryOptions,
	) (result.QueryResults, error)
}

Queryer performs queries against a target.

type QueryerBuilder

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

QueryerBuilder constructs a Queryer.

func QueryWithPolicy

func QueryWithPolicy(policyPaths []string) *QueryerBuilder

QueryWithPolicy creates a QueryerBuilder with loading packages from the given paths.

func (*QueryerBuilder) Complete

func (qb *QueryerBuilder) Complete() (Queryer, error)

Complete constructs the Queryer.

type RegoEngine

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

RegoEngine is the OPA based query engine implementation.

func (*RegoEngine) Query

func (engine *RegoEngine) Query(
	ctx context.Context,
	source source.Source,
	opts ...*QueryOptions,
) (result.QueryResults, error)

Jump to

Keyboard shortcuts

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