render

package
v0.0.0-...-dc1bdca Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package render generates Go source files from an IR document using embedded templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTemplate

func RenderTemplate(tmplName, tmplContent string, doc *ir.Document) ([]byte, error)

RenderTemplate executes a template string against the IR document and post-processes the result with goimports and gofumpt.

Types

type File

type File struct {
	Name    string
	Content []byte
}

File represents a single rendered output file.

func Files

func Files(doc *ir.Document, g config.Generate) ([]File, error)

Files renders all embedded templates against the IR document.

func FilesFromFS

func FilesFromFS(fsys fs.FS, doc *ir.Document, g config.Generate) ([]File, error)

FilesFromFS renders all *.tmpl files found in fsys against the IR document. The output file name is the template name minus the ".tmpl" suffix.

Jump to

Keyboard shortcuts

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