engine

package
v0.0.0-...-34958c4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: MIT Imports: 12 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 QueryCache

type QueryCache interface {
	// contains filtered or unexported methods
}

QueryCache provides the internal query cache.

func NewQueryCache

func NewQueryCache() QueryCache

NewQueryCache creates a new QueryCache.

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.

func (*QueryerBuilder) QueryWithParsingArmTemplateDefaults

func (qb *QueryerBuilder) QueryWithParsingArmTemplateDefaults(shouldParseDefaults bool) *QueryerBuilder

QueryWithParsingArmTemplateDefaults creates a QueryerBuilder that parses arm template default values

func (*QueryerBuilder) WithQueueCache

func (qb *QueryerBuilder) WithQueueCache(cache QueryCache) *QueryerBuilder

WithQueueCache sets the query cache for 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