template

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteHTTP

func ExecuteHTTP(w http.ResponseWriter, t Template, data any)

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

An FS provides access to a file system that produces a safe HTML document templates.

func NewFS

func NewFS(fsys fs.FS) *FS

NewFS allocates a new file system for templates

func (*FS) MustParse

func (fsys *FS) MustParse(filenames ...string) Template

MustParse will panic if unable to parse files

func (*FS) Parse

func (fsys *FS) Parse(filenames ...string) (Template, error)

Parse parses the named files and associates the resulting templates with t

type Template

type Template interface {
	// Execute applies a parsed template to the specified data object, writing the output to wr
	Execute(wr io.Writer, data any) error
}

Jump to

Keyboard shortcuts

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