Documentation
¶
Index ¶
- Variables
- func Execute() error
- func GenerateProject() error
- func InstallDependencies(projectPath string) error
- func LoadExistingProject() error
- func OpenProjectDirectory(projectPath string) error
- func RunCRUDWizard(projectPath string) error
- func RunChangeDetection(projectPath string) error
- func RunDatabaseSetup(projectPath, projectType string) error
- func RunDevelopmentWorkflow(projectPath, projectType string) error
- func RunEnhancedCRUDWizard(projectPath string) error
- func RunEnhancedProjectWizard() error
- func RunQuickStart(projectPath, projectType string) error
- func RunTests(projectPath string) error
- func ShowPostGenerationMenu(opts PostGenerationOptions) error
- func StartApplication(projectPath, projectType string) error
- func ViewDocumentation(projectPath string) error
- type APIEndpoint
- type ActivityTracker
- type ArchitectureLayer
- type BusinessRule
- type CRUDEntity
- type CRUDField
- type CRUDTemplateData
- type DatabaseInfo
- type DiscoveredProject
- type DomainEvent
- type DomainObject
- type GophexMetadata
- type HandlerConfig
- type MiddlewareConfig
- type PostGenerationOptions
- type ProcessInfo
- type ProcessManager
- func (pm *ProcessManager) AddProcess(name, description, projectPath string, cmd *exec.Cmd)
- func (pm *ProcessManager) GetRunningProcesses() []*ProcessInfo
- func (pm *ProcessManager) HandleGracefulShutdown() error
- func (pm *ProcessManager) HasRunningProcesses() bool
- func (pm *ProcessManager) RemoveProcess(name string)
- func (pm *ProcessManager) StartProcessWithTracking(name, description, projectPath string, cmd *exec.Cmd) error
- func (pm *ProcessManager) TerminateAllProcesses()
- type ProjectConfiguration
- type ProjectFeature
- type ProjectHierarchy
- type ProjectInfo
- type ProjectMetadata
- type ProjectTracker
- func (pt *ProjectTracker) CreateInitialMetadata(projectType, projectName, projectPath string, ...) error
- func (pt *ProjectTracker) GetActivityPrefix(activity string) string
- func (pt *ProjectTracker) GetMetadata() *ProjectMetadata
- func (pt *ProjectTracker) IsActivityCompleted(activity string) bool
- func (pt *ProjectTracker) LoadMetadata() error
- func (pt *ProjectTracker) SaveMetadata() error
- func (pt *ProjectTracker) UpdateActivity(activity string, completed bool) error
- func (pt *ProjectTracker) UpdateDatabaseStatus(migrationsExecuted, initializationCompleted bool) error
- type RedisInfo
- type RepositoryConfig
- type ServiceConfig
- type UpdateMethodChoice
- type ValidationConfig
Constants ¶
This section is empty.
Variables ¶
var ErrReturnToMenu = errors.New("return to main menu")
ErrReturnToMenu is a special error that signals to return to the main menu
var ErrUserQuit = errors.New("user quit")
ErrUserQuit is a special error that signals the user wants to quit
Functions ¶
func GenerateProject ¶
func GenerateProject() error
func InstallDependencies ¶
InstallDependencies runs go mod tidy to install project dependencies
func LoadExistingProject ¶
func LoadExistingProject() error
LoadExistingProject handles loading an existing Gophex project
func OpenProjectDirectory ¶
OpenProjectDirectory opens the project directory in the system file manager
func RunCRUDWizard ¶
RunCRUDWizard runs the interactive CRUD generation wizard
func RunChangeDetection ¶
RunChangeDetection runs the change detection script
func RunDatabaseSetup ¶
RunDatabaseSetup runs database migrations or initialization based on project type
func RunDevelopmentWorkflow ¶
RunDevelopmentWorkflow runs an automated development setup workflow
func RunEnhancedCRUDWizard ¶
RunEnhancedCRUDWizard runs the enhanced educational CRUD generation wizard
func RunEnhancedProjectWizard ¶
func RunEnhancedProjectWizard() error
RunEnhancedProjectWizard runs the enhanced educational project generation wizard
func RunQuickStart ¶
RunQuickStart provides a simplified quick start workflow
func ShowPostGenerationMenu ¶
func ShowPostGenerationMenu(opts PostGenerationOptions) error
ShowPostGenerationMenu displays the post-generation menu and handles user choices
func StartApplication ¶
StartApplication starts the generated application
func ViewDocumentation ¶
ViewDocumentation displays the project documentation
Types ¶
type APIEndpoint ¶
type APIEndpoint struct {
Method string
Path string
Handler string
Middleware []string
Description string
}
APIEndpoint represents an API endpoint
type ActivityTracker ¶
type ActivityTracker struct {
DependenciesInstalled bool `json:"dependencies_installed"`
DatabaseSetup bool `json:"database_setup"`
ApplicationStarted bool `json:"application_started"`
TestsRun bool `json:"tests_run"`
HealthCheckTested bool `json:"health_check_tested"`
DocumentationViewed bool `json:"documentation_viewed"`
ChangeDetectionRun bool `json:"change_detection_run"`
}
ActivityTracker tracks completion status of various activities
type ArchitectureLayer ¶
type ArchitectureLayer struct {
Name string
Description string
Files []string
Purpose string
Dependencies []string
}
ArchitectureLayer represents a layer in the clean architecture
type BusinessRule ¶
BusinessRule represents a business rule
type CRUDEntity ¶
type CRUDEntity struct {
Name string
PluralName string
Fields []CRUDField
UpdateMethod string // "put", "patch", or "both"
}
CRUDEntity represents the entity to generate CRUD for
type CRUDField ¶
type CRUDField struct {
Name string
Type string
JSONTag string
DBTag string
Required bool
Unique bool
Description string
}
CRUDField represents a field in the entity
type CRUDTemplateData ¶
type CRUDTemplateData struct {
Entity *CRUDEntity
ModuleName string
ProjectName string
DatabaseType string
Timestamp string
}
CRUDTemplateData contains all data needed for CRUD template generation
type DatabaseInfo ¶
type DatabaseInfo struct {
Configured bool `json:"configured"`
Type string `json:"type,omitempty"` // postgresql, mysql, mongodb
ConfigType string `json:"config_type,omitempty"` // single, read-write, cluster
MigrationsExecuted bool `json:"migrations_executed"`
InitializationCompleted bool `json:"initialization_completed"`
SupportsMigrations bool `json:"supports_migrations"`
}
DatabaseInfo tracks database configuration (no sensitive data)
type DiscoveredProject ¶
type DiscoveredProject struct {
Name string
Type string
Path string
LastUpdated string
RelativePath string
}
DiscoveredProject represents information about a discovered Gophex project
type DomainEvent ¶
DomainEvent represents a domain event
type DomainObject ¶
type DomainObject struct {
Entity CRUDEntity
Repository RepositoryConfig
Service ServiceConfig
Handler HandlerConfig
Validation ValidationConfig
Middleware []MiddlewareConfig
}
DomainObject represents a complete domain object with all its components
type GophexMetadata ¶
type GophexMetadata struct {
Version string `json:"version"`
GeneratedAt string `json:"generated_at"`
Project ProjectInfo `json:"project"`
Database DatabaseInfo `json:"database"`
Redis RedisInfo `json:"redis"`
Activities ActivityTracker `json:"activities"`
Hierarchy ProjectHierarchy `json:"hierarchy"`
}
GophexMetadata contains all Gophex-specific tracking data
type HandlerConfig ¶
type HandlerConfig struct {
Endpoints []APIEndpoint
Middleware []string
ErrorHandling bool
Documentation bool
}
HandlerConfig represents handler layer configuration
type MiddlewareConfig ¶
MiddlewareConfig represents middleware configuration
type PostGenerationOptions ¶
PostGenerationOptions represents the available actions after project generation
type ProcessInfo ¶
ProcessInfo contains information about a running process
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
ProcessManager tracks and manages child processes started by Gophex
func GetProcessManager ¶
func GetProcessManager() *ProcessManager
GetProcessManager returns the global process manager instance
func (*ProcessManager) AddProcess ¶
func (pm *ProcessManager) AddProcess(name, description, projectPath string, cmd *exec.Cmd)
AddProcess adds a process to the manager
func (*ProcessManager) GetRunningProcesses ¶
func (pm *ProcessManager) GetRunningProcesses() []*ProcessInfo
GetRunningProcesses returns a list of currently running processes
func (*ProcessManager) HandleGracefulShutdown ¶
func (pm *ProcessManager) HandleGracefulShutdown() error
HandleGracefulShutdown handles shutdown when there are running processes
func (*ProcessManager) HasRunningProcesses ¶
func (pm *ProcessManager) HasRunningProcesses() bool
HasRunningProcesses checks if there are any running child processes
func (*ProcessManager) RemoveProcess ¶
func (pm *ProcessManager) RemoveProcess(name string)
RemoveProcess removes a process from the manager
func (*ProcessManager) StartProcessWithTracking ¶
func (pm *ProcessManager) StartProcessWithTracking(name, description, projectPath string, cmd *exec.Cmd) error
StartProcessWithTracking starts a process and adds it to the manager
func (*ProcessManager) TerminateAllProcesses ¶
func (pm *ProcessManager) TerminateAllProcesses()
TerminateAllProcesses terminates all tracked processes
type ProjectConfiguration ¶
type ProjectConfiguration struct {
Name string
Type string
Framework string
DatabaseConfig *generator.DatabaseConfig
RedisConfig *generator.RedisConfig
Path string
Features []ProjectFeature
}
ProjectConfiguration represents the complete project configuration
type ProjectFeature ¶
ProjectFeature represents a feature that can be enabled in the project
type ProjectHierarchy ¶
type ProjectHierarchy struct {
Cmd map[string]interface{} `json:"cmd,omitempty"`
Internal map[string]interface{} `json:"internal,omitempty"`
Migrations []string `json:"migrations,omitempty"`
Scripts []string `json:"scripts,omitempty"`
Web map[string]interface{} `json:"web,omitempty"`
RootFiles []string `json:"root_files"`
}
ProjectHierarchy represents the file structure of the generated project
type ProjectInfo ¶
type ProjectInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Path string `json:"path"`
ModuleName string `json:"module_name"`
}
ProjectInfo contains basic project information
type ProjectMetadata ¶
type ProjectMetadata struct {
Gophex GophexMetadata `json:"gophex"`
}
ProjectMetadata represents the complete project tracking information
type ProjectTracker ¶
type ProjectTracker struct {
// contains filtered or unexported fields
}
ProjectTracker manages project metadata operations
func NewProjectTracker ¶
func NewProjectTracker(projectPath string) *ProjectTracker
NewProjectTracker creates a new project tracker for the given project path
func (*ProjectTracker) CreateInitialMetadata ¶
func (pt *ProjectTracker) CreateInitialMetadata(projectType, projectName, projectPath string, dbConfig *generator.DatabaseConfig, redisConfig *generator.RedisConfig) error
CreateInitialMetadata creates and saves initial project metadata
func (*ProjectTracker) GetActivityPrefix ¶
func (pt *ProjectTracker) GetActivityPrefix(activity string) string
GetActivityPrefix returns "Re-" if activity is completed, empty string otherwise
func (*ProjectTracker) GetMetadata ¶
func (pt *ProjectTracker) GetMetadata() *ProjectMetadata
GetMetadata returns the current metadata
func (*ProjectTracker) IsActivityCompleted ¶
func (pt *ProjectTracker) IsActivityCompleted(activity string) bool
IsActivityCompleted checks if a specific activity has been completed
func (*ProjectTracker) LoadMetadata ¶
func (pt *ProjectTracker) LoadMetadata() error
LoadMetadata loads existing project metadata from gophex.md
func (*ProjectTracker) SaveMetadata ¶
func (pt *ProjectTracker) SaveMetadata() error
SaveMetadata saves the current metadata to gophex.md
func (*ProjectTracker) UpdateActivity ¶
func (pt *ProjectTracker) UpdateActivity(activity string, completed bool) error
UpdateActivity updates the status of a specific activity
func (*ProjectTracker) UpdateDatabaseStatus ¶
func (pt *ProjectTracker) UpdateDatabaseStatus(migrationsExecuted, initializationCompleted bool) error
UpdateDatabaseStatus updates database-related status
type RepositoryConfig ¶
type RepositoryConfig struct {
Interface string
Methods []string
Caching bool
Transactions bool
Pagination bool
}
RepositoryConfig represents repository layer configuration
type ServiceConfig ¶
type ServiceConfig struct {
BusinessRules []BusinessRule
Events []DomainEvent
Validation bool
Logging bool
}
ServiceConfig represents service layer configuration
type UpdateMethodChoice ¶
UpdateMethodChoice represents the update method selection
type ValidationConfig ¶
type ValidationConfig struct {
InputValidation bool
BusinessValidation bool
CustomValidators []string
}
ValidationConfig represents validation configuration