Help us shape the future of Go! Take the 2026 Go Developer Survey

rego

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const REPORT_QUERY = "data.fugue.regula.report"
View Source
const SCAN_VIEW_QUERY = "data.fugue.regula.scan_view"

Variables

This section is empty.

Functions

func RegisterBuiltins

func RegisterBuiltins()

func RegoStringSet

func RegoStringSet(items []string) (string, error)

func RegulaRuntimeConfig

func RegulaRuntimeConfig() *ast.Term

Returns information used by the `opa.runtime()` builtin.

func RunREPL

func RunREPL(ctx context.Context, options *RunREPLOptions) error

func RunTest

func RunTest(ctx context.Context, options *RunTestOptions) error

Types

type RegoFile

type RegoFile interface {
	Raw() []byte
	String() string
	AstModule() (*ast.Module, error)
	RegoModule() func(r *rego.Rego)
	Path() string
}

func NewTestInput

func NewTestInput(regulaInput loader.RegulaInput) (RegoFile, error)

func RegoFileFromString

func RegoFileFromString(path string, contents string) RegoFile

type RegoProcessor

type RegoProcessor func(r RegoFile) error

type RegoProvider

type RegoProvider func(ctx context.Context, p RegoProcessor) error

func FSProvider

func FSProvider(fsys fs.FS, path string) RegoProvider

func LocalProvider

func LocalProvider(paths []string) RegoProvider

func RegulaConfigProvider

func RegulaConfigProvider(excludes []string, only []string) RegoProvider

func RegulaLibProvider

func RegulaLibProvider() RegoProvider

func RegulaRulesProvider

func RegulaRulesProvider() RegoProvider

func TarGzProvider

func TarGzProvider(reader io.Reader) RegoProvider

func TestInputsProvider

func TestInputsProvider(paths []string, inputTypes []loader.InputType) RegoProvider

type RegoResult

type RegoResult *rego.Result

func RunRules

func RunRules(ctx context.Context, options *RunRulesOptions) (RegoResult, error)

type RegoResultProcessor

type RegoResultProcessor func(ctx context.Context, c loader.LoadedConfigurations, r RegoResult) error

type RunREPLOptions

type RunREPLOptions struct {
	Providers []RegoProvider
}

type RunRulesOptions

type RunRulesOptions struct {
	Providers []RegoProvider
	Input     []loader.RegulaInput
	Query     string
}

type RunTestOptions

type RunTestOptions struct {
	Providers []RegoProvider
	Trace     bool
}

type TestsFailedError

type TestsFailedError struct {
	// contains filtered or unexported fields
}

func (*TestsFailedError) Error

func (e *TestsFailedError) Error() string

Jump to

Keyboard shortcuts

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