Skip to content

Commit 1b03b3c

Browse files
committed
update to go-redis v9
1 parent 6a86d91 commit 1b03b3c

File tree

24 files changed

+647
-216
lines changed

24 files changed

+647
-216
lines changed

cmd/serverNameExample_grpcExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
model.InitDB()
56-
logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
model.InitCache(cfg.App.CacheType)
58-
if cfg.App.CacheType != "" {
59-
logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
model.InitDB()
78+
logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
model.InitCache(cfg.App.CacheType)
80+
if cfg.App.CacheType != "" {
81+
logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
}
8383
}
8484

8585
func initConfig() {

cmd/serverNameExample_grpcGwPbExample/initial/initApp.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ func InitApp() {
6464
logger.Info("[tracer] was initialized")
6565
}
6666

67-
// initializing the rpc server connection
68-
// example:
69-
//rpcclient.NewServerNameExampleRPCConn()
70-
7167
// initializing the print system and process resources
7268
if cfg.App.EnableStat {
7369
stat.Init(
@@ -76,6 +72,10 @@ func InitApp() {
7672
)
7773
logger.Info("[resource statistics] was initialized")
7874
}
75+
76+
// initializing the rpc server connection
77+
// example:
78+
//rpcclient.NewServerNameExampleRPCConn()
7979
}
8080

8181
func initConfig() {

cmd/serverNameExample_grpcHttpPbExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
//model.InitDB()
56-
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
//model.InitCache(cfg.App.CacheType)
58-
//if cfg.App.CacheType != "" {
59-
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
//}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
//model.InitDB()
78+
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
//model.InitCache(cfg.App.CacheType)
80+
//if cfg.App.CacheType != "" {
81+
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
//}
8383
}
8484

8585
func initConfig() {

cmd/serverNameExample_grpcPbExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
//model.InitDB()
56-
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
//model.InitCache(cfg.App.CacheType)
58-
//if cfg.App.CacheType != "" {
59-
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
//}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
//model.InitDB()
78+
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
//model.InitCache(cfg.App.CacheType)
80+
//if cfg.App.CacheType != "" {
81+
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
//}
8383
}
8484

8585
func initConfig() {

cmd/serverNameExample_httpExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
model.InitDB()
56-
logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
model.InitCache(cfg.App.CacheType)
58-
if cfg.App.CacheType != "" {
59-
logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
model.InitDB()
78+
logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
model.InitCache(cfg.App.CacheType)
80+
if cfg.App.CacheType != "" {
81+
logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
}
8383
}
8484

8585
func initConfig() {

cmd/serverNameExample_httpPbExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
//model.InitDB()
56-
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
//model.InitCache(cfg.App.CacheType)
58-
//if cfg.App.CacheType != "" {
59-
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
//}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
//model.InitDB()
78+
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
//model.InitCache(cfg.App.CacheType)
80+
//if cfg.App.CacheType != "" {
81+
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
//}
8383
}
8484

8585
func initConfig() {

cmd/serverNameExample_mixExample/initial/initApp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ func InitApp() {
5151
logger.Debug(config.Show())
5252
logger.Info("[logger] was initialized")
5353

54-
// initializing database
55-
model.InitDB()
56-
logger.Infof("[%s] was initialized", cfg.Database.Driver)
57-
model.InitCache(cfg.App.CacheType)
58-
if cfg.App.CacheType != "" {
59-
logger.Infof("[%s] was initialized", cfg.App.CacheType)
60-
}
61-
6254
// initializing tracing
6355
if cfg.App.EnableTrace {
6456
tracer.InitWithConfig(
@@ -80,6 +72,14 @@ func InitApp() {
8072
)
8173
logger.Info("[resource statistics] was initialized")
8274
}
75+
76+
// initializing database
77+
model.InitDB()
78+
logger.Infof("[%s] was initialized", cfg.Database.Driver)
79+
model.InitCache(cfg.App.CacheType)
80+
if cfg.App.CacheType != "" {
81+
logger.Infof("[%s] was initialized", cfg.App.CacheType)
82+
}
8383
}
8484

8585
func initConfig() {

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/zhufuyi/sponge
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.0
@@ -9,13 +9,12 @@ require (
99
github.com/blastrain/vitess-sqlparser v0.0.0-20201030050434-a139afbb1aba
1010
github.com/bojand/ghz v0.117.0
1111
github.com/dgraph-io/ristretto v0.1.1
12+
github.com/fatih/color v1.13.0
1213
github.com/felixge/fgprof v0.9.3
1314
github.com/fsnotify/fsnotify v1.5.4
1415
github.com/gin-contrib/cors v1.3.1
1516
github.com/gin-gonic/gin v1.9.1
1617
github.com/go-playground/validator/v10 v10.14.0
17-
github.com/go-redis/redis/extra/redisotel v0.3.0
18-
github.com/go-redis/redis/v8 v8.11.5
1918
github.com/go-sql-driver/mysql v1.7.0
2019
github.com/golang-jwt/jwt/v5 v5.0.0
2120
github.com/golang/snappy v0.0.4
@@ -31,6 +30,8 @@ require (
3130
github.com/pkg/errors v0.9.1
3231
github.com/prometheus/client_golang v1.13.0
3332
github.com/rabbitmq/amqp091-go v1.9.0
33+
github.com/redis/go-redis/extra/redisotel/v9 v9.5.3
34+
github.com/redis/go-redis/v9 v9.6.1
3435
github.com/robfig/cron/v3 v3.0.1
3536
github.com/shirou/gopsutil/v3 v3.23.8
3637
github.com/spf13/cobra v1.4.0
@@ -98,7 +99,6 @@ require (
9899
github.com/eapache/queue v1.1.0 // indirect
99100
github.com/envoyproxy/go-control-plane v0.11.1 // indirect
100101
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
101-
github.com/fatih/color v1.13.0 // indirect
102102
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
103103
github.com/gin-contrib/sse v0.1.0 // indirect
104104
github.com/go-logr/logr v1.4.1 // indirect
@@ -110,7 +110,6 @@ require (
110110
github.com/go-openapi/swag v0.19.15 // indirect
111111
github.com/go-playground/locales v0.14.1 // indirect
112112
github.com/go-playground/universal-translator v0.18.1 // indirect
113-
github.com/go-redis/redis/extra/rediscmd v0.2.0 // indirect
114113
github.com/goccy/go-json v0.10.2 // indirect
115114
github.com/gogo/protobuf v1.3.2 // indirect
116115
github.com/golang/glog v1.1.2 // indirect
@@ -172,6 +171,7 @@ require (
172171
github.com/prometheus/common v0.37.0 // indirect
173172
github.com/prometheus/procfs v0.8.0 // indirect
174173
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
174+
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3 // indirect
175175
github.com/shoenig/go-m1cpu v0.1.6 // indirect
176176
github.com/shopspring/decimal v1.2.0 // indirect
177177
github.com/spf13/afero v1.9.2 // indirect

0 commit comments

Comments
 (0)