Skip to content

Commit

Permalink
fix: replace the component check func by tools pkg (#404)
Browse files Browse the repository at this point in the history
* fix: del the adminList and adminList init statement

* fix: find the error

* fix: fix the AdminList judge condition

* fix: fix the component check func

* fix: return error info

* fix: return error when componet check failed

* fix: fix the go.mod tools version

* fix: fix the go.mod

* fix: fix the go.mod error

* fix: fix the go.mod version

* fix: fix the go.mod crypto version
  • Loading branch information
luhaoling authored Jan 31, 2024
1 parent bd3591d commit 7886317
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 203 deletions.
4 changes: 2 additions & 2 deletions cmd/api/admin-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (

func main() {
rand.Seed(time.Now().UnixNano())
configFile, ginPort, hide, showVersion, err := config.FlagParse()
configFile, ginPort, showVersion, err := config.FlagParse()
if err != nil {
panic(err)
}
Expand All @@ -62,7 +62,7 @@ func main() {
if err := config.InitConfig(configFile); err != nil {
panic(err)
}
err = component.ComponentCheck(configFile, hide)
err = component.ComponentCheck()
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/api/chat-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {

func main() {

configFile, ginPort, hide, showVersion, err := config.FlagParse()
configFile, ginPort, showVersion, err := config.FlagParse()
if err != nil {
panic(err)
}
Expand All @@ -73,7 +73,7 @@ func main() {
fmt.Println("err ", err.Error())
panic(err)
}
err = component.ComponentCheck(configFile, hide)
err = component.ComponentCheck()
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpc/admin-rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
func main() {
rand.Seed(time.Now().UnixNano())

configFile, rpcPort, hide, showVersion, err := config.FlagParse()
configFile, rpcPort, showVersion, err := config.FlagParse()
if err != nil {
panic(err)
}
Expand All @@ -54,7 +54,7 @@ func main() {
if err := config.InitConfig(configFile); err != nil {
panic(err)
}
err = component.ComponentCheck(configFile, hide)
err = component.ComponentCheck()
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpc/chat-rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

func main() {
rand.Seed(time.Now().UnixNano())
configFile, rpcPort, hide, showVersion, err := config.FlagParse()
configFile, rpcPort, showVersion, err := config.FlagParse()
if err != nil {
panic(err)
}
Expand All @@ -53,7 +53,7 @@ func main() {
if config.Config.Envs.Discovery == "k8s" {
rpcPort = 80
}
err = component.ComponentCheck(configFile, hide)
err = component.ComponentCheck()
if err != nil {
panic(err)
}
Expand Down
46 changes: 33 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1
github.com/google/uuid v1.5.0
github.com/jinzhu/copier v0.3.5 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/pkg/errors v0.9.1 // indirect
google.golang.org/grpc v1.58.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -26,14 +26,14 @@ require (

require (
github.com/OpenIMSDK/protocol v0.0.21
github.com/OpenIMSDK/tools v0.0.23
github.com/go-zookeeper/zk v1.0.3
github.com/redis/go-redis/v9 v9.1.0
github.com/OpenIMSDK/tools v0.0.31
github.com/redis/go-redis/v9 v9.2.1
github.com/xuri/excelize/v2 v2.8.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
)

require (
github.com/IBM/sarama v1.42.1 // indirect
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
Expand All @@ -46,31 +46,52 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/clbanning/mxj/v2 v2.5.6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eapache/go-resiliency v1.4.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/go-zookeeper/zk v1.0.3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.66 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tjfoc/gmsm v1.3.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
Expand All @@ -85,14 +106,13 @@ require (
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/image v0.11.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
Loading

0 comments on commit 7886317

Please sign in to comment.