templates

package
v0.0.0-...-0d96ec3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTemplateCache

func NewTemplateCache() (map[string]*template.Template, error)

NewTemplateCache stores template data in memory. Creating a template cache prevents the disk being read for every invocation of a template in the server.

Types

type BreadCrumb struct {
	// never include `home`, this is always available in HTML as a default.
	// Home > Containers > Edit is a logical structure.
	Name string
	Href string
}

type TemplateData

type TemplateData struct {
	Title           string
	Form            any
	IsAuthenticated bool
	CSRFToken       string
	Flash           string
	BreadCrumbs     []BreadCrumb
	Containers      []*sqlite.Container
	Container       *sqlite.Container
	Items           []*sqlite.Item
	Item            *sqlite.Item
}

TemplateData holds any template data which is passed into the template. render and defaultData are added via this struct.

Jump to

Keyboard shortcuts

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