template

package
v0.0.0-...-8f9ce2e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRootTemplateNotFound = errors.New("root template not found")
)

Functions

func Configure

func Configure(l *goapp.Lifecycle, conf *config.Config)

func GetTemplates

func GetTemplates(embeds *embed.Embeds, funcMap map[string]interface{}) map[string]*template.Template

This function is called only once at boot time to configure the different template

Types

type Context

type Context map[string]interface{}

type FuncMap

type FuncMap map[string]interface{}

type TemplateLoader

type TemplateLoader struct {
	Embeds    *embed.Embeds
	BasePath  string
	Templates map[string]*template.Template
	FuncMap   map[string]interface{}
}

func (*TemplateLoader) Execute

func (l *TemplateLoader) Execute(path string, data interface{}) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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