package opa
import "github.com/open-policy-agent/opa/internal/rego/opa"
Index ¶
- Variables
- func RegisterEngine(name string, e Engine)
- type Engine
- type EvalEngine
- type EvalOpts
- type Result
Variables ¶
var ErrEngineNotFound error = &errEngineNotFound{}
ErrEngineNotFound is returned by LookupEngine if no wasm engine was registered by that name.
Functions ¶
func RegisterEngine ¶
RegisterEngine registers an evaluation engine by its target name. Note that the "rego" target is always available.
Types ¶
type Engine ¶
type Engine interface { New() EvalEngine }
Engine repesents a factory for instances of EvalEngine implementations
func LookupEngine ¶
LookupEngine allows retrieving an engine registered by name
type EvalEngine ¶
type EvalEngine interface { Init() (EvalEngine, error) Entrypoints(context.Context) (map[string]int32, error) WithPolicyBytes([]byte) EvalEngine WithDataJSON(interface{}) EvalEngine Eval(context.Context, EvalOpts) (*Result, error) SetData(context.Context, interface{}) error SetDataPath(context.Context, []string, interface{}) error RemoveDataPath(context.Context, []string) error Close() }
EvalEngine is the interface implemented by an engine used to eval a policy
type EvalOpts ¶
type EvalOpts struct { Input *interface{} Metrics metrics.Metrics Entrypoint int32 Time time.Time Seed io.Reader InterQueryBuiltinCache cache.InterQueryCache NDBuiltinCache builtins.NDBCache PrintHook print.Hook Capabilities *ast.Capabilities }
EvalOpts define options for performing an evaluation.
type Result ¶
type Result struct { Result []byte }
Result holds the evaluation result.
Source Files ¶
- Version
- v0.53.0
- Published
- May 26, 2023
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 4 minutes ago –
Tools for package owners.