response

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTML

func HTML(w http.ResponseWriter, data any, templateFiles ...string)

Sends an HTML response

func JSON

func JSON(w http.ResponseWriter, status int, v any)

Sends a JSON response

func ParsePages added in v0.0.9

func ParsePages(templateDir string, layoutTmpl *template.Template) (map[string]*template.Template, error)

ParsePages recursively parses a given directory containing html templates. Each page is parsed against the layout template. It returns a map containing the name of the template as key and the parsed template as the value.

func ServerError added in v0.0.5

func ServerError(w http.ResponseWriter, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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