package compile

import "github.com/open-policy-agent/opa/compile"

Package compile implements bundles compilation and linking.

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Index

Constants

const (
	// TargetRego is the default target. The source rego is copied (potentially
	// rewritten for optimization purpsoes) into the bundle. The target supports
	// base documents.
	TargetRego = v1.TargetRego

	// TargetWasm is an alternative target that compiles the policy into a wasm
	// module instead of Rego. The target supports base documents.
	TargetWasm = v1.TargetWasm

	// TargetPlan is an altertive target that compiles the policy into an
	// imperative query plan that can be further transpiled or interpreted.
	TargetPlan = v1.TargetPlan
)

Variables

var Targets = v1.Targets

Targets contains the list of targets supported by the compiler.

Types

type Compiler

type Compiler = v1.Compiler

Compiler implements bundle compilation and linking.

func New

func New() *Compiler

New returns a new compiler instance that can be invoked.

Source Files

compile.go doc.go

Version
v1.4.2 (latest)
Published
May 2, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
6 hours ago

Tools for package owners.