diff --git a/cmd/cmd.go b/cmd/cmd.go index dc51973..51a93b4 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -4,11 +4,12 @@ import ( "log/slog" FlareData "github.com/soulteary/flare/config/data" + FlareModel "github.com/soulteary/flare/config/model" FlareState "github.com/soulteary/flare/config/state" FlareLogger "github.com/soulteary/flare/internal/logger" ) -func Parse() { +func Parse() FlareModel.Flags { envs := ParseEnvFile(ParseEnvVars()) flags := parseCLI(envs) @@ -36,5 +37,5 @@ func Parse() { } FlareState.AppFlags = flags - startDaemon(&flags) + return flags } diff --git a/cmd/daemon.go b/internal/server/server.go similarity index 98% rename from cmd/daemon.go rename to internal/server/server.go index 1475fd5..11696b1 100644 --- a/cmd/daemon.go +++ b/internal/server/server.go @@ -1,4 +1,4 @@ -package cmd +package FlareServer import ( "context" @@ -36,7 +36,7 @@ import ( FlareWeather "github.com/soulteary/flare/internal/settings/weather" ) -func startDaemon(AppFlags *FlareModel.Flags) { +func StartDaemon(AppFlags *FlareModel.Flags) { if !AppFlags.DebugMode { gin.SetMode(gin.ReleaseMode) diff --git a/main.go b/main.go index f5c53bf..a073f3b 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,10 @@ package main import ( "github.com/soulteary/flare/cmd" + FlareServer "github.com/soulteary/flare/internal/server" ) func main() { - cmd.Parse() + flags := cmd.Parse() + FlareServer.StartDaemon(&flags) }