tmpl

package
v1.0.0-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(tpl string, data interface{}) (string, error)

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

func EvaluateAll

func EvaluateAll(data interface{}, templates ...string) ([]string, error)

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

func EvaluateAllFiles

func EvaluateAllFiles(data interface{}, filePaths ...string) ([]string, error)

func EvaluateAllFilesOrFail

func EvaluateAllFilesOrFail(t test.Failer, data interface{}, filePaths ...string) []string

func EvaluateAllOrFail

func EvaluateAllOrFail(t test.Failer, data interface{}, templates ...string) []string

EvaluateAllOrFail calls Evaluate and fails t if an error occurs.

func EvaluateFile

func EvaluateFile(filePath string, data interface{}) (string, error)

func EvaluateFileOrFail

func EvaluateFileOrFail(t test.Failer, filePath string, data interface{}) string

func EvaluateOrFail

func EvaluateOrFail(t test.Failer, tpl string, data interface{}) string

EvaluateOrFail calls Evaluate and fails tests if it returns error.

func Execute

func Execute(t *template.Template, data interface{}) (string, error)

Execute the template with the given parameters.

func ExecuteOrFail

func ExecuteOrFail(t test.Failer, t2 *template.Template, data interface{}) string

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

func MustEvaluate

func MustEvaluate(tpl string, data interface{}) string

MustEvaluate calls Evaluate and panics if there is an error.

func MustEvaluateAll

func MustEvaluateAll(data interface{}, templates ...string) []string

func MustEvaluateFile

func MustEvaluateFile(filePath string, data interface{}) string

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