project

package
v0.0.0-...-e7aa5da Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 NewManager(workspace string) *Manager

func (*Manager) BackupProject

func (m *Manager) BackupProject(srcDir, destPath string) error

BackupProject creates a full copy of the project at destPath

func (*Manager) CreateProject

func (m *Manager) CreateProject(name, stack, parentDir string) (string, string, error)

func (*Manager) ExpandPath

func (m *Manager) ExpandPath(path string) string

func (*Manager) SuggestProjectName

func (m *Manager) SuggestProjectName(templateName string) string

SuggestProjectName suggests a name like "fastapi-project-01" based on template

func (*Manager) ValidateParentDir

func (m *Manager) ValidateParentDir(path string) (string, error)

ValidateParentDir checks if the path exists and is a directory

type ProjectConfig

type ProjectConfig struct {
	Name      string
	Path      string
	Stack     string // "Go", "Python", "Node"
	InitGit   bool
	AddReadme bool
}

Jump to

Keyboard shortcuts

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