refactor: switch AppState to iota-based enum

This commit is contained in:
2025-06-23 18:52:40 -05:00
parent a35b7e77a3
commit e83de79207

View File

@@ -15,13 +15,25 @@ type App struct {
}
// AppState represents the current state of the application
type AppState string
type AppState int
const (
StateRunning AppState = "running"
StatePaused AppState = "paused"
StatePaused AppState = iota
StateRunning
)
// String returns the string representation of the AppState
func (s AppState) String() string {
switch s {
case StatePaused:
return "paused"
case StateRunning:
return "running"
default:
return "unknown"
}
}
// NewApp creates a new application instance
func NewApp(logger *slog.Logger) *App {
return &App{