refactor app related code to the app package

This commit is contained in:
Pavel 2021-09-14 13:04:56 +03:00
parent 7c781c064c
commit 660ff1a994
5 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Neur0toxine/demo-web-service-go/internal" "github.com/Neur0toxine/demo-web-service-go/internal/app"
"github.com/brianvoe/gofakeit/v6" "github.com/brianvoe/gofakeit/v6"
) )
@ -20,8 +20,8 @@ type RunCommand struct{}
func (c *RunCommand) Execute(args []string) error { func (c *RunCommand) Execute(args []string) error {
gofakeit.Seed(time.Now().UnixNano()) gofakeit.Seed(time.Now().UnixNano())
go internal.ProcessSignals() go app.ProcessSignals()
r := internal.Router() r := app.Router()
if err := r.Run(":8080"); err != nil { if err := r.Run(":8080"); err != nil {
return fmt.Errorf("cannot start the server on :8080 > %w", err) return fmt.Errorf("cannot start the server on :8080 > %w", err)
} }

View File

@ -1,4 +1,4 @@
package internal package app
import ( import (
"net/http" "net/http"

View File

@ -1,4 +1,4 @@
package internal package app
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package internal package app
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

View File

@ -1,4 +1,4 @@
package internal package app
import ( import (
"log" "log"