template

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

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, logger log.Logger) (*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