template

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine 是模板引擎的核心结构

func New

func New(fs embed.FS) *Engine

New 创建一个新的模板引擎实例

func (*Engine) Execute

func (e *Engine) Execute(templateName string, data interface{}) (string, error)

Execute 执行模板渲染

func (*Engine) GetTemplates

func (e *Engine) GetTemplates() map[string]*template.Template

GetTemplates 返回所有已加载的模板

func (*Engine) LoadTemplates

func (e *Engine) LoadTemplates() error

LoadTemplates 从嵌入的文件系统中加载所有模板文件

Jump to

Keyboard shortcuts

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