Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentType = "Content-Type" ContentLength = "Content-Length" ContentBinary = "application/octet-stream" ContentPlain = "text/plain" ContentJSON = "application/json" ContentHTML = "text/html" ContentXHTML = "application/xhtml+xml" ContentXML = "text/xml" )
Variables ¶
This section is empty.
Functions ¶
func LoadWithFuncMap ¶
LoadWithFuncMap prepares and parses all templates from the passed basePath and injects a custom template.FuncMap into each template
Types ¶
type Options ¶
type Options struct { // Directory to load templates. Default is "templates" Directory string // Extensions to parse template files from. Defaults to [".tmpl"] Extensions []string // Funcs is a slice of FuncMaps to apply to the template upon compilation. This is useful for helper functions. Defaults to []. Funcs template.FuncMap // Appends the given charset to the Content-Type header. Default is "UTF-8". Charset string // Outputs human readable JSON IndentJSON bool // Outputs human readable XML IndentXML bool // Prefixes the JSON output with the given bytes. PrefixJSON []byte // Prefixes the XML output with the given bytes. PrefixXML []byte // Allows changing of output to XHTML instead of HTML. Default is "text/html" HTMLContentType string }
Options is a struct for specifying configuration options for the render.Renderer middleware
Click to show internal directories.
Click to hide internal directories.