rego

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOSFiles

func LoadOSFiles(paths []string, cb func(r RegoFile) error) error

func LoadRegula

func LoadRegula(userOnly bool, cb func(r RegoFile) error) error

func LoadTestInputs

func LoadTestInputs(paths []string, inputType loader.InputType, cb func(r RegoFile) error) error

func RegisterBuiltins

func RegisterBuiltins()

func RunREPL

func RunREPL(options *RunREPLOptions) error

func RunRules

func RunRules(options *RunRulesOptions) (*rego.Result, error)

RunRules runs regula and user-specified rules on loaded inputs

func RunTest

func RunTest(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)

type RunREPLOptions

type RunREPLOptions struct {
	Ctx          context.Context
	UserOnly     bool
	Includes     []string
	NoTestInputs bool
}

type RunRulesOptions

type RunRulesOptions struct {
	Ctx      context.Context
	UserOnly bool
	Includes []string
	Input    []loader.RegulaInput
}

RunRulesOptions is the set of options for RunRules

type RunTestOptions

type RunTestOptions struct {
	Ctx          context.Context
	Includes     []string
	Trace        bool
	NoTestInputs bool
}

Jump to

Keyboard shortcuts

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