builtins

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegalJSONPrettyMeta = &rego.Function{
	Name: "regal.json_pretty",
	Decl: types.NewFunction(
		types.Args(
			types.Named("data", types.A).Description("data to marshal to JSON in a pretty format"),
		),
		types.Named("output", types.S),
	),
}

RegalJSONPrettyMeta metadata for regal.json_pretty.

View Source
var RegalLastMeta = &rego.Function{
	Name: "regal.last",
	Decl: types.NewFunction(
		types.Args(
			types.Named("array", types.NewArray(nil, types.A)).
				Description("performance optimized last index retrieval"),
		),
		types.Named("element", types.A),
	),
}

RegalLastMeta metadata for regal.last.

View Source
var RegalParseModuleMeta = &rego.Function{
	Name: "regal.parse_module",
	Decl: types.NewFunction(
		types.Args(
			types.Named("filename", types.S).Description("file name to attach to AST nodes' locations"),
			types.Named("rego", types.S).Description("Rego module"),
		),
		types.Named("output", types.NewObject(nil, types.NewDynamicProperty(types.S, types.A))),
	),
}

RegalParseModuleMeta metadata for regal.parse_module.

Functions

func RegalJSONPretty

func RegalJSONPretty(_ rego.BuiltinContext, data *ast.Term) (*ast.Term, error)

RegalJSONPretty regal.json_pretty, like json.marshal but with pretty formatting.

func RegalLast

func RegalLast(_ rego.BuiltinContext, arr *ast.Term) (*ast.Term, error)

RegalLast regal.last returns the last element of an array.

func RegalParseModule

func RegalParseModule(_ rego.BuiltinContext, filename *ast.Term, policy *ast.Term) (*ast.Term, error)

RegalParseModule regal.parse_module, like rego.parse_module but with location data included in AST.

func TestContextBuiltins

func TestContextBuiltins() []*tester.Builtin

TestContextBuiltins returns the list of builtins as expected by the test runner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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