template

package
v0.0.0-...-6b2826c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const ServiceName service.Name = "template"

ServiceName defines the Tempate service name

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data map[string]interface{}

Data is some data to inject into the template

func Extend

func Extend(data Data, extensions ...DataExtFunc) (Data, error)

Extend returns a template's data with the given extensions

type DataExtFunc

type DataExtFunc func(data Data) (Data, error)

DataExtFunc is some extensions to a template's data

type Service

type Service interface {
	RenderPage(w http.ResponseWriter, templateName string, data interface{}) error
	Render(w io.Writer, templateName string, data interface{}) error
}

Service is a templating service

func From

func From(container *service.Container) (Service, error)

From retrieves the template service in the given container

func Must

func Must(container *service.Container) Service

Must retrieves the template service in the given container or panic otherwise

Jump to

Keyboard shortcuts

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