mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
7bb6dbe36b
Moving (most) source to v1 root package to prepare for v0/v1 API separation. Signed-off-by: Johan Fylling <johan.dev@fylling.se>
24 lines
350 B
Go
24 lines
350 B
Go
package exec
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/open-policy-agent/opa/v1/util"
|
|
)
|
|
|
|
type parser interface {
|
|
Parse(io.Reader) (interface{}, error)
|
|
}
|
|
|
|
type utilParser struct {
|
|
}
|
|
|
|
func (utilParser) Parse(r io.Reader) (interface{}, error) {
|
|
bs, err := io.ReadAll(r)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var x interface{}
|
|
return x, util.Unmarshal(bs, &x)
|
|
}
|