Skip to content

Commit

Permalink
chore: split internal/server
Browse files Browse the repository at this point in the history
  • Loading branch information
soulteary committed Jan 5, 2024
1 parent e6bc522 commit 7a4249f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -36,5 +37,5 @@ func Parse() {
}

FlareState.AppFlags = flags
startDaemon(&flags)
return flags
}
4 changes: 2 additions & 2 deletions cmd/daemon.go → internal/server/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package FlareServer

import (
"context"
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 7a4249f

Please sign in to comment.