ztplzgo.at/ztpl/internal Index | Files

package internal

import "zgo.at/ztpl/internal"

Index

Variables

var (
	TraceEnabled bool
	Ran          Trace
)
var Templates = new(LockedTpl)

Types

type LockedTpl

type LockedTpl struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LockedTpl adds a lock to template.Template for reloading in dev without race conditions.

func (*LockedTpl) ExecuteTemplate

func (t *LockedTpl) ExecuteTemplate(wr io.Writer, name string, data interface{}) error

func (*LockedTpl) Has

func (t *LockedTpl) Has(name string) bool

func (*LockedTpl) List

func (t *LockedTpl) List() []string

func (*LockedTpl) Set

func (t *LockedTpl) Set(html *htmlTemplate.Template, text *textTemplate.Template)

type Template

type Template interface {
	ExecuteTemplate(io.Writer, string, interface{}) error
	Lookup(string) Template
	GetTree(string) *parse.Tree
	TemplateNames() []string
}

type Trace

type Trace map[string][]interface{}

func (Trace) Names

func (t Trace) Names() []string

Source Files

ztpl.go

Version
v0.0.0-20231210165448-05891fb9a4df (latest)
Published
Dec 10, 2023
Platform
linux/amd64
Imports
8 packages
Last checked
1 month ago

Tools for package owners.