render

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataToContext

func DataToContext(data interface{}) tmplsvr.Context

func WriteContentType

func WriteContentType(w http.ResponseWriter, value []string)

--------------------------------------------------------------------------------

Types

type Render

type Render struct {
	TemplateDir string
	Cache       bool
}

func NewRender

func NewRender(templateDir string) *Render

func (*Render) HTML

func (this *Render) HTML(w http.ResponseWriter, status int, name string, data interface{})

func (*Render) Template

func (this *Render) Template(name string) *Template

func (*Render) TemplateFromString

func (this *Render) TemplateFromString(tpl string) *Template

type Template

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

--------------------------------------------------------------------------------

func (*Template) Execute

func (this *Template) Execute(data interface{}) (string, error)

func (*Template) ExecuteWriter

func (this *Template) ExecuteWriter(w http.ResponseWriter, data interface{}) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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