template

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Declaration = &rego.Function{
	Name: "template.exec",
	Decl: types.NewFunction(
		types.Args(
			types.NewObject(
				[]*types.StaticProperty{
					{
						Key:   "template",
						Value: types.NewString(),
					},
					{
						Key:   "data",
						Value: types.NewAny(),
					},
				},
				types.NewDynamicProperty(
					types.NewString(),
					types.NewAny(),
				),
			),
		),
		types.S,
	),
}

function declaration

Functions

func Implementation

func Implementation(bctx rego.BuiltinContext, a *ast.Term) (*ast.Term, error)

function implementation

func RegisterBuiltin

func RegisterBuiltin()

helper to register in runtime

func RegoFunc

func RegoFunc() func(r *rego.Rego)

helper to return rego option

Types

type Args

type Args struct {
	HTML     bool        `json:"html"`
	Template string      `json:"template"`
	Data     interface{} `json:"data"`
}

type Template

type Template interface {
	Execute(wr io.Writer, data interface{}) error
}

Jump to

Keyboard shortcuts

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