types

package
v1.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ParamPrintV1 defines the name of the HTTP URL parameter that indicates
	// the client wants to receive output printed by rego in the response.
	ParamPrintV1 = "print"

	// ParamStrictV1 defines the name of the HTTP URL parameter that indicates
	// client wants to compile rego using strict mode.
	ParamStrictV1 = "strict"

	// ParamSandboxV1 defines the name of the HTTP URL parameter that indicates
	// the client wants to only use the rego modules and query sent with the
	// request, not the current state of loaded data and modules.
	ParamSandboxV1 = "sandbox"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PreviewRequestV1

type PreviewRequestV1 struct {
	opaTypes.DataRequestV1
	RegoQuery      string                    `json:"rego"`
	RegoModules    map[string]string         `json:"rego_modules"`
	NDBuiltinCache map[string]map[string]any `json:"nd_builtin_cache"`
	Data           json.RawMessage           `json:"data"`
}

PreviewRequestV1 is an extension of the DataRequestV1 struct adding in the ability to set a specific rego query, add rego modules, send an ND Builtin Cache instance, and set arbitrary data into the environment during preview requests.

type PreviewResponseV1

type PreviewResponseV1 struct {
	opaTypes.DataResponseV1
	Printed string `json:"printed,omitempty"`
}

PreviewResponseV1 is an extension of the DataResponseV1 struct, adding the ability to send text printed by the Rego evaluation back with the response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL