Skip to content

Commit

Permalink
update to go-redis v9
Browse files Browse the repository at this point in the history
  • Loading branch information
zhufuyi committed Aug 25, 2024
1 parent 6a86d91 commit 1b03b3c
Show file tree
Hide file tree
Showing 24 changed files with 647 additions and 216 deletions.
16 changes: 8 additions & 8 deletions cmd/serverNameExample_grpcExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}
}

func initConfig() {
Expand Down
8 changes: 4 additions & 4 deletions cmd/serverNameExample_grpcGwPbExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ func InitApp() {
logger.Info("[tracer] was initialized")
}

// initializing the rpc server connection
// example:
//rpcclient.NewServerNameExampleRPCConn()

// initializing the print system and process resources
if cfg.App.EnableStat {
stat.Init(
Expand All @@ -76,6 +72,10 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing the rpc server connection
// example:
//rpcclient.NewServerNameExampleRPCConn()
}

func initConfig() {
Expand Down
16 changes: 8 additions & 8 deletions cmd/serverNameExample_grpcHttpPbExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}
}

func initConfig() {
Expand Down
16 changes: 8 additions & 8 deletions cmd/serverNameExample_grpcPbExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}
}

func initConfig() {
Expand Down
16 changes: 8 additions & 8 deletions cmd/serverNameExample_httpExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}
}

func initConfig() {
Expand Down
16 changes: 8 additions & 8 deletions cmd/serverNameExample_httpPbExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
//model.InitDB()
//logger.Infof("[%s] was initialized", cfg.Database.Driver)
//model.InitCache(cfg.App.CacheType)
//if cfg.App.CacheType != "" {
// logger.Infof("[%s] was initialized", cfg.App.CacheType)
//}
}

func initConfig() {
Expand Down
16 changes: 8 additions & 8 deletions cmd/serverNameExample_mixExample/initial/initApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func InitApp() {
logger.Debug(config.Show())
logger.Info("[logger] was initialized")

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}

// initializing tracing
if cfg.App.EnableTrace {
tracer.InitWithConfig(
Expand All @@ -80,6 +72,14 @@ func InitApp() {
)
logger.Info("[resource statistics] was initialized")
}

// initializing database
model.InitDB()
logger.Infof("[%s] was initialized", cfg.Database.Driver)
model.InitCache(cfg.App.CacheType)
if cfg.App.CacheType != "" {
logger.Infof("[%s] was initialized", cfg.App.CacheType)
}
}

func initConfig() {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/zhufuyi/sponge

go 1.19
go 1.20

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
Expand All @@ -9,13 +9,12 @@ require (
github.com/blastrain/vitess-sqlparser v0.0.0-20201030050434-a139afbb1aba
github.com/bojand/ghz v0.117.0
github.com/dgraph-io/ristretto v0.1.1
github.com/fatih/color v1.13.0
github.com/felixge/fgprof v0.9.3
github.com/fsnotify/fsnotify v1.5.4
github.com/gin-contrib/cors v1.3.1
github.com/gin-gonic/gin v1.9.1
github.com/go-playground/validator/v10 v10.14.0
github.com/go-redis/redis/extra/redisotel v0.3.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-sql-driver/mysql v1.7.0
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/golang/snappy v0.0.4
Expand All @@ -31,6 +30,8 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.13.0
github.com/rabbitmq/amqp091-go v1.9.0
github.com/redis/go-redis/extra/redisotel/v9 v9.5.3
github.com/redis/go-redis/v9 v9.6.1
github.com/robfig/cron/v3 v3.0.1
github.com/shirou/gopsutil/v3 v3.23.8
github.com/spf13/cobra v1.4.0
Expand Down Expand Up @@ -98,7 +99,6 @@ require (
github.com/eapache/queue v1.1.0 // indirect
github.com/envoyproxy/go-control-plane v0.11.1 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand All @@ -110,7 +110,6 @@ require (
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-redis/redis/extra/rediscmd v0.2.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.2 // indirect
Expand Down Expand Up @@ -172,6 +171,7 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.9.2 // indirect
Expand Down
Loading

0 comments on commit 1b03b3c

Please sign in to comment.