caddy: github.com/mholt/caddy/caddyhttp/templates Index | Files

package templates

import "github.com/mholt/caddy/caddyhttp/templates"

Package templates implements template execution for files to be dynamically rendered for the client.

Index

Package Files

setup.go templates.go

type Rule Uses

type Rule struct {
    Path       string
    Extensions []string
    IndexFiles []string
    Delims     [2]string
}

Rule represents a template rule. A template will only execute with this rule if the request path matches the Path specified and requests a resource with one of the extensions specified.

type Templates Uses

type Templates struct {
    Next    httpserver.Handler
    Rules   []Rule
    Root    string
    FileSys http.FileSystem
    BufPool *sync.Pool // docs: "A Pool must not be copied after first use."
}

Templates is middleware to render templated files as the HTTP response.

func (Templates) ServeHTTP Uses

func (t Templates) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServeHTTP implements the httpserver.Handler interface.

Package templates imports 12 packages (graph) and is imported by 108 packages. Updated 2019-07-02. Refresh now. Tools for package owners.