templates

package
v2.0.0-beta11 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 24 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Templates

type Templates struct {
	// The root path from which to load files. Required if template functions
	// accessing the file system are used (such as include). Default is
	// `{http.vars.root}` if set, or current working directory otherwise.
	FileRoot string `json:"file_root,omitempty"`

	// The MIME types for which to render templates. It is important to use
	// this if the route matchers do not exclude images or other binary files.
	// Default is text/plain, text/markdown, and text/html.
	MIMETypes []string `json:"mime_types,omitempty"`

	// The template action delimiters.
	Delimiters []string `json:"delimiters,omitempty"`
}

Templates is a middleware which execute response bodies as templates.

func (Templates) CaddyModule

func (Templates) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Templates) Provision

func (t *Templates) Provision(ctx caddy.Context) error

Provision provisions t.

func (*Templates) ServeHTTP

func (t *Templates) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

func (*Templates) Validate

func (t *Templates) Validate() error

Validate ensures t has a valid configuration.

Jump to

Keyboard shortcuts

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