Documentation
¶
Index ¶
- Variables
- func Generate(cfg ProjectConfig) (string, error)
- type Manager
- func (m *Manager) BackupProject(srcDir, destPath string) error
- func (m *Manager) CreateProject(name, stack, parentDir string) (string, string, error)
- func (m *Manager) ExpandPath(path string) string
- func (m *Manager) SuggestProjectName(templateName string) string
- func (m *Manager) ValidateParentDir(path string) (string, error)
- type ProjectConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Templates = map[string]map[string]string{
"Go": {
"main.go": `package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
`,
"go.mod": `module {{.Name}}
go 1.21
`,
},
"Python": {
"main.py": `def main():
print("Hello, World!")
if __name__ == "__main__":
main()
`,
"requirements.txt": `# Add your dependencies here
`,
},
"Node": {
"package.json": `{
"name": "{{.Name}}",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {}
}
`,
"index.js": `console.log("Hello, World!");
`,
},
}
Functions ¶
func Generate ¶
func Generate(cfg ProjectConfig) (string, error)
Types ¶
type Manager ¶
type Manager struct {
Workspace string
}
Manager handles high-level project operations
func NewManager ¶
func (*Manager) BackupProject ¶
BackupProject creates a full copy of the project at destPath
func (*Manager) CreateProject ¶
func (*Manager) ExpandPath ¶
func (*Manager) SuggestProjectName ¶
SuggestProjectName suggests a name like "fastapi-project-01" based on template
Click to show internal directories.
Click to hide internal directories.