Skip to content

Commit

Permalink
♻️ refactor: updated codebase and upgraded deps #16 #2
Browse files Browse the repository at this point in the history
  • Loading branch information
arisnguyen215 committed Dec 9, 2023
1 parent e993a9b commit 3a93d82
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 39 deletions.
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ require (
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.16.0
github.com/sivaosorg/govm v1.2.8
github.com/sivaosorg/mysqlconn v1.0.4
github.com/sivaosorg/postgresconn v1.0.6
github.com/sivaosorg/rabbitmqconn v1.0.6
github.com/sivaosorg/redisconn v1.0.3
github.com/sivaosorg/wsconn v1.0.4
github.com/sivaosorg/mysqlconn v1.0.5
github.com/sivaosorg/postgresconn v1.0.7
github.com/sivaosorg/rabbitmqconn v1.0.8
github.com/sivaosorg/redisconn v1.0.4
github.com/sivaosorg/wsconn v1.0.5
github.com/swaggo/swag v1.16.2
golang.org/x/time v0.5.0
)
Expand All @@ -35,7 +35,7 @@ require (
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/rabbitmq/amqp091-go v1.9.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand All @@ -49,7 +49,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/spec v0.20.11 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwn
github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8=
github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
github.com/go-openapi/spec v0.20.11 h1:J/TzFDLTt4Rcl/l1PmyErvkqlJDncGvPTMnCI39I4gY=
github.com/go-openapi/spec v0.20.11/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
Expand Down Expand Up @@ -121,16 +121,16 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sivaosorg/govm v1.2.8 h1:SyVwq7PNUKQQNqI9PbjZ6zY9b33lks75y/qzAzxDNyI=
github.com/sivaosorg/govm v1.2.8/go.mod h1:rXfPCNGc4ddPf1+VRX8Ytw/5xqehfPRrCr53Oi+cwpw=
github.com/sivaosorg/mysqlconn v1.0.4 h1:sv/+zVIkzd4VskCsLHj+noSumH/yGUnORCBInfW7OWY=
github.com/sivaosorg/mysqlconn v1.0.4/go.mod h1:oohoHcVTYlLw/ABOYgLRF/f4F2sQjbEOLPooxGyT9O8=
github.com/sivaosorg/postgresconn v1.0.6 h1:XGrhCaQ4OxO26kHfNoj1QuKpBvBplM/JVwjatbaz+LA=
github.com/sivaosorg/postgresconn v1.0.6/go.mod h1:jJDTBrIkD+w1t5zbQt+dMcYmSVwN/2SsEV05p8iVSdY=
github.com/sivaosorg/rabbitmqconn v1.0.6 h1:ha+oudQEsrp69h4TNQ1qV8n4T6PDcyAMFwWNSoWT4x0=
github.com/sivaosorg/rabbitmqconn v1.0.6/go.mod h1:NngaDnW1eA9r4wm9/ULqQzdexNT8d/CD/JxSi4Ejv6Y=
github.com/sivaosorg/redisconn v1.0.3 h1:UFD+/LjXQPvflVL99X4EeteqExbX3j9AmuXL6g31kOQ=
github.com/sivaosorg/redisconn v1.0.3/go.mod h1:RYp4AP3HK8MtjqoF1jZleXqrgkAqJdRsHQsvV/d57NA=
github.com/sivaosorg/wsconn v1.0.4 h1:zPjDgMNuFOWbgTEeUGVRyJYpLsSfNXVc4qX0yX4Z8GI=
github.com/sivaosorg/wsconn v1.0.4/go.mod h1:CXQtv27NLZbsSZUEVulSxTC4rESrfkyKWVDmVU/DtQU=
github.com/sivaosorg/mysqlconn v1.0.5 h1:VHVfk6d6NQaMNsaLhojyzxF3PV+TA0I4wekIF5fU9QI=
github.com/sivaosorg/mysqlconn v1.0.5/go.mod h1:oohoHcVTYlLw/ABOYgLRF/f4F2sQjbEOLPooxGyT9O8=
github.com/sivaosorg/postgresconn v1.0.7 h1:36O2bVZdFzOqFPboyDZSp7BpZODrCRjj88KELG50ehQ=
github.com/sivaosorg/postgresconn v1.0.7/go.mod h1:FfrmwVY0FjdFzU/fZJn5dvGyNBwa4l5HrIMQxIhDrgE=
github.com/sivaosorg/rabbitmqconn v1.0.8 h1:hRKcMxTb/R6TFH2rn7C6oqIctpxWug2cgI/P2aTK0Vw=
github.com/sivaosorg/rabbitmqconn v1.0.8/go.mod h1:75GqfgtKmdjLXmxHN0aCn2rLBOnY7eiKjgX1ncTjMZc=
github.com/sivaosorg/redisconn v1.0.4 h1:uZnGIJU4K6IuELymABb4BMS6KrS9ldyOLh8jpO5Se98=
github.com/sivaosorg/redisconn v1.0.4/go.mod h1:RYp4AP3HK8MtjqoF1jZleXqrgkAqJdRsHQsvV/d57NA=
github.com/sivaosorg/wsconn v1.0.5 h1:pVJYhdGfczQV1jrBnonOPVKZUF6QFFjJPB+xELzN/Q4=
github.com/sivaosorg/wsconn v1.0.5/go.mod h1:qQNaHywcMexY0F2KFIlqGix14E5EloaIN9AJDGi2GRA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand All @@ -151,8 +151,8 @@ github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
Expand Down
20 changes: 4 additions & 16 deletions internal/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/sivaosorg/govm/server"
"github.com/sivaosorg/govm/timex"
"github.com/sivaosorg/govm/utils"
"github.com/sivaosorg/mysqlconn/mysqlconn"
"github.com/sivaosorg/postgresconn/postgresconn"
"github.com/sivaosorg/rabbitmqconn/rabbitmqconn"
"github.com/sivaosorg/redisconn/redisconn"
"github.com/sivaosorg/mysqlconn"
"github.com/sivaosorg/postgresconn"
"github.com/sivaosorg/rabbitmqconn"
"github.com/sivaosorg/redisconn"
)

type CoreCommand struct {
Expand Down Expand Up @@ -72,39 +72,27 @@ func (c *CoreCommand) conn() {
go func() {
defer wg.Done()
psql, s := postgresconn.NewClient(syncconf.Conf.Postgres)
if s.IsConnected {
// defer psql.Close()
}
c.psql = psql
c.psqlStatus = s
}()
wg.Add(1)
go func() {
defer wg.Done()
msql, s := mysqlconn.NewClient(syncconf.Conf.MySql)
if s.IsConnected {
// defer msql.Close()
}
c.msql = msql
c.msqlStatus = s
}()
wg.Add(1)
go func() {
defer wg.Done()
redis, s := redisconn.NewClient(syncconf.Conf.Redis)
if s.IsConnected {
// defer redis.Close()
}
c.redis = redis
c.redisStatus = s
}()
wg.Add(1)
go func() {
defer wg.Done()
rabbitmq, s := rabbitmqconn.NewClient(syncconf.Conf.RabbitMq)
if s.IsConnected {
// defer rabbitmq.Close()
}
c.rabbitmq = rabbitmq
c.rabbitmqStatus = s
}()
Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/common_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/sivaosorg/govm/entity"
"github.com/sivaosorg/govm/wsconnx"

"github.com/sivaosorg/wsconn/wsconn"
"github.com/sivaosorg/wsconn"
)

type CommonHandler struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/repository/common_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package repository

import (
"github.com/sivaosorg/govm/dbx"
"github.com/sivaosorg/postgresconn/postgresconn"
"github.com/sivaosorg/postgresconn"
)

type CommonRepository interface {
Expand Down

0 comments on commit 3a93d82

Please sign in to comment.