builtins

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegalIsFormattedMeta = &rego.Function{
	Name: "regal.is_formatted",
	Decl: types.NewFunction(
		types.Args(
			types.Named("input", types.S).
				Description("input string to check for formatting"),
			types.Named("options", types.NewObject(nil, types.NewDynamicProperty(types.S, types.A))).
				Description("formatting options"),
		),
		types.B,
	),
}

RegalIsFormattedMeta metadata for regal.is_formatted.

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 RegalIsFormatted added in v0.31.0

func RegalIsFormatted(_ rego.BuiltinContext, input *ast.Term, options *ast.Term) (*ast.Term, error)

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