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 ¶
- type OPA
- func (o *OPA) Close()
- func (o *OPA) Entrypoints(ctx context.Context) (map[string]int32, error)
- func (o *OPA) Eval(ctx context.Context, opts opa.EvalOpts) (*opa.Result, error)
- func (o *OPA) Init() (opa.EvalEngine, error)
- func (o *OPA) RemoveDataPath(ctx context.Context, path []string) error
- func (o *OPA) SetData(ctx context.Context, data interface{}) error
- func (o *OPA) SetDataPath(ctx context.Context, path []string, data interface{}) error
- func (o *OPA) WithDataJSON(data interface{}) opa.EvalEngine
- func (o *OPA) WithPolicyBytes(policy []byte) opa.EvalEngine
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 (*OPA) Eval ¶
Eval evaluates the policy.
func (*OPA) Init ¶
func (o *OPA) Init() (opa.EvalEngine, error)
Init initializes the OPA instance.
func (*OPA) RemoveDataPath ¶
func (*OPA) SetData ¶
func (*OPA) SetDataPath ¶
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 ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 hours ago –
Tools for package owners.