Files
releases/resolver/interface.go
T
Patrick East f84f4674a1 Add support for evaluating Wasm bundles
This is largely plumbing changes required to get Wasm modules loaded
from bundles and configured as external resolvers for evaluations.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-11-06 15:12:38 -05:00

28 lines
572 B
Go

// Copyright 2020 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package resolver
import (
"context"
"github.com/open-policy-agent/opa/ast"
)
// Resolver defines an external value resolver for OPA evaluations.
type Resolver interface {
Eval(context.Context, Input) (Result, error)
}
// Input as provided to a Resolver instance when evaluating.
type Input struct {
Ref ast.Ref
Input *ast.Term
}
// Result of resolving a ref.
type Result struct {
Value ast.Value
}