temps

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFunc

func RegisterFunc(funcName string, funcBody interface{})

funcBody: 函数必须只有1个值或2个值,如果有两个值,第二个值必须是error类型的,当执行函数时err不为空,则执行自动停止。

Types

type TemplateProxy

type TemplateProxy struct {
	Name     string
	Template *template.Template
}

func LoadTemplate

func LoadTemplate(tempFile string) (*TemplateProxy, error)

func LoadTemplates

func LoadTemplates(tempFiles string) (*TemplateProxy, error)

func NewTemplate

func NewTemplate(name string, text string) (*TemplateProxy, error)

func (*TemplateProxy) CloneTemplate

func (p *TemplateProxy) CloneTemplate() *template.Template

func (*TemplateProxy) Execute

func (p *TemplateProxy) Execute(wr io.Writer, data interface{}, clone bool) error

func (*TemplateProxy) ExecuteTemplate

func (p *TemplateProxy) ExecuteTemplate(wr io.Writer, data interface{}, clone bool) error

func (*TemplateProxy) ExecuteTemplateByName

func (p *TemplateProxy) ExecuteTemplateByName(wr io.Writer, name string, data interface{}, clone bool) error

Jump to

Keyboard shortcuts

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