renderer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log            *slog.Logger
	TemplateString string
	Data           any
	// Validate allows the validation of the rendered template on a given temp file path, optional
	Validate func(path string) error
	// An optional prefix when creating tmp files
	TmpFilePrefix string
	Fs            afero.Fs
}

Config provides a config for the template Renderer

type Renderer

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

Config provides a config for the template Renderer

func New

func New(c *Config) (*Renderer, error)

New returns a new template renderer

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, destFile string) (changed bool, err error)

Render renders the given template to the given destination. Returns true when the template has changed.

Jump to

Keyboard shortcuts

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