package wasm

import "github.com/open-policy-agent/opa/v1/features/wasm"

Import this package to enable evaluation of rego code using the built-in wasm engine.

Index

Types

type OPA

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

OPA is an implementation of the OPA SDK.

func (*OPA) Close

func (o *OPA) Close()

func (*OPA) Entrypoints

func (o *OPA) Entrypoints(ctx context.Context) (map[string]int32, error)

func (*OPA) Eval

func (o *OPA) Eval(ctx context.Context, opts opa.EvalOpts) (*opa.Result, error)

Eval evaluates the policy.

func (*OPA) Init

func (o *OPA) Init() (opa.EvalEngine, error)

Init initializes the OPA instance.

func (*OPA) RemoveDataPath

func (o *OPA) RemoveDataPath(ctx context.Context, path []string) error

func (*OPA) SetData

func (o *OPA) SetData(ctx context.Context, data interface{}) error

func (*OPA) SetDataPath

func (o *OPA) SetDataPath(ctx context.Context, path []string, data interface{}) error

func (*OPA) WithDataJSON

func (o *OPA) WithDataJSON(data interface{}) opa.EvalEngine

WithDataJSON configures the JSON data to load.

func (*OPA) WithPolicyBytes

func (o *OPA) WithPolicyBytes(policy []byte) opa.EvalEngine

WithPolicyBytes configures the compiled policy to load.

Source Files

wasm.go

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

Tools for package owners.