diff --git a/go.mod b/go.mod index ef7c37cd5..ba5ec0fa5 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( google.golang.org/api v0.165.0 google.golang.org/grpc v1.61.0 google.golang.org/protobuf v1.33.0 - gopkg.in/yaml.v3 v3.0.1 // indirect + gopkg.in/yaml.v3 v3.0.1 ) require github.com/google/uuid v1.6.0 @@ -36,6 +36,7 @@ require ( github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/go-redis/redis v6.15.9+incompatible github.com/redis/go-redis/v9 v9.4.0 + github.com/robfig/cron/v3 v3.0.1 github.com/spf13/pflag v1.0.5 github.com/stathat/consistent v1.0.0 github.com/tencentyun/cos-go-sdk-v5 v0.7.46 diff --git a/go.sum b/go.sum index 65175153c..044c3f615 100644 --- a/go.sum +++ b/go.sum @@ -295,6 +295,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk= github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index 5bcd0e76f..de5f4c5ec 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -21,6 +21,7 @@ import ( "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/push" "github.com/OpenIMSDK/protocol/sdkws" + "github.com/go-playground/validator/v10" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/discoveryregistry" diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go index 924c20380..7fb0f7c0f 100644 --- a/internal/msggateway/n_ws_server.go +++ b/internal/msggateway/n_ws_server.go @@ -27,6 +27,7 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" + "github.com/go-playground/validator/v10" "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" @@ -37,6 +38,7 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" "golang.org/x/sync/errgroup" ) diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index 88f85934c..a1e8454f7 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -25,6 +25,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/tools/errs" + "github.com/redis/go-redis/v9" "google.golang.org/api/option" ) diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index df11572d3..c8e546388 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -31,6 +31,7 @@ import ( "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/splitter" + "github.com/redis/go-redis/v9" ) var ( diff --git a/internal/rpc/msg/as_read.go b/internal/rpc/msg/as_read.go index c5df3e89c..53f01b770 100644 --- a/internal/rpc/msg/as_read.go +++ b/internal/rpc/msg/as_read.go @@ -24,6 +24,7 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" utils2 "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) func (m *msgServer) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *msg.GetConversationsHasReadAndMaxSeqReq) (resp *msg.GetConversationsHasReadAndMaxSeqResp, err error) { diff --git a/internal/rpc/msg/utils.go b/internal/rpc/msg/utils.go index c30bfa5b7..6cf925551 100644 --- a/internal/rpc/msg/utils.go +++ b/internal/rpc/msg/utils.go @@ -19,6 +19,7 @@ import ( "github.com/OpenIMSDK/protocol/sdkws" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" "go.mongodb.org/mongo-driver/mongo" ) diff --git a/internal/tools/cron_task.go b/internal/tools/cron_task.go index ff8c6b70c..f4c19fd74 100644 --- a/internal/tools/cron_task.go +++ b/internal/tools/cron_task.go @@ -25,6 +25,8 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/tools/errs" + "github.com/redis/go-redis/v9" + "github.com/robfig/cron/v3" ) func StartTask(ctx context.Context, config *config.GlobalConfig) error { diff --git a/internal/tools/cron_task_test.go b/internal/tools/cron_task_test.go index fa2fad090..b852c79b5 100644 --- a/internal/tools/cron_task_test.go +++ b/internal/tools/cron_task_test.go @@ -25,8 +25,11 @@ import ( "github.com/openimsdk/tools/errs" "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v3" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/redis/go-redis/v9" + "github.com/robfig/cron/v3" ) func TestDisLock(t *testing.T) { diff --git a/internal/tools/msg.go b/internal/tools/msg.go index 51dd12856..381047f09 100644 --- a/internal/tools/msg.go +++ b/internal/tools/msg.go @@ -17,9 +17,6 @@ package tools import ( "context" "fmt" - "math" - "math/rand" - "github.com/OpenIMSDK/protocol/sdkws" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" @@ -35,8 +32,11 @@ import ( "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/tx" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "math" + "math/rand" ) type MsgTool struct { diff --git a/pkg/authverify/token.go b/pkg/authverify/token.go index 21feec59e..181e3310d 100644 --- a/pkg/authverify/token.go +++ b/pkg/authverify/token.go @@ -18,6 +18,7 @@ import ( "context" "fmt" + "github.com/golang-jwt/jwt/v4" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/mcontext" diff --git a/pkg/common/db/cache/black.go b/pkg/common/db/cache/black.go index 166790f04..1eff0b8fe 100644 --- a/pkg/common/db/cache/black.go +++ b/pkg/common/db/cache/black.go @@ -23,6 +23,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/config" relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/cache/conversation.go b/pkg/common/db/cache/conversation.go index e1879b02b..6b0741d55 100644 --- a/pkg/common/db/cache/conversation.go +++ b/pkg/common/db/cache/conversation.go @@ -26,6 +26,7 @@ import ( relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/cache/friend.go b/pkg/common/db/cache/friend.go index 3835e0160..2396c5f15 100644 --- a/pkg/common/db/cache/friend.go +++ b/pkg/common/db/cache/friend.go @@ -24,6 +24,7 @@ import ( relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/cache/group.go b/pkg/common/db/cache/group.go index b83be2028..fdc2f08af 100644 --- a/pkg/common/db/cache/group.go +++ b/pkg/common/db/cache/group.go @@ -27,6 +27,7 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/cache/meta_cache.go b/pkg/common/db/cache/meta_cache.go index ac5fc4d21..e5c20a019 100644 --- a/pkg/common/db/cache/meta_cache.go +++ b/pkg/common/db/cache/meta_cache.go @@ -26,6 +26,7 @@ import ( "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mw/specialerror" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/cache/msg.go b/pkg/common/db/cache/msg.go index acbf48d48..e32ef463f 100644 --- a/pkg/common/db/cache/msg.go +++ b/pkg/common/db/cache/msg.go @@ -28,6 +28,7 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" "golang.org/x/sync/errgroup" ) diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go index ea4a76a36..73c4e9069 100644 --- a/pkg/common/db/cache/user.go +++ b/pkg/common/db/cache/user.go @@ -30,6 +30,7 @@ import ( relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/db/controller/auth.go b/pkg/common/db/controller/auth.go index 9e764c64a..d13c47f7c 100644 --- a/pkg/common/db/controller/auth.go +++ b/pkg/common/db/controller/auth.go @@ -18,6 +18,7 @@ import ( "context" "github.com/OpenIMSDK/protocol/constant" + "github.com/golang-jwt/jwt/v4" "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/tools/errs" diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go index 0f82e6d21..d1516ebb7 100644 --- a/pkg/common/db/controller/group.go +++ b/pkg/common/db/controller/group.go @@ -25,6 +25,7 @@ import ( "github.com/openimsdk/tools/pagination" "github.com/openimsdk/tools/tx" "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" ) type GroupDatabase interface { diff --git a/pkg/common/db/controller/msg.go b/pkg/common/db/controller/msg.go index 6c8680413..51106fc05 100644 --- a/pkg/common/db/controller/msg.go +++ b/pkg/common/db/controller/msg.go @@ -23,11 +23,6 @@ import ( "github.com/OpenIMSDK/protocol/constant" pbmsg "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/utils" - "go.mongodb.org/mongo-driver/mongo" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/convert" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" @@ -35,6 +30,11 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils" + "github.com/redis/go-redis/v9" + "go.mongodb.org/mongo-driver/mongo" ) const ( diff --git a/pkg/common/db/s3/cos/cos.go b/pkg/common/db/s3/cos/cos.go index 1d1d94c25..1ee17173e 100644 --- a/pkg/common/db/s3/cos/cos.go +++ b/pkg/common/db/s3/cos/cos.go @@ -31,6 +31,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" "github.com/openimsdk/tools/errs" + "github.com/tencentyun/cos-go-sdk-v5" ) const ( diff --git a/pkg/common/db/s3/minio/minio.go b/pkg/common/db/s3/minio/minio.go index 7ff9df1a3..43214d991 100644 --- a/pkg/common/db/s3/minio/minio.go +++ b/pkg/common/db/s3/minio/minio.go @@ -29,6 +29,7 @@ import ( "time" "unsafe" + "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/signer" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" diff --git a/pkg/common/db/s3/minio/thumbnail.go b/pkg/common/db/s3/minio/thumbnail.go index 30252cd9f..828f0483c 100644 --- a/pkg/common/db/s3/minio/thumbnail.go +++ b/pkg/common/db/s3/minio/thumbnail.go @@ -28,6 +28,7 @@ import ( "strings" "time" + "github.com/minio/minio-go/v7" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" "github.com/openimsdk/tools/errs" diff --git a/pkg/rpccache/conversation.go b/pkg/rpccache/conversation.go index 9fa2627ef..90babcb7e 100644 --- a/pkg/rpccache/conversation.go +++ b/pkg/rpccache/conversation.go @@ -24,6 +24,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) func NewConversationLocalCache(client rpcclient.ConversationRpcClient, cli redis.UniversalClient) *ConversationLocalCache { diff --git a/pkg/rpccache/friend.go b/pkg/rpccache/friend.go index 0815e8c62..15720a47e 100644 --- a/pkg/rpccache/friend.go +++ b/pkg/rpccache/friend.go @@ -22,6 +22,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) func NewFriendLocalCache(client rpcclient.FriendRpcClient, cli redis.UniversalClient) *FriendLocalCache { diff --git a/pkg/rpccache/group.go b/pkg/rpccache/group.go index 9d238a64e..714f52da0 100644 --- a/pkg/rpccache/group.go +++ b/pkg/rpccache/group.go @@ -24,6 +24,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) func NewGroupLocalCache(client rpcclient.GroupRpcClient, cli redis.UniversalClient) *GroupLocalCache { diff --git a/pkg/rpccache/subscriber.go b/pkg/rpccache/subscriber.go index ca95e18e0..3046f84b1 100644 --- a/pkg/rpccache/subscriber.go +++ b/pkg/rpccache/subscriber.go @@ -19,6 +19,7 @@ import ( "encoding/json" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) func subscriberRedisDeleteCache(ctx context.Context, client redis.UniversalClient, channel string, del func(ctx context.Context, key ...string)) { diff --git a/pkg/rpccache/user.go b/pkg/rpccache/user.go index 907a3d46e..007bbcf4d 100644 --- a/pkg/rpccache/user.go +++ b/pkg/rpccache/user.go @@ -24,6 +24,7 @@ import ( "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" ) func NewUserLocalCache(client rpcclient.UserRpcClient, cli redis.UniversalClient) *UserLocalCache { diff --git a/tools/component/component.go b/tools/component/component.go index 4ecac5d97..c2b2e689d 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -18,14 +18,14 @@ import ( "errors" "flag" "fmt" + "github.com/IBM/sarama" + "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" + "gopkg.in/yaml.v2" "os" "strconv" "strings" "time" - "github.com/IBM/sarama" - "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" - "github.com/openimsdk/tools/component" "github.com/openimsdk/tools/errs"