refactor: better project structure (#35)

This project is starting to grow, and I've seen flaws in the initial
project structure design
I think I'll restructure the entire project directory for better
scalability and also cleaner
This commit is contained in:
VERSE
2026-07-11 16:15:05 +07:00
committed by GitHub
parent 94c8af7b1d
commit 1e04949242
52 changed files with 339 additions and 445 deletions
+57
View File
@@ -0,0 +1,57 @@
package config
import (
"os"
"strconv"
"time"
)
func applyEnv(cfg *Config) {
if val := os.Getenv("IRIS_CORE_DEBUG"); val != "" {
if b, err := strconv.ParseBool(val); err == nil {
cfg.Core.Debug = b
}
}
if val := os.Getenv("IRIS_CORE_SHELL"); val != "" {
cfg.Core.Shell = val
}
if val := os.Getenv("IRIS_CORE_MODE"); val != "" {
cfg.Core.Mode = val
}
if val := os.Getenv("IRIS_UI_GHOST_TEXT"); val != "" {
if b, err := strconv.ParseBool(val); err == nil {
cfg.UI.GhostText = b
}
}
if val := os.Getenv("IRIS_UI_MAX_SUGGESTIONS"); val != "" {
if i, err := strconv.Atoi(val); err == nil {
cfg.UI.MaxSuggestions = i
}
}
if val := os.Getenv("IRIS_UI_MAX_HEIGHT"); val != "" {
if i, err := strconv.Atoi(val); err == nil {
cfg.UI.MaxHeight = i
}
}
if val := os.Getenv("IRIS_UPDATER_CHANNEL"); val != "" {
cfg.Updater.Channel = val
}
if val := os.Getenv("IRIS_UPDATER_INTERVAL"); val != "" {
if dur, err := time.ParseDuration(val); err == nil {
cfg.Updater.CheckInterval = Duration(dur)
}
}
if val := os.Getenv("IRIS_UPDATER_CHECK_ON_STARTUP"); val != "" {
if b, err := strconv.ParseBool(val); err == nil {
cfg.Updater.CheckOnStartup = b
}
}
if val := os.Getenv("IRIS_AI_ENABLED"); val != "" {
if b, err := strconv.ParseBool(val); err == nil {
cfg.AI.Enabled = b
}
}
if val := os.Getenv("IRIS_AI_PROVIDER"); val != "" {
cfg.AI.Provider = val
}
}