templating

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

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

Execute runs Execute function from input tmpl with input data and write result to given dest file.

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns a minimal template.FuncMap.

Available functions are fromYaml, map, prefix, suffix and toYaml.

Types

type Option

type Option func(*template.Template) *template.Template

Option represents a function taking as input a template to potentially alter it.

Use with caution. You may use predefined options like WithDelims to avoid unexpected template modifications.

func WithDelims

func WithDelims(left, right string) Option

WithDelims is an option for ApplyTemplate to use custom go template delimiters.

Jump to

Keyboard shortcuts

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