renderer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERROR_HTML_TEMPLATE = `` /* 9765-byte string literal not displayed */

Functions

func RenderDevelopmentError

func RenderDevelopmentError(w http.ResponseWriter, r *http.Request, err error)

Types

type DevErrorData

type DevErrorData struct {
	Title string
	Res   http.ResponseWriter
	Req   *http.Request
	URI   string
	Trace template.HTML
}

type Engine

type Engine interface {
	// Init should be called for prepare the template engine. Load the template dir, for example.
	Init() error
	// Render is used to render a template
	Render(w http.ResponseWriter, status int, template string, data *sync.Map) error
}

type EngineOptions

type EngineOptions struct {
	// TemplateDir is where all templates is located. Default=templates
	TemplateDir string
	// Default file extension for templates. Default=.html
	Ext string
	// AutoReload if enabled, reload the template from file on each change.
	AutoReload bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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