From 6ef8852201c0643778b3c27574390ab81bdbc507 Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Tue, 17 Dec 2024 10:26:39 +0000 Subject: [PATCH] docs: Use v1 imports in integration docs Trying to make these changes as small changes to aid review. Signed-off-by: Charlie Egan --- docs/content/integration.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/content/integration.md b/docs/content/integration.md index ad198b1f67..7b9a6b8cb4 100644 --- a/docs/content/integration.md +++ b/docs/content/integration.md @@ -22,20 +22,19 @@ This page focuses predominantly on different ways to integrate with OPA's policy - See the [Health API](../rest-api#health-api) for checking agent deployment readiness and health. - See the [Prometheus API endpoint](../monitoring/#prometheus) to obtain insight into performance and errors. - ## Evaluating Policies OPA supports different ways to evaluate policies. * The [REST API](../rest-api) returns decisions as JSON over HTTP. * Also see the [Language SDKs](/ecosystem/#languages) for working with the REST API in different languages. -* The [Go API (GoDoc)](https://pkg.go.dev/github.com/open-policy-agent/opa/rego) returns +* The [Go API (GoDoc)](https://pkg.go.dev/github.com/open-policy-agent/opa/v1/rego) returns decisions as simple Go types (`bool`, `string`, `map[string]interface{}`, etc.) * [WebAssembly](../wasm) compiles Rego policies into Wasm instructions so they can be embedded and evaluated by any WebAssembly runtime * Custom compilers and evaluators may be written to parse evaluation plans in the low-level [Intermediate Representation](../ir) format, which can be emitted by the `opa build` command -* The [SDK](https://pkg.go.dev/github.com/open-policy-agent/opa/sdk) provides high-level APIs for obtaining the output +* The [SDK](https://pkg.go.dev/github.com/open-policy-agent/opa/v1/sdk) provides high-level APIs for obtaining the output of query evaluation as simple Go types (`bool`, `string`, `map[string]interface{}`, etc.) ### Integrating with the REST API @@ -205,8 +204,8 @@ import ( "context" "fmt" - "github.com/open-policy-agent/opa/sdk" - sdktest "github.com/open-policy-agent/opa/sdk/test" + "github.com/open-policy-agent/opa/v1/sdk" + sdktest "github.com/open-policy-agent/opa/v1/sdk/test" ) func main() { @@ -277,7 +276,7 @@ be created each time the SDK is initialized, such as when the process is restart ### Integrating with the Go API Use the low-level -[github.com/open-policy-agent/opa/rego](https://pkg.go.dev/github.com/open-policy-agent/opa/rego) +[github.com/open-policy-agent/opa/v1/rego](https://pkg.go.dev/github.com/open-policy-agent/opa/v1/rego) package to embed OPA as a library inside services written in Go, when only policy **evaluation** — and no other capabilities of OPA, like the management features — are desired. If you're unsure which one to use, the SDK is probably the better option. @@ -285,7 +284,7 @@ use, the SDK is probably the better option. To get started import the `rego` package: ```go -import "github.com/open-policy-agent/opa/rego" +import "github.com/open-policy-agent/opa/v1/rego" ``` The `rego` package exposes different options for customizing how policies are @@ -385,7 +384,7 @@ if !results.Allowed() { ``` For more examples of embedding OPA as a library see the -[`rego`](https://pkg.go.dev/github.com/open-policy-agent/opa/rego#pkg-examples) +[`rego`](https://pkg.go.dev/github.com/open-policy-agent/opa/v1/rego#pkg-examples) package in the Go documentation. #### Ecosystem Projects