template

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

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

func LoadTemplate

func LoadTemplate(path string) (*Template, error)

LoadTemplate reads and parses all templates defined in the given file and constructs a jiralert.Template.

func SimpleTemplate

func SimpleTemplate() *Template

func (*Template) Execute

func (t *Template) Execute(text string, data interface{}) (string, error)

Execute parses the provided text (or returns it unchanged if not a Go template), associates it with the templates defined in t.tmpl (so they may be referenced and used) and applies the resulting template to the specified data object, returning the output as a string .

Jump to

Keyboard shortcuts

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