templating

package
v0.0.0-...-56c4165 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const StdOutVal = "<stdout>"

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterError

type FilterError struct {
	Reason string
}

func (FilterError) Error

func (e FilterError) Error() string

type FilterSet

type FilterSet struct {
	OutputFileName string
	Chown          func(name string, uid, gid int) error
	Chmod          func(name string, mode os.FileMode) error
}

FilterSet implements filter-returning functions which can support context information such as the name of the output file.

func (*FilterSet) FilterBytes

func (fs *FilterSet) FilterBytes(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterFromBase64

func (fs *FilterSet) FilterFromBase64(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterFromGzip

func (fs *FilterSet) FilterFromGzip(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterIndent

func (fs *FilterSet) FilterIndent(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterReplace

func (fs *FilterSet) FilterReplace(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterSetGroup

func (fs *FilterSet) FilterSetGroup(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterSetMode

func (fs *FilterSet) FilterSetMode(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterSetOwner

func (fs *FilterSet) FilterSetOwner(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterString

func (fs *FilterSet) FilterString(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterToBase64

func (fs *FilterSet) FilterToBase64(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterToGzip

func (fs *FilterSet) FilterToGzip(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterToJSON

func (fs *FilterSet) FilterToJSON(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterToTOML

func (fs *FilterSet) FilterToTOML(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

func (*FilterSet) FilterToYAML

func (fs *FilterSet) FilterToYAML(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error)

type LoadedTemplate

type LoadedTemplate struct {
	Template    *pongo2.Template
	TemplateSet *pongo2.TemplateSet
}

func LoadTemplate

func LoadTemplate(templatePath string) *LoadedTemplate

type TemplateEngine

type TemplateEngine struct {
	// PrepareOutput is invoked before the engine writes a file and must return a writer
	// which directs the byte output to correct location, and a finalizer function which
	// can be called to finish the write operation.
	PrepareOutput func(inputData pongo2.Context, outputPath string) (io.Writer, func() error, error)
}

func (*TemplateEngine) ExecuteTemplate

func (te *TemplateEngine) ExecuteTemplate(filterSet *FilterSet, tmpl *LoadedTemplate,
	inputData pongo2.Context, outputPath string) error

Jump to

Keyboard shortcuts

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