render

package
v1.0.2-0...-2da3d3e Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageHandler

type PageHandler func(
	w http.ResponseWriter,
	r *http.Request,
) (templateName string, data interface{}, err error)

type Renderer

type Renderer struct {
	Version string
	BaseURL string
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(templates Templates, baseURL string, version string) *Renderer

func (*Renderer) Render

func (tr *Renderer) Render(h PageHandler) http.HandlerFunc

type Templates

type Templates map[string]*template.Template

func ParseTemplates

func ParseTemplates(box packr.Box) Templates

func (Templates) Get

func (t Templates) Get(name string) (tpl *template.Template, ok bool)

Jump to

Keyboard shortcuts

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