Help us shape the future of Go! Take the 2026 Go Developer Survey

wasm

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 any) error

func (*OPA) SetDataPath

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

func (*OPA) WithDataJSON

func (o *OPA) WithDataJSON(data any) 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.

Jump to

Keyboard shortcuts

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