kmgHtmlTemplate

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileSet

func FileSet(t *template.Template, templs []TemplateFile) (ot *template.Template, err error)

something like template.ParseFile but in memory

func MustRenderToWriter

func MustRenderToWriter(w io.Writer, text string, data interface{})

func RenderToByte

func RenderToByte(text string, data interface{}) (b []byte, err error)

func RenderToWriter

func RenderToWriter(w io.Writer, text string, data interface{}) (err error)

Types

type Template

type Template struct {
	*template.Template
}

func MustNewSingle

func MustNewSingle(templ string) *Template

func (*Template) ExecuteNameToByte

func (templ *Template) ExecuteNameToByte(name string, data interface{}) ([]byte, error)

func (*Template) ExecuteNameToHtml

func (templ *Template) ExecuteNameToHtml(name string, data interface{}) (html template.HTML, err error)

func (*Template) ExecuteToByte

func (templ *Template) ExecuteToByte(data interface{}) ([]byte, error)

func (*Template) MustExecuteNameToHtml

func (templ *Template) MustExecuteNameToHtml(name string, data interface{}) template.HTML

func (*Template) MustExecuteToHtml

func (templ *Template) MustExecuteToHtml(data interface{}) template.HTML

type TemplateFile

type TemplateFile struct {
	Name    string
	Content string
}

Jump to

Keyboard shortcuts

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