mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 20:03:14 -06:00
96800d747b
Signed-off-by: Colin Lacy <colinjlacy@gmail.com>
24 lines
347 B
Go
24 lines
347 B
Go
package exec
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/open-policy-agent/opa/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)
|
|
}
|