generator

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns the template.FuncMap used by all templates.

func WriteFiles

func WriteFiles(outputDir string, files []GeneratedFile) error

WriteFiles formats each generated file with goimports and writes them to outputDir.

Types

type GeneratedFile

type GeneratedFile struct {
	Name    string
	Content []byte
}

GeneratedFile represents a single generated output file.

type Generator

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

Generator executes templates against the IR to produce Go source files.

func New

func New(pkg *ir.Package) (*Generator, error)

New creates a Generator for the given IR package, parsing all embedded templates.

func (*Generator) Generate

func (g *Generator) Generate() ([]GeneratedFile, error)

Generate executes all templates and returns the generated files.

Jump to

Keyboard shortcuts

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