mirror of
https://github.com/Neur0toxine/demo-web-service-go.git
synced 2024-12-04 18:46:03 +03:00
refactor app related code to the app package
This commit is contained in:
parent
7c781c064c
commit
660ff1a994
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package internal
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
@ -1,4 +1,4 @@
|
|||||||
package internal
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -1,4 +1,4 @@
|
|||||||
package internal
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
@ -1,4 +1,4 @@
|
|||||||
package internal
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
Loading…
Reference in New Issue
Block a user