tmpl

package
v0.0.0-...-873615e Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(tpl string, data any) (string, error)

Evaluate parses the template and then executes it with the given parameters.

func EvaluateAll

func EvaluateAll(data any, templates ...string) ([]string, error)

EvaluateAll calls Evaluate the same data args against each of the given templates.

func EvaluateAllFiles

func EvaluateAllFiles(data any, filePaths ...string) ([]string, error)

func EvaluateAllFilesOrFail

func EvaluateAllFilesOrFail(t test.Failer, data any, filePaths ...string) []string

func EvaluateAllOrFail

func EvaluateAllOrFail(t test.Failer, data any, templates ...string) []string

EvaluateAllOrFail calls Evaluate and fails t if an error occurs.

func EvaluateFile

func EvaluateFile(filePath string, data any) (string, error)

func EvaluateFileOrFail

func EvaluateFileOrFail(t test.Failer, filePath string, data any) string

func EvaluateOrFail

func EvaluateOrFail(t test.Failer, tpl string, data any) string

EvaluateOrFail calls Evaluate and fails tests if it returns error.

func Execute

func Execute(t *template.Template, data any) (string, error)

Execute the template with the given parameters.

func ExecuteOrFail

func ExecuteOrFail(t test.Failer, t2 *template.Template, data any) string

ExecuteOrFail calls Execute and fails the test if it returns an error.

func MustEvaluate

func MustEvaluate(tpl string, data any) string

MustEvaluate calls Evaluate and panics if there is an error.

func MustEvaluateAll

func MustEvaluateAll(data any, templates ...string) []string

func MustEvaluateFile

func MustEvaluateFile(filePath string, data any) string

func MustParse

func MustParse(tpl string) *template.Template

MustParse calls Parse and panics if it returns error.

func Parse

func Parse(tpl string) (*template.Template, error)

Parse the given template content.

func ParseOrFail

func ParseOrFail(t test.Failer, tpl string) *template.Template

ParseOrFail calls Parse and fails tests if it returns error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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