generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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