opa

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigOPA

func ConfigOPA(conf any) func(opa *OPA) error

ConfigOPA sets the configuration file to use on the OPA instance.

func NewPolicyCompiler

func NewPolicyCompiler() opa.PolicyCompiler

NewPolicyCompiler returns a new instance of the default implementation of the opa.PolicyCompiler.

Types

type OPA

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

OPA represents an instance of the policy engine.

func NewOPA

func NewOPA(ctx context.Context, regosPath string, opts ...func(*OPA) error) (*OPA, error)

Returns a new OPA instance.

func (*OPA) LoadRegosFromPath

func (opa *OPA) LoadRegosFromPath(ctx context.Context, regosPath string) error

func (*OPA) PartialEvaluate

func (opa *OPA) PartialEvaluate(ctx context.Context, input any, query string, opts ...func(*rego.Rego)) (*rego.PartialQueries, error)

PartialEvaluate partially evaluates the query and returns any partial queries which needs additional data to eval

func (*OPA) Start

func (opa *OPA) Start(ctx context.Context) error

Start asynchronously starts the policy engine's plugins that download policies, report status, etc.

Jump to

Keyboard shortcuts

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