html

package
v0.0.0-...-139ebc3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error raised by View() when the HtmlContext isn't available
	ErrContextNotFound = errors.New("%s not found in %s", "HtmlContext", "http.Request")
)
View Source
var Files = html.NewCollection(
	html.NewTemplate("index", index),
)

Functions

func HtmlContext

func HtmlContext(ctx context.Context) *html.Collection

HtmlContext returns the HTML Template context attached to a context

func Middleware

func Middleware(h *html.Collection) func(http.Handler) http.Handler

Middleware that attaches a HTML Template context to the request

func View

func View(r *http.Request, name string, data interface{}) web.Renderer

Returns a Renderer HTML Template attached to the given data

func WithHtmlContext

func WithHtmlContext(ctx context.Context, t *html.Collection) context.Context

WithHtmlContext returns a new http.Request Context with a given HTML Template context attached if given

Types

type Collection

type Collection = html.Collection

Jump to

Keyboard shortcuts

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