Versions in this module Expand all Collapse all v0 v0.0.1 Dec 15, 2025 Changes in this version + type CodeGenerator struct + Engine TemplateEngine + FileExt string + func NewCodeGeneratorWithEngine(engine TemplateEngine) *CodeGenerator + func (g *CodeGenerator) Generate(_ context.Context, opts Options, tplName string) (outputPath string, err error) + type EmbeddedTemplateEngine struct + func NewEmbeddedTemplateEngine(srcs map[string][]byte) (*EmbeddedTemplateEngine, error) + func NewEmbeddedTemplateEngineFromMap(srcs map[string][]byte, funcs template.FuncMap) (*EmbeddedTemplateEngine, error) + func (e *EmbeddedTemplateEngine) InstallFuncMap(funcs template.FuncMap) + func (e *EmbeddedTemplateEngine) ListTemplates() []string + func (e *EmbeddedTemplateEngine) Render(tplName string, data any) ([]byte, error) + type FileTemplateEngine struct + func NewFileTemplateEngine(root string) (*FileTemplateEngine, error) + func (e *FileTemplateEngine) InstallFuncMap(funcs template.FuncMap) + func (e *FileTemplateEngine) ListTemplates() []string + func (e *FileTemplateEngine) Render(tplName string, data any) ([]byte, error) + type Generator interface + Generate func(ctx context.Context, opts Options, tplName string) (outputPath string, err error) + type Options struct + Module string + OutDir string + OutputName string + ProjectName string + Vars map[string]interface{} + type TemplateEngine interface + InstallFuncMap func(funcs template.FuncMap) + ListTemplates func() []string + Render func(tplName string, data any) ([]byte, error)