Documentation ¶
Overview ¶
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.
Index ¶
- func MockBundle(file string, policies map[string]string) func(*Server) error
- func MockOCIBundle(ref string, policies map[string]string) func(*Server) error
- func ParserOptions(popts ast.ParserOptions) func(*Server) error
- func RawBundles(raw bool) func(*Server) error
- func Ready(ch chan struct{}) func(*Server) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockBundle ¶
MockBundle sets a bundle named file on the test server containing the given policies.
func MockOCIBundle ¶ added in v0.41.0
MockOCIBundle prepares the server to allow serving "/v2" OCI responses from the supplied policies Ref parameter must be in the form of <registry>/<org>/<repo>:<tag> that will be used in detecting future calls
func ParserOptions ¶ added in v1.0.0
func ParserOptions(popts ast.ParserOptions) func(*Server) error
ParserOptions sets the ast.ParserOptions to use when parsing modules when preparing bundles.
func RawBundles ¶ added in v0.61.0
Types ¶
type Server ¶
Server provides a mock HTTP server for testing the SDK and integrations.
func MustNewServer ¶
MustNewServer returns a new Server for test purposes or panics if an error occurs.