template

package
v0.0.0-...-0714061 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extension

type Extension func(source string, path string, defaultValue *string) (string, error)

Extension allows to extend template engine

type Template

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

Template defines structure for template engine

func NewTemplate

func NewTemplate() *Template

NewTemplate initializes template engine

func (*Template) EvalToBool

func (tpl *Template) EvalToBool(tplString string) (bool, error)

EvalToBool evaluates expression and converts it to boolean

func (*Template) Exec

func (tpl *Template) Exec(tplString string) string

Exec applies template engine to a string with placeholders

func (*Template) WithData

func (tpl *Template) WithData(data util.Data) *Template

WithData sets extra data for templates

func (*Template) WithExtensions

func (tpl *Template) WithExtensions(extensions map[string]Extension) *Template

WithExtensions sets extensions

func (*Template) WithGit

func (tpl *Template) WithGit(gitObject git.Repo) *Template

WithGit sets git object

func (*Template) WithStrict

func (tpl *Template) WithStrict(strictMode bool) *Template

Strict sets strict mode

Jump to

Keyboard shortcuts

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