tpl

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUILanguage

func GetUILanguage(r *http.Request) string

GetUILanguage returns the accepted language for the UI or "en" by default.

Types

type Cache

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

Cache caches HTML templates.

func Get

func Get() *Cache

Get returns the template cache.

func NewCache

func NewCache() *Cache

NewCache creates a new HTML cache.

func (*Cache) Execute

func (cache *Cache) Execute(w http.ResponseWriter, name string, data any)

Execute runs the HTML template for given name and sends it to the client.

func (*Cache) Render

func (cache *Cache) Render(name string, data any) template.HTML

Render runs the HTML template for given name and returns the HTML.

Jump to

Keyboard shortcuts

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