tpls

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Faker

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

func NewFaker

func NewFaker() *Faker

func (*Faker) Get

func (f *Faker) Get() func(id string) string

Get generates fake data

type Templates

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

Templates is used for templates rendering.

func New

func New(funcMap template.FuncMap) *Templates

New created template renderer with values to replace.

func (*Templates) AddEmbedded

func (t *Templates) AddEmbedded(name string, b []byte)

func (*Templates) Render

func (t *Templates) Render(b []byte, data any) ([]byte, error)

Render applies values and renders final output.

func (*Templates) RenderEmbedded

func (t *Templates) RenderEmbedded(name string, data any) ([]byte, error)

func (*Templates) Validate

func (t *Templates) Validate(b []byte) error

Validate verifies if template is correct.

Jump to

Keyboard shortcuts

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