tmplstring

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingField = errors.New("expression references missing field")
)
View Source
var ErrNotStruct = errors.New("provided type is not a struct. only structs are supported")

Functions

This section is empty.

Types

type TMPL

type TMPL[T any] struct {
	// contains filtered or unexported fields
}

TMPL holds a reference to the underlying templating engine struct. It can be redered with the appropriate parameter `T`.

func NewTMPL

func NewTMPL[T any](str string) (*TMPL[T], error)

NewTMPL creates and validates a template that can be later rendered with the given parameters.

func (*TMPL[T]) Render

func (t *TMPL[T]) Render(params T) (string, error)

Render renders a template with the provided parameter struct.

Jump to

Keyboard shortcuts

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