Documentation ¶
Index ¶
- type Engine
- func (en *Engine) Close() error
- func (en *Engine) ErrorName(name string) string
- func (en *Engine) Init()
- func (en *Engine) PageName(name string) string
- func (en *Engine) RenderError(w io.Writer, name string, data H, opts ...Option)
- func (en *Engine) RenderPage(w io.Writer, name string, data H, opts ...Option)
- func (en *Engine) RenderSingle(w io.Writer, name string, data H, opts ...Option)
- func (en *Engine) SingleName(name string) string
- func (en *Engine) Watching() error
- type FuncMap
- type H
- type LoadTemplateFunc
- type Option
- type Options
- type Render
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { Errors <-chan error FuncMap FuncMap HTMLRender Render // contains filtered or unexported fields }
Engine 模板引擎
func NewEngine ¶
func NewEngine(templateDir string, tmplFunc LoadTemplateFunc, funcMap FuncMap, opts ...Option) (*Engine, error)
NewEngine 创建一个gin引擎模板
func (*Engine) RenderError ¶
RenderError 渲染错误页面
func (*Engine) RenderPage ¶
RenderPage 渲染页面
func (*Engine) RenderSingle ¶
RenderSingle 渲染单页面
type LoadTemplateFunc ¶
LoadTemplateFunc 加载模板函数类
type Option ¶
type Option func(*Options)
Option 为可选参数赋值的函数
func GlobalConstant ¶
GlobalConstant ...
func GlobalVariable ¶
GlobalVariable ...
type Options ¶
type Options struct { StatusCode int Layout string GlobalVariable map[string]interface{} GlobalConstant map[string]interface{} }
Options 可选参数列表
type Render ¶
Render type
func DefaultLoadTemplate ¶
DefaultLoadTemplate ...
func (Render) AddFromFilesFuncs ¶
AddFromFilesFuncs supply add template from file callback func
Click to show internal directories.
Click to hide internal directories.