rumtpl

package
v0.0.0-...-5894489 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTemplateError = errors.New("template error")
)

Functions

This section is empty.

Types

type Manager

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

Manager holds parsed templates.

func NewManagerFromEmbed

func NewManagerFromEmbed(f embed.FS, subdir, pattern string) (*Manager, error)

NewManagerFromEmbed convenience when package embeds templates in subdir.

func NewManagerFromFS

func NewManagerFromFS(fsys fs.FS, pattern string) (*Manager, error)

NewManagerFromFS parses templates from any fs.FS matching pattern.

func (*Manager) Render

func (m *Manager) Render(name Name, data any) ([]byte, error)

Render implements Renderer.

type Name

type Name string

Name type for template identifier.

type Renderer

type Renderer interface {
	Render(Name, any) ([]byte, error)
}

Renderer is the minimal interface consumers use.

Jump to

Keyboard shortcuts

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