template

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model map[string]interface{}

func (Model) AddAllAttributes

func (m Model) AddAllAttributes(attributes map[string]any)

func (Model) AddAttribute

func (m Model) AddAttribute(name string, attribute any)

func (Model) ContainsAttribute

func (m Model) ContainsAttribute(name string) bool

func (Model) GetAttribute

func (m Model) GetAttribute(name string) any

func (Model) MergeAttributes

func (m Model) MergeAttributes(attributes map[string]any)

MergeAttributes Copy all attributes in the supplied {@code Map} into this {@code Map}, with existing objects of the same name taking precedence (i.e. not getting replaced).

type Template

type Template struct {
	HTMLTemplate *htmlTemplate.Template
	TextTemplate *template.Template
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(logger *zap.Logger, bus event.Bus) *Template

func (*Template) AddFunc

func (t *Template) AddFunc(name string, fn interface{})

func (*Template) Execute

func (t *Template) Execute(wr io.Writer, data Model) error

func (*Template) ExecuteTemplate

func (t *Template) ExecuteTemplate(wr io.Writer, name string, data Model) error

func (*Template) ExecuteText

func (t *Template) ExecuteText(wr io.Writer, data Model) error

func (*Template) ExecuteTextTemplate

func (t *Template) ExecuteTextTemplate(wr io.Writer, name string, data Model) error

func (*Template) Load

func (t *Template) Load(paths []string) error

func (*Template) Reload

func (t *Template) Reload(paths []string) error

func (*Template) SetSharedVariable

func (t *Template) SetSharedVariable(name string, value interface{})

func (*Template) Watch

func (t *Template) Watch()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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