scaffold

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPackages

func ExtractPackages(targetDir, newModule string, packages []string) error

ExtractPackages copies framework packages from the embedded pkg/ source into targetDir/internal/<package>/, rewriting imports to the new module path.

func RenderApp

func RenderApp(targetDir string, data Data) error

RenderApp renders only the app subdirectory (controllers/, models/, views/, main.go) for adding a new app to an existing project.

func RenderProject

func RenderProject(targetDir string, data Data) error

RenderProject walks res/scaffold/ and writes files into targetDir.

Routing rules:

  • res/scaffold/web/ → targetDir/<Dir>/
  • res/scaffold/<path> → targetDir/<path>

Files ending in .tmpl are executed as text/template with <<>> delimiters and written with the .tmpl suffix stripped. All other files are copied verbatim.

Types

type Data

type Data struct {
	Name          string
	Module        string
	Dir           string // app subdirectory (default: "web")
	WithFrontend  bool
	WithAssistant bool
	WithPlatform  bool
	WithDatabase  bool
}

Data holds template variables for scaffold rendering.

Jump to

Keyboard shortcuts

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