From 84c068783d7e47baf3202ac2df106fba087d4108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A7=E9=98=B3=E6=B0=8F?= Date: Mon, 25 Jul 2022 17:07:47 +0800 Subject: [PATCH 01/53] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20firebase=20cloud=20m?= =?UTF-8?q?essage=20=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=20(#236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 新增 firebase cloud message 消息推送 新增 api接口 /third/fcm_update_token 用于更新客户端获取到 FCM token 同步到服务器 * mongodb授权缺少授权数据库 windows下面的编译+启动 --- cmd/open_im_api/main.go | 1 + config/config.yaml | 3 + go.mod | 4 +- go.sum | 376 ++++++++++++++++++++++++- internal/api/third/fcm_update_token.go | 52 ++++ internal/push/fcm/push.go | 98 +++++++ internal/push/logic/init.go | 5 + pkg/common/config/config.go | 4 + pkg/common/db/RedisModel.go | 11 + pkg/common/db/model.go | 11 +- script/win_build_all_service.cmd | 22 ++ script/win_start_all_service.cmd | 22 ++ 12 files changed, 602 insertions(+), 7 deletions(-) create mode 100644 internal/api/third/fcm_update_token.go create mode 100644 internal/push/fcm/push.go create mode 100644 script/win_build_all_service.cmd create mode 100644 script/win_start_all_service.cmd diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 37ceefff2..4423d0d4f 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -131,6 +131,7 @@ func main() { thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL) thirdGroup.POST("/get_rtc_invitation_info", apiThird.GetRTCInvitationInfo) thirdGroup.POST("/get_rtc_invitation_start_app", apiThird.GetRTCInvitationInfoStartApp) + thirdGroup.POST("/fcm_update_token", apiThird.FcmUpdateToken) } //Message chatGroup := r.Group("/msg") diff --git a/config/config.yaml b/config/config.yaml index 1c39886e0..84353f073 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -215,6 +215,9 @@ push: appKey: "" intent: "" enable: false + fcm: #firebase cloud message 消息推送 + serviceAccount: "openim-*-firebase-adminsdk-*-*.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 + enable: false diff --git a/go.mod b/go.mod index 5fefcb9d6..3274c0a73 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,8 @@ module Open_IM go 1.15 require ( + cloud.google.com/go/firestore v1.6.1 // indirect + firebase.google.com/go v3.13.0+incompatible github.com/Shopify/sarama v1.32.0 github.com/alibabacloud-go/darabonba-openapi v0.1.11 github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 @@ -52,7 +54,7 @@ require ( golang.org/x/net v0.0.0-20220622184535-263ec571b305 golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect golang.org/x/tools v0.1.11 // indirect - google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect + google.golang.org/api v0.59.0 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect diff --git a/go.sum b/go.sum index fea29fb1c..977d8f882 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,56 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1 h1:8rBq3zRjnHx8UtBvaOWqBB1xq9jH6/wltfQLlTMh2Fw= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= +firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -65,6 +115,7 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -95,6 +146,7 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= @@ -120,6 +172,9 @@ github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjX github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -170,12 +225,25 @@ github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -185,26 +253,58 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= @@ -217,7 +317,10 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= @@ -253,6 +356,8 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -378,6 +483,7 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -443,8 +549,10 @@ github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49 github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -457,6 +565,13 @@ go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= @@ -468,6 +583,8 @@ go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -482,15 +599,41 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= @@ -504,24 +647,40 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -530,13 +689,29 @@ golang.org/x/net v0.0.0-20220622184535-263ec571b305 h1:dAgbJ2SP4jD6XYfMNLVj0BF21 golang.org/x/net v0.0.0-20220622184535-263ec571b305/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= @@ -546,33 +721,67 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -581,27 +790,75 @@ golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= @@ -612,26 +869,132 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0 h1:fPfFO7gttlXYo2ALuD3HxJzh8vaF++4youI0BkFL6GE= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351 h1:uf3hR4mj3fn7tjJL1f0kkRqFE7GDPoBiyvLxvu1Gt/g= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -640,6 +1003,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -682,7 +1046,15 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/internal/api/third/fcm_update_token.go b/internal/api/third/fcm_update_token.go new file mode 100644 index 000000000..a5a3a9d42 --- /dev/null +++ b/internal/api/third/fcm_update_token.go @@ -0,0 +1,52 @@ +package apiThird + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "net/http" + + "github.com/gin-gonic/gin" +) + +/** + * FCM第三方上报Token + */ +type FcmUpdateTokenReq struct { + OperationID string `json:"operationID"` + Platform int `json:"platform" binding:"required,min=1,max=2"` //only for ios + android + FcmToken string `json:"fcmToken"` +} + +func FcmUpdateToken(c *gin.Context) { + var ( + req FcmUpdateTokenReq + ) + if err := c.Bind(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req) + + ok, UserId, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req, UserId) + //逻辑处理开始 + err := db.DB.SetFcmToken(UserId, int(req.Platform), req.FcmToken, 0) + if err != nil { + errMsg := req.OperationID + " " + "SetFcmToken failed " + err.Error() + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + //逻辑处理完毕 + c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) + return +} diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go new file mode 100644 index 000000000..6fcfad70d --- /dev/null +++ b/internal/push/fcm/push.go @@ -0,0 +1,98 @@ +package push + +import ( + "Open_IM/internal/push" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "context" + "log" + "path/filepath" + "strconv" + + firebase "firebase.google.com/go" + "firebase.google.com/go/messaging" + "google.golang.org/api/option" +) + +type Fcm struct { +} + +var ( + FcmClient *Fcm + FcmMsgCli *messaging.Client +) + +func init() { + FcmClient = newFcmClient() +} + +func newFcmClient() *Fcm { + opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount)) + fcmApp, err := firebase.NewApp(context.Background(), nil, opt) + if err != nil { + log.Println("error initializing app: %v\n", err) + return nil + } + //授权 + // fcmClient, err := fcmApp.Auth(context.Background()) + // if err != nil { + // log.Println("error getting Auth client: %v\n", err) + // return + // } + // log.Printf("%#v\r\n", fcmClient) + ctx := context.Background() + FcmMsgCli, err = fcmApp.Messaging(ctx) + if err != nil { + log.Fatalf("error getting Messaging client: %v\n", err) + return nil + } + log.Println(FcmMsgCli) + return &Fcm{} +} + +func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) { + //需要一个客户端的Token + // accounts->registrationToken + Tokens := make([]string, 0) + for _, account := range accounts { + IosfcmToken, IosErr := db.DB.GetFcmToken(account, 1) + AndroidfcmToken, AndroidErr := db.DB.GetFcmToken(account, 2) + if IosErr == nil { + Tokens = append(Tokens, IosfcmToken) + } + if AndroidErr == nil { + Tokens = append(Tokens, AndroidfcmToken) + } + } + tokenlen := len(Tokens) + // 500组为一个推送,我们用400好了 + limit := 400 + pages := int((tokenlen-1)/limit + 1) + Success := 0 + Fail := 0 + for i := 0; i < pages; i++ { + Msg := new(messaging.MulticastMessage) + Msg.Notification.Body = detailContent + Msg.Notification.Title = alert + ctx := context.Background() + max := (i+1)*limit - 1 + if max >= tokenlen { + max = tokenlen-1 + } + Msg.Tokens = Tokens[i*limit : max] + //SendMulticast sends the given multicast message to all the FCM registration tokens specified. + //The tokens array in MulticastMessage may contain up to 500 tokens. + //SendMulticast uses the `SendAll()` function to send the given message to all the target recipients. + //The responses list obtained from the return value corresponds to the order of the input tokens. + //An error from SendMulticast indicates a total failure -- i.e. + //the message could not be sent to any of the recipients. + //Partial failures are indicated by a `BatchResponse` return value. + response, err := FcmMsgCli.SendMulticast(ctx, Msg) + if err != nil { + log.Fatalln(err) + } + Success = Success + response.SuccessCount + Fail = Fail + response.FailureCount + } + return strconv.Itoa(Success) + " Success," + strconv.Itoa(Fail) + " Fail", nil +} diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go index c9e168940..0b540af6a 100644 --- a/internal/push/logic/init.go +++ b/internal/push/logic/init.go @@ -8,6 +8,7 @@ package logic import ( pusher "Open_IM/internal/push" + fcm "Open_IM/internal/push/fcm" "Open_IM/internal/push/getui" jpush "Open_IM/internal/push/jpush" "Open_IM/pkg/common/config" @@ -41,6 +42,10 @@ func init() { if config.Config.Push.Jpns.Enable { offlinePusher = jpush.JPushClient } + + if config.Config.Push.Fcm.Enable { + offlinePusher = fcm.FcmClient + } } func Run() { diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 3ed175fe1..d0ad6a235 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -190,6 +190,10 @@ type config struct { Intent string `yaml:"intent"` MasterSecret string `yaml:"masterSecret"` } + Fcm struct { + ServiceAccount string `yaml:"serviceAccount"` + Enable bool `yaml:"enable"` + } } Manager struct { AppManagerUid []string `yaml:"appManagerUid"` diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index c96fe08b4..a0238fd09 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -35,6 +35,7 @@ const ( SignalCache = "SIGNAL_CACHE:" SignalListCache = "SIGNAL_LIST_CACHE:" GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT" + FcmToken = "FCM_TOKEN:" ) @@ -427,3 +428,13 @@ func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, err err = json.Unmarshal(bytes, userInfo) return userInfo, err } + +func (d *DataBases) SetFcmToken(account string, platformid int, fcmToken string, expireTime int64) (err error) { + key := FcmToken + account + ":" + strconv.Itoa(platformid) + return d.rdb.Set(context.Background(), key, fcmToken, time.Duration(expireTime)*time.Second).Err() +} + +func (d *DataBases) GetFcmToken(account string, platformid int) (string, error) { + key := FcmToken + account + ":" + strconv.Itoa(platformid) + return d.rdb.Get(context.Background(), key).Result() +} diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 61912b670..8a43bdcba 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -2,18 +2,21 @@ package db import ( "Open_IM/pkg/common/config" - "go.mongodb.org/mongo-driver/x/bsonx" "strings" + "go.mongodb.org/mongo-driver/x/bsonx" + //"Open_IM/pkg/common/log" "Open_IM/pkg/utils" "fmt" + go_redis "github.com/go-redis/redis/v8" "go.mongodb.org/mongo-driver/mongo/options" - "gopkg.in/mgo.v2" "time" + "gopkg.in/mgo.v2" + "context" //"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -56,10 +59,10 @@ func init() { uri = config.Config.Mongo.DBUri } else { if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { - uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress, + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } else { - uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d&authSource=admin", config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } diff --git a/script/win_build_all_service.cmd b/script/win_build_all_service.cmd new file mode 100644 index 000000000..9ec7313ae --- /dev/null +++ b/script/win_build_all_service.cmd @@ -0,0 +1,22 @@ +SET ROOT=%cd% +mkdir %ROOT%\..\bin\ +cd ..\cmd\open_im_api\ && go build -ldflags="-w -s" && move open_im_api.exe %ROOT%\..\bin\ +cd ..\..\cmd\open_im_cms_api\ && go build -ldflags="-w -s" && move open_im_cms_api.exe %ROOT%\..\bin\ +cd ..\..\cmd\open_im_demo\ && go build -ldflags="-w -s" && move open_im_demo.exe %ROOT%\..\bin\ +cd ..\..\cmd\open_im_msg_gateway\ && go build -ldflags="-w -s" && move open_im_msg_gateway.exe %ROOT%\..\bin\ +cd ..\..\cmd\open_im_msg_transfer\ && go build -ldflags="-w -s" && move open_im_msg_transfer.exe %ROOT%\..\bin\ +cd ..\..\cmd\open_im_push\ && go build -ldflags="-w -s" && move open_im_push.exe %ROOT%\..\bin\ +cd ..\..\cmd\rpc\open_im_admin_cms\&& go build -ldflags="-w -s" && move open_im_admin_cms.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_auth\&& go build -ldflags="-w -s" && move open_im_auth.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_cache\&& go build -ldflags="-w -s" && move open_im_cache.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_conversation\&& go build -ldflags="-w -s" && move open_im_conversation.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_friend\&& go build -ldflags="-w -s" && move open_im_friend.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_group\&& go build -ldflags="-w -s" && move open_im_group.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_message_cms\&& go build -ldflags="-w -s" && move open_im_message_cms.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_msg\&& go build -ldflags="-w -s" && move open_im_msg.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_office\&& go build -ldflags="-w -s" && move open_im_office.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_organization\&& go build -ldflags="-w -s" && move open_im_organization.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_statistics\&& go build -ldflags="-w -s" && move open_im_statistics.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\rpc\open_im_user\&& go build -ldflags="-w -s" && move open_im_user.exe %ROOT%\..\bin\ +cd ..\..\..\cmd\Open-IM-SDK-Core\ws_wrapper\cmd\&& go build -ldflags="-w -s" open_im_sdk_server.go && move open_im_sdk_server.exe %ROOT%\..\bin\ +cd %ROOT% \ No newline at end of file diff --git a/script/win_start_all_service.cmd b/script/win_start_all_service.cmd new file mode 100644 index 000000000..e7b1c819e --- /dev/null +++ b/script/win_start_all_service.cmd @@ -0,0 +1,22 @@ +SET ROOT=%cd% +cd %ROOT%\..\bin\ +start cmd /C .\open_im_api.exe -port 10002 +start cmd /C .\open_im_cms_api.exe -port 10006 +start cmd /C .\open_im_user.exe -port 10110 +start cmd /C .\open_im_friend.exe -port 10120 +start cmd /C .\open_im_group.exe -port 10150 +start cmd /C .\open_im_auth.exe -port 10160 +start cmd /C .\open_im_admin_cms.exe -port 10200 +start cmd /C .\open_im_message_cms.exe -port 10190 +start cmd /C .\open_im_statistics.exe -port 10180 +start cmd /C .\open_im_msg.exe -port 10130 +start cmd /C .\open_im_office.exe -port 10210 +start cmd /C .\open_im_organization.exe -port 10220 +start cmd /C .\open_im_conversation.exe -port 10230 +start cmd /C .\open_im_cache.exe -port 10240 +start cmd /C .\open_im_push.exe -port 10170 +start cmd /C .\open_im_msg_transfer.exe +start cmd /C .\open_im_sdk_server.exe -openIM_api_port 10002 -openIM_ws_port 10001 -sdk_ws_port 10003 -openIM_log_level 6 +start cmd /C .\open_im_msg_gateway.exe -rpc_port 10140 -ws_port 10001 +start cmd /C .\open_im_demo.exe -port 10004 +cd %ROOT% \ No newline at end of file From 76505bd0e7625789b7ea9ba06bf26696545d5078 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Jul 2022 17:43:20 +0800 Subject: [PATCH 02/53] superGroupMaxSeq --- test/mysql/cmd/main.go | 9 +++++++ test/mysql/importuser.go | 56 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/mysql/cmd/main.go create mode 100644 test/mysql/importuser.go diff --git a/test/mysql/cmd/main.go b/test/mysql/cmd/main.go new file mode 100644 index 000000000..8bf97b919 --- /dev/null +++ b/test/mysql/cmd/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "Open_IM/test/mysql" +) + +func main() { + mysql.ImportUserToSuperGroup() +} diff --git a/test/mysql/importuser.go b/test/mysql/importuser.go new file mode 100644 index 000000000..09e535914 --- /dev/null +++ b/test/mysql/importuser.go @@ -0,0 +1,56 @@ +package mysql + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "strconv" + "time" +) + +func ImportUserToSuperGroup() { + for i := 18000000700; i <= 18000000800; i++ { + user := db.User{ + UserID: strconv.Itoa(i), + Nickname: strconv.Itoa(i), + FaceURL: "", + Gender: 0, + PhoneNumber: strconv.Itoa(i), + Birth: time.Time{}, + Email: "", + Ex: "", + CreateTime: time.Time{}, + AppMangerLevel: 0, + GlobalRecvMsgOpt: 0, + } + err := im_mysql_model.UserRegister(user) + if err != nil { + log.NewError("", err.Error(), user) + continue + } + + groupMember := db.GroupMember{ + GroupID: "3907826375", + UserID: strconv.Itoa(i), + Nickname: strconv.Itoa(i), + FaceURL: "", + RoleLevel: 0, + JoinTime: time.Time{}, + JoinSource: 0, + InviterUserID: "openIMAdmin", + OperatorUserID: "openIMAdmin", + MuteEndTime: time.Time{}, + Ex: "", + } + + err = im_mysql_model.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError("", err.Error(), user) + continue + } + + log.NewInfo("success", i) + + } + +} From a3530be7b4c4923ccea2e45f37153c119b313166 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Jul 2022 17:57:58 +0800 Subject: [PATCH 03/53] firebase update --- cmd/Open-IM-SDK-Core | 2 +- go.mod | 7 +- go.sum | 375 ++++++++++++++++++++++++++++++++++++ pkg/common/db/RedisModel.go | 11 +- 4 files changed, 390 insertions(+), 5 deletions(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index 18c0a4485..923a29698 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit 18c0a4485c8a3116bca4b782cc3879375d00d937 +Subproject commit 923a29698760e632dee555baec19e295a6ffab42 diff --git a/go.mod b/go.mod index ebe36aa77..90b7ad844 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/alibabacloud-go/tea v1.1.17 github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/bwmarrin/snowflake v0.3.0 - github.com/dtm-labs/dtmcli v1.15.0 - github.com/dtm-labs/dtmgrpc v1.15.0 + github.com/dtm-labs/dtmcli v1.15.0 // indirect + github.com/dtm-labs/dtmgrpc v1.15.0 // indirect github.com/dtm-labs/rockscache v0.0.8 github.com/fatih/structs v1.1.0 github.com/gin-gonic/gin v1.8.1 @@ -30,13 +30,14 @@ require ( github.com/jonboulle/clockwork v0.2.2 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/lestrrat-go/strftime v1.0.4 // indirect - github.com/lithammer/shortuuid v3.0.0+incompatible + github.com/lithammer/shortuuid v3.0.0+incompatible // indirect github.com/minio/minio-go/v7 v7.0.22 github.com/mitchellh/mapstructure v1.4.2 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/olivere/elastic/v7 v7.0.23 github.com/pelletier/go-toml/v2 v2.0.2 // indirect github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.11.1 github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.2 diff --git a/go.sum b/go.sum index 78606c424..767f591c2 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,58 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1 h1:8rBq3zRjnHx8UtBvaOWqBB1xq9jH6/wltfQLlTMh2Fw= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= +firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -55,6 +105,7 @@ github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLj github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= @@ -69,6 +120,7 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -106,6 +158,7 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= @@ -130,6 +183,9 @@ github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjX github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -183,12 +239,25 @@ github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkS github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -198,16 +267,21 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -215,11 +289,37 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= @@ -232,7 +332,10 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= @@ -269,6 +372,8 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -313,6 +418,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= @@ -378,23 +484,28 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -460,8 +571,10 @@ github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49 github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -474,6 +587,13 @@ go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -490,6 +610,8 @@ go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -504,17 +626,42 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= @@ -528,24 +675,40 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -556,13 +719,29 @@ golang.org/x/net v0.0.0-20220622184535-263ec571b305 h1:dAgbJ2SP4jD6XYfMNLVj0BF21 golang.org/x/net v0.0.0-20220622184535-263ec571b305/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= @@ -572,33 +751,67 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -607,27 +820,75 @@ golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= @@ -638,29 +899,134 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0 h1:fPfFO7gttlXYo2ALuD3HxJzh8vaF++4youI0BkFL6GE= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351 h1:uf3hR4mj3fn7tjJL1f0kkRqFE7GDPoBiyvLxvu1Gt/g= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -669,6 +1035,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -717,5 +1084,13 @@ gorm.io/driver/mysql v1.3.5/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10 gorm.io/gorm v1.23.8 h1:h8sGJ+biDgBA1AD1Ha9gFCx7h8npU7AsLdlkX0n2TpE= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index a40a0bbb5..0981ce3b2 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -34,7 +34,7 @@ const ( FcmToken = "FCM_TOKEN:" groupUserMinSeq = "GROUP_USER_MIN_SEQ:" groupMaxSeq = "GROUP_MAX_SEQ" - ) +) func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { key := accountTempCode + account @@ -365,3 +365,12 @@ func (d *DataBases) GetGetuiToken() (string, error) { result := d.RDB.Get(context.Background(), getuiToken) return result.String(), result.Err() } +func (d *DataBases) SetFcmToken(account string, platformid int, fcmToken string, expireTime int64) (err error) { + key := FcmToken + account + ":" + strconv.Itoa(platformid) + return d.RDB.Set(context.Background(), key, fcmToken, time.Duration(expireTime)*time.Second).Err() +} + +func (d *DataBases) GetFcmToken(account string, platformid int) (string, error) { + key := FcmToken + account + ":" + strconv.Itoa(platformid) + return d.RDB.Get(context.Background(), key).Result() +} From ccf6ef614017f07e23cc43c5618b95094abce28c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Jul 2022 19:19:00 +0800 Subject: [PATCH 04/53] super group add verification --- internal/rpc/msg/send_msg.go | 94 ++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index d7cda9170..702d9898f 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -68,13 +68,14 @@ func isMessageHasReadEnabled(pb *pbChat.SendMsgReq) (bool, int32, string) { return true, 0, "" } -func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { - if data.MsgData.SessionType == constant.SingleChatType { +func messageVerification(data *pbChat.SendMsgReq) (bool, int32, string, []string) { + switch data.MsgData.SessionType { + case constant.SingleChatType: if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) { - return true, 0, "" + return true, 0, "", nil } if data.MsgData.ContentType <= constant.FriendApplicationNotification && data.MsgData.ContentType >= constant.FriendApplicationApprovedNotification { - return true, 0, "" + return true, 0, "", nil } log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} @@ -82,7 +83,7 @@ func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) if etcdConn == nil { errMsg := data.OperationID + "getcdv3.GetConn == nil" log.NewError(data.OperationID, errMsg) - return true, 0, "" + return true, 0, "", nil } cacheClient := cacheRpc.NewCacheClient(etcdConn) @@ -94,7 +95,7 @@ func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) log.NewError(data.OperationID, "GetBlackIDListFromCache rpc logic call failed ", cacheResp.String()) } else { if utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 600, "in black list" + return false, 600, "in black list", nil } } } @@ -105,7 +106,7 @@ func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) if etcdConn == nil { errMsg := data.OperationID + "getcdv3.GetConn == nil" log.NewError(data.OperationID, errMsg) - return true, 0, "" + return true, 0, "", nil } cacheClient := cacheRpc.NewCacheClient(etcdConn) cacheResp, err := cacheClient.GetFriendIDListFromCache(context.Background(), reqGetFriendIDListFromCache) @@ -116,18 +117,49 @@ func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) log.NewError(data.OperationID, "GetFriendIDListFromCache rpc logic call failed ", cacheResp.String()) } else { if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 601, "not friend" + return false, 601, "not friend", nil } } } - return true, 0, "" + return true, 0, "", nil } else { - return true, 0, "" + return true, 0, "", nil } + case constant.GroupChatType: + fallthrough + case constant.SuperGroupChatType: + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: data.OperationID, GroupID: data.MsgData.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, data.OperationID) + if etcdConn == nil { + errMsg := data.OperationID + "getcdv3.GetConn == nil" + log.NewError(data.OperationID, errMsg) + //return returnMsg(&replay, pb, 201, errMsg, "", 0) + return false, 201, errMsg, nil + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(data.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + //return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache failed", "", 0) + return false, 201, err.Error(), nil + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(data.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + //return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache logic failed", "", 0) + return false, cacheResp.CommonResp.ErrCode, cacheResp.CommonResp.ErrMsg, nil + } + if !token_verify.IsManagerUserID(data.MsgData.SendID) { + if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { + //return returnMsg(&replay, pb, 202, "you are not in group", "", 0) + return false, 202, "you are not in group", nil + } + } + return true, 0, "", cacheResp.UserIDList - } else { - return true, 0, "" + default: + return true, 0, "", nil } + } func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { msg.ServerMsgID = GetMsgID(msg.SendID) @@ -186,7 +218,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) } - flag, errCode, errMsg = userRelationshipVerification(pb) + flag, errCode, errMsg, _ = messageVerification(pb) log.Info(pb.OperationID, "userRelationshipVerification ", flag) if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) @@ -257,25 +289,11 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp) return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } - getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, msgToMQSingle.OperationID) - if etcdConn == nil { - errMsg := msgToMQSingle.OperationID + "getcdv3.GetConn == nil" - log.NewError(msgToMQSingle.OperationID, errMsg) - return returnMsg(&replay, pb, 201, errMsg, "", 0) + var memberUserIDList []string + if flag, errCode, errMsg, memberUserIDList = messageVerification(pb); !flag { + return returnMsg(&replay, pb, errCode, errMsg, "", 0) } - client := pbCache.NewCacheClient(etcdConn) - cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) - if err != nil { - log.NewError(pb.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) - return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache failed", "", 0) - } - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(pb.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) - return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache logic failed", "", 0) - } - memberUserIDList := cacheResp.UserIDList - log.Debug(pb.OperationID, "GetGroupAllMember userID list", cacheResp.UserIDList, "len: ", len(cacheResp.UserIDList)) + log.Debug(pb.OperationID, "GetGroupAllMember userID list", memberUserIDList, "len: ", len(memberUserIDList)) var addUidList []string switch pb.MsgData.ContentType { case constant.MemberKickedNotification: @@ -301,11 +319,6 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S if len(addUidList) > 0 { memberUserIDList = append(memberUserIDList, addUidList...) } - if !token_verify.IsManagerUserID(pb.MsgData.SendID) { - if !utils.IsContain(pb.MsgData.SendID, memberUserIDList) { - return returnMsg(&replay, pb, 202, "you are not in group", "", 0) - } - } m := make(map[string][]string, 2) m[constant.OnlineStatus] = memberUserIDList log.Debug(pb.OperationID, "send msg cost time1 ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) @@ -440,14 +453,11 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg result", "end rpc and return", callbackResp) return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } + if flag, errCode, errMsg, _ = messageVerification(pb); !flag { + return returnMsg(&replay, pb, errCode, errMsg, "", 0) + } msgToMQSingle.MsgData = pb.MsgData log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) - err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus) - if err1 != nil { - log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - // callback callbackResp = callbackAfterSendSingleMsg(pb) if callbackResp.ErrCode != 0 { From 75618316247e0fd63c8d9a94feb445f933ae1b11 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Jul 2022 20:03:04 +0800 Subject: [PATCH 05/53] super group add verification --- internal/push/fcm/push.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 6fcfad70d..a9c7e5b39 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -23,7 +23,7 @@ var ( ) func init() { - FcmClient = newFcmClient() + //FcmClient = newFcmClient() } func newFcmClient() *Fcm { @@ -77,7 +77,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, ctx := context.Background() max := (i+1)*limit - 1 if max >= tokenlen { - max = tokenlen-1 + max = tokenlen - 1 } Msg.Tokens = Tokens[i*limit : max] //SendMulticast sends the given multicast message to all the FCM registration tokens specified. From bb9f7bb27b1f8671eed8c51f75ff8e6a23f4b097 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Jul 2022 20:38:28 +0800 Subject: [PATCH 06/53] super group add verification --- cmd/Open-IM-SDK-Core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index 923a29698..c5e258fa8 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit 923a29698760e632dee555baec19e295a6ffab42 +Subproject commit c5e258fa82dd11c9ca1e553a56920bad3f1a4b73 From 09b830bcf97b6185a7a51c730742fb48e5297182 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Jul 2022 21:36:21 +0800 Subject: [PATCH 07/53] super group add verification --- internal/rpc/msg/send_msg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 702d9898f..2892be4ab 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -458,6 +458,11 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } msgToMQSingle.MsgData = pb.MsgData log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) + err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus) + if err1 != nil { + log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } // callback callbackResp = callbackAfterSendSingleMsg(pb) if callbackResp.ErrCode != 0 { From cf205c24805a14ce68e97938d8240eb7bab997df Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Jul 2022 15:16:46 +0800 Subject: [PATCH 08/53] superGroupMaxSeq --- cmd/open_im_api/main.go | 1 + internal/api/manage/management_chat.go | 102 +++++-- internal/rpc/msg/msg_status.go | 40 +++ internal/rpc/msg/pull_message.go | 1 + pkg/base_info/manage_api_struct.go | 22 +- pkg/common/constant/constant.go | 42 +-- pkg/common/db/RedisModel.go | 9 + pkg/common/db/rocks_cache/rocks_cache.go | 19 +- pkg/proto/msg/msg.pb.go | 370 +++++++++++++++++++---- pkg/proto/msg/msg.proto | 23 +- test/mysql/cmd/main.go | 9 - test/mysql/importuser.go | 56 ---- 12 files changed, 521 insertions(+), 173 deletions(-) create mode 100644 internal/rpc/msg/msg_status.go delete mode 100644 test/mysql/cmd/main.go delete mode 100644 test/mysql/importuser.go diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 63be3a496..873d328d5 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -143,6 +143,7 @@ func main() { chatGroup.POST("/clear_msg", apiChat.ClearMsg) chatGroup.POST("/manage_send_msg", manage.ManagementSendMsg) chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg) + chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess) chatGroup.POST("/set_msg_min_seq", apiChat.SetMsgMinSeq) } //Conversation diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 50be90c0a..79896622b 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -28,6 +28,13 @@ import ( var validate *validator.Validate +func SetOptions(options map[string]bool, value bool) { + utils.SetSwitchFromOptions(options, constant.IsOfflinePush, value) + utils.SetSwitchFromOptions(options, constant.IsHistory, value) + utils.SetSwitchFromOptions(options, constant.IsPersistent, value) + utils.SetSwitchFromOptions(options, constant.IsSenderSync, value) +} + func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { var newContent string var err error @@ -50,11 +57,15 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { } options := make(map[string]bool, 5) if params.IsOnlineOnly { - utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) - utils.SetSwitchFromOptions(options, constant.IsHistory, false) - utils.SetSwitchFromOptions(options, constant.IsPersistent, false) - utils.SetSwitchFromOptions(options, constant.IsSenderSync, false) + SetOptions(options, false) } + if params.ContentType == constant.CustomMsgOnlineOnly { + SetOptions(options, false) + } else if params.ContentType == constant.CustomMsgNotTriggerConversation { + SetOptions(options, false) + utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false) + } + pbData := pbChat.SendMsgReq{ OperationID: params.OperationID, MsgData: &open_im_sdk.MsgData{ @@ -135,6 +146,10 @@ func ManagementSendMsg(c *gin.Context) { case constant.OANotification: data = OANotificationElem{} params.SessionType = constant.NotificationChatType + case constant.CustomMsgNotTriggerConversation: + data = CustomElem{} + case constant.CustomMsgOnlineOnly: + data = CustomElem{} //case constant.HasReadReceipt: //case constant.Typing: //case constant.Quote: @@ -193,14 +208,21 @@ func ManagementSendMsg(c *gin.Context) { return } client := pbChat.NewMsgClient(etcdConn) - log.Info(params.OperationID, "", "api ManagementSendMsg call, api call rpc...") - RpcResp, err := client.SendMsg(context.Background(), pbData) - if err != nil { - log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) - return + if err != nil || (RpcResp != nil && RpcResp.ErrCode != 0) { + resp, err2 := client.SetSendMsgFailedFlag(context.Background(), &pbChat.SetSendMsgFailedFlagReq{OperationID: params.OperationID}) + if err2 != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error()) + } + if resp != nil && resp.ErrCode != 0 { + log.NewError(params.OperationID, utils.GetSelfFuncName(), resp.ErrCode, resp.ErrMsg) + } + if err != nil { + log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) + return + } } log.Info(params.OperationID, "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}} @@ -255,6 +277,10 @@ func ManagementBatchSendMsg(c *gin.Context) { case constant.OANotification: data = OANotificationElem{} params.SessionType = constant.NotificationChatType + case constant.CustomMsgNotTriggerConversation: + data = CustomElem{} + case constant.CustomMsgOnlineOnly: + data = CustomElem{} //case constant.HasReadReceipt: //case constant.Typing: //case constant.Quote: @@ -283,9 +309,19 @@ func ManagementBatchSendMsg(c *gin.Context) { if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""}) return - } log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params) + var msgSendFailedFlag bool + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + //resp.Data.FailedIDList = params.RecvIDList + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "rpc server error: etcdConn == nil"}) + return + } + client := pbChat.NewMsgClient(etcdConn) for _, recvID := range params.RecvIDList { req := &api.ManagementSendMsgReq{ ManagementSendMsg: params.ManagementSendMsg, @@ -294,23 +330,18 @@ func ManagementBatchSendMsg(c *gin.Context) { pbData := newUserSendMsgReq(req) pbData.MsgData.RecvID = recvID log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, params.OperationID) - if etcdConn == nil { - errMsg := params.OperationID + "getcdv3.GetConn == nil" - log.NewError(params.OperationID, errMsg) - resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) - continue - } - client := pbChat.NewMsgClient(etcdConn) + rpcResp, err := client.SendMsg(context.Background(), pbData) if err != nil { log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + msgSendFailedFlag = true continue } if rpcResp.ErrCode != 0 { log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData, rpcResp) resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + msgSendFailedFlag = true continue } resp.Data.ResultList = append(resp.Data.ResultList, server_api_params.UserSendMsgResp{ @@ -319,11 +350,44 @@ func ManagementBatchSendMsg(c *gin.Context) { SendTime: rpcResp.SendTime, }) } + if msgSendFailedFlag { + resp, err2 := client.SetSendMsgFailedFlag(context.Background(), &pbChat.SetSendMsgFailedFlagReq{OperationID: params.OperationID}) + if err2 != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), err2.Error()) + } + if resp != nil && resp.ErrCode != 0 { + log.NewError(params.OperationID, utils.GetSelfFuncName(), resp.ErrCode, resp.ErrMsg) + } + } log.NewInfo(params.OperationID, utils.GetSelfFuncName(), "resp: ", resp) c.JSON(http.StatusOK, resp) } +func CheckMsgIsSendSuccess(c *gin.Context) { + var req api.CheckMsgIsSendSuccessReq + var resp api.CheckMsgIsSendSuccessResp + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + client := pbChat.NewMsgClient(etcdConn) + rpcResp, err := client.GetSendMsgStatus(context.Background(), &pbChat.GetSendMsgStatusReq{OperationID: req.OperationID}) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call GetSendMsgStatus rpc server failed"}) + return + } + resp.ErrMsg = rpcResp.ErrMsg + resp.ErrCode = rpcResp.ErrCode + resp.Status = rpcResp.Status + c.JSON(http.StatusOK, resp) +} + type PictureBaseInfo struct { UUID string `mapstructure:"uuid"` Type string `mapstructure:"type" ` diff --git a/internal/rpc/msg/msg_status.go b/internal/rpc/msg/msg_status.go new file mode 100644 index 000000000..9aff2b517 --- /dev/null +++ b/internal/rpc/msg/msg_status.go @@ -0,0 +1,40 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/msg" + "Open_IM/pkg/utils" + "context" + goRedis "github.com/go-redis/redis/v8" +) + +func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req pbMsg.SetSendMsgFailedFlagReq) (resp pbMsg.SetSendMsgFailedFlagResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + if err := db.DB.SetSendMsgFailedFlag(req.OperationID); err != nil { + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp.String()) + return resp, nil +} + +func (rpc *rpcChat) GetSendMsgStatus(_ context.Context, req pbMsg.GetSendMsgStatusReq) (resp pbMsg.GetSendMsgStatusResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + if err := db.DB.GetSendMsgStatus(req.OperationID); err != nil { + if err == goRedis.Nil { + resp.Status = 0 + return + } else { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + resp.ErrMsg = err.Error() + resp.ErrCode = constant.ErrDB.ErrCode + return + } + } + resp.Status = 1 + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp.String()) + return resp, nil +} diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go index e5d09ca12..4fcf9f9f7 100644 --- a/internal/rpc/msg/pull_message.go +++ b/internal/rpc/msg/pull_message.go @@ -43,6 +43,7 @@ func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *open_im_sdk.GetMaxAnd resp.GroupMaxAndMinSeq = m return resp, nil } + func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.PullMessageBySeqListReq) (*open_im_sdk.PullMessageBySeqListResp, error) { log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) resp := new(open_im_sdk.PullMessageBySeqListResp) diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go index 5c249b3f7..52634839f 100644 --- a/pkg/base_info/manage_api_struct.go +++ b/pkg/base_info/manage_api_struct.go @@ -40,12 +40,13 @@ type AccountCheckResp struct { } type ManagementSendMsg struct { - OperationID string `json:"operationID" binding:"required"` - SendID string `json:"sendID" binding:"required"` - GroupID string `json:"groupID" ` - SenderNickname string `json:"senderNickname" ` - SenderFaceURL string `json:"senderFaceURL" ` - SenderPlatformID int32 `json:"senderPlatformID"` + OperationID string `json:"operationID" binding:"required"` + BusinessOperationID string `json:"businessOperationID"` + SendID string `json:"sendID" binding:"required"` + GroupID string `json:"groupID" ` + SenderNickname string `json:"senderNickname" ` + SenderFaceURL string `json:"senderFaceURL" ` + SenderPlatformID int32 `json:"senderPlatformID"` //ForceList []string `json:"forceList" ` Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"` ContentType int32 `json:"contentType" binding:"required"` @@ -76,3 +77,12 @@ type ManagementBatchSendMsgResp struct { FailedIDList []string } `json:"data"` } + +type CheckMsgIsSendSuccessReq struct { + OperationID string +} + +type CheckMsgIsSendSuccessResp struct { + CommResp + Status int32 `json:"status"` +} diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 3deeed5e6..8c6c45ec0 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -28,24 +28,30 @@ const ( ///ContentType //UserRelated - Text = 101 - Picture = 102 - Voice = 103 - Video = 104 - File = 105 - AtText = 106 - Merger = 107 - Card = 108 - Location = 109 - Custom = 110 - Revoke = 111 - HasReadReceipt = 112 - Typing = 113 - Quote = 114 - GroupHasReadReceipt = 116 - Common = 200 - GroupMsg = 201 - SignalMsg = 202 + Text = 101 + Picture = 102 + Voice = 103 + Video = 104 + File = 105 + AtText = 106 + Merger = 107 + Card = 108 + Location = 109 + Custom = 110 + Revoke = 111 + HasReadReceipt = 112 + Typing = 113 + Quote = 114 + GroupHasReadReceipt = 116 + AdvancedText = 117 + AdvancedRevoke = 118 //影响前者消息 + CustomMsgNotTriggerConversation = 119 + CustomMsgOnlineOnly = 120 + + Common = 200 + GroupMsg = 201 + SignalMsg = 202 + CustomNotification = 203 //SysRelated NotificationBegin = 1000 diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index bd6d634bc..01b75ea27 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -33,6 +33,7 @@ const ( GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT" groupUserMinSeq = "GROUP_USER_MIN_SEQ:" groupMaxSeq = "GROUP_MAX_SEQ" + sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG" ) func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { @@ -364,3 +365,11 @@ func (d *DataBases) GetGetuiToken() (string, error) { result := d.RDB.Get(context.Background(), getuiToken) return result.String(), result.Err() } + +func (d *DataBases) SetSendMsgFailedFlag(operationID string) error { + return d.RDB.Set(context.Background(), sendMsgFailedFlag+operationID, 1, time.Hour*24).Err() +} + +func (d *DataBases) GetSendMsgStatus(operationID string) error { + return d.RDB.Get(context.Background(), sendMsgFailedFlag+operationID).Err() +} diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index 25a9b00be..3fe11f509 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -3,6 +3,7 @@ package rocksCache import ( "Open_IM/pkg/common/db" imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "context" "encoding/json" @@ -29,6 +30,7 @@ func init() { fmt.Println("init to del old keys") for _, key := range []string{groupCache, friendRelationCache, blackListCache, userInfoCache, groupInfoCache, groupOwnerIDCache, joinedGroupListCache, groupMemberInfoCache, groupAllMemberInfoCache, allFriendInfoCache} { + fName := utils.GetSelfFuncName() var cursor uint64 var n int for { @@ -40,10 +42,19 @@ func init() { } n += len(keys) //fmt.Printf("\n %s key found %d keys: %v, current cursor %d\n", key, n, keys, cursor) - if len(keys) > 0 { - err = db.DB.RDB.Del(context.Background(), keys...).Err() - if err != nil { - panic(err.Error()) + //if len(keys) > 0 { + // err = db.DB.RDB.Del(context.Background(), keys...).Err() + // if err != nil { + // panic(err.Error()) + // } + //} + for _, key := range keys { + if err = db.DB.RDB.Del(context.Background(), key).Err(); err != nil { + log.NewError("", fName, key, err.Error()) + err = db.DB.RDB.Del(context.Background(), key).Err() + if err != nil { + panic(err.Error()) + } } } if cursor == 0 { diff --git a/pkg/proto/msg/msg.pb.go b/pkg/proto/msg/msg.pb.go index 807281950..f2002012f 100644 --- a/pkg/proto/msg/msg.pb.go +++ b/pkg/proto/msg/msg.pb.go @@ -37,7 +37,7 @@ func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*MsgDataToMQ) ProtoMessage() {} func (*MsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{0} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{0} } func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) @@ -90,7 +90,7 @@ func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } func (*MsgDataToDB) ProtoMessage() {} func (*MsgDataToDB) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{1} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{1} } func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) @@ -137,7 +137,7 @@ func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*PushMsgDataToMQ) ProtoMessage() {} func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{2} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{2} } func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) @@ -192,7 +192,7 @@ func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } func (*MsgDataToMongoByMQ) ProtoMessage() {} func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{3} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{3} } func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) @@ -272,7 +272,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{4} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{4} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -320,7 +320,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{5} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{5} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -381,7 +381,7 @@ func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } func (*SendMsgReq) ProtoMessage() {} func (*SendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{6} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{6} } func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) @@ -437,7 +437,7 @@ func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } func (*SendMsgResp) ProtoMessage() {} func (*SendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{7} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{7} } func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) @@ -505,7 +505,7 @@ func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} } func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } func (*ClearMsgReq) ProtoMessage() {} func (*ClearMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{8} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{8} } func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) @@ -558,7 +558,7 @@ func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} } func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } func (*ClearMsgResp) ProtoMessage() {} func (*ClearMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{9} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{9} } func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) @@ -607,7 +607,7 @@ func (m *SetMsgMinSeqReq) Reset() { *m = SetMsgMinSeqReq{} } func (m *SetMsgMinSeqReq) String() string { return proto.CompactTextString(m) } func (*SetMsgMinSeqReq) ProtoMessage() {} func (*SetMsgMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{10} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{10} } func (m *SetMsgMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetMsgMinSeqReq.Unmarshal(m, b) @@ -674,7 +674,7 @@ func (m *SetMsgMinSeqResp) Reset() { *m = SetMsgMinSeqResp{} } func (m *SetMsgMinSeqResp) String() string { return proto.CompactTextString(m) } func (*SetMsgMinSeqResp) ProtoMessage() {} func (*SetMsgMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_f78465087fd6709c, []int{11} + return fileDescriptor_msg_b3ce531eb8197ddf, []int{11} } func (m *SetMsgMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetMsgMinSeqResp.Unmarshal(m, b) @@ -708,6 +708,182 @@ func (m *SetMsgMinSeqResp) GetErrMsg() string { return "" } +type SetSendMsgFailedFlagReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetSendMsgFailedFlagReq) Reset() { *m = SetSendMsgFailedFlagReq{} } +func (m *SetSendMsgFailedFlagReq) String() string { return proto.CompactTextString(m) } +func (*SetSendMsgFailedFlagReq) ProtoMessage() {} +func (*SetSendMsgFailedFlagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_b3ce531eb8197ddf, []int{12} +} +func (m *SetSendMsgFailedFlagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Unmarshal(m, b) +} +func (m *SetSendMsgFailedFlagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Marshal(b, m, deterministic) +} +func (dst *SetSendMsgFailedFlagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetSendMsgFailedFlagReq.Merge(dst, src) +} +func (m *SetSendMsgFailedFlagReq) XXX_Size() int { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Size(m) +} +func (m *SetSendMsgFailedFlagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetSendMsgFailedFlagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetSendMsgFailedFlagReq proto.InternalMessageInfo + +func (m *SetSendMsgFailedFlagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetSendMsgFailedFlagResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetSendMsgFailedFlagResp) Reset() { *m = SetSendMsgFailedFlagResp{} } +func (m *SetSendMsgFailedFlagResp) String() string { return proto.CompactTextString(m) } +func (*SetSendMsgFailedFlagResp) ProtoMessage() {} +func (*SetSendMsgFailedFlagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_b3ce531eb8197ddf, []int{13} +} +func (m *SetSendMsgFailedFlagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Unmarshal(m, b) +} +func (m *SetSendMsgFailedFlagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Marshal(b, m, deterministic) +} +func (dst *SetSendMsgFailedFlagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetSendMsgFailedFlagResp.Merge(dst, src) +} +func (m *SetSendMsgFailedFlagResp) XXX_Size() int { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Size(m) +} +func (m *SetSendMsgFailedFlagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetSendMsgFailedFlagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetSendMsgFailedFlagResp proto.InternalMessageInfo + +func (m *SetSendMsgFailedFlagResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SetSendMsgFailedFlagResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetSendMsgStatusReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSendMsgStatusReq) Reset() { *m = GetSendMsgStatusReq{} } +func (m *GetSendMsgStatusReq) String() string { return proto.CompactTextString(m) } +func (*GetSendMsgStatusReq) ProtoMessage() {} +func (*GetSendMsgStatusReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_b3ce531eb8197ddf, []int{14} +} +func (m *GetSendMsgStatusReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSendMsgStatusReq.Unmarshal(m, b) +} +func (m *GetSendMsgStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSendMsgStatusReq.Marshal(b, m, deterministic) +} +func (dst *GetSendMsgStatusReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSendMsgStatusReq.Merge(dst, src) +} +func (m *GetSendMsgStatusReq) XXX_Size() int { + return xxx_messageInfo_GetSendMsgStatusReq.Size(m) +} +func (m *GetSendMsgStatusReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSendMsgStatusReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSendMsgStatusReq proto.InternalMessageInfo + +func (m *GetSendMsgStatusReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetSendMsgStatusResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSendMsgStatusResp) Reset() { *m = GetSendMsgStatusResp{} } +func (m *GetSendMsgStatusResp) String() string { return proto.CompactTextString(m) } +func (*GetSendMsgStatusResp) ProtoMessage() {} +func (*GetSendMsgStatusResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_b3ce531eb8197ddf, []int{15} +} +func (m *GetSendMsgStatusResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSendMsgStatusResp.Unmarshal(m, b) +} +func (m *GetSendMsgStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSendMsgStatusResp.Marshal(b, m, deterministic) +} +func (dst *GetSendMsgStatusResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSendMsgStatusResp.Merge(dst, src) +} +func (m *GetSendMsgStatusResp) XXX_Size() int { + return xxx_messageInfo_GetSendMsgStatusResp.Size(m) +} +func (m *GetSendMsgStatusResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSendMsgStatusResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSendMsgStatusResp proto.InternalMessageInfo + +func (m *GetSendMsgStatusResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetSendMsgStatusResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetSendMsgStatusResp) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + func init() { proto.RegisterType((*MsgDataToMQ)(nil), "msg.MsgDataToMQ") proto.RegisterType((*MsgDataToDB)(nil), "msg.MsgDataToDB") @@ -721,6 +897,10 @@ func init() { proto.RegisterType((*ClearMsgResp)(nil), "msg.ClearMsgResp") proto.RegisterType((*SetMsgMinSeqReq)(nil), "msg.SetMsgMinSeqReq") proto.RegisterType((*SetMsgMinSeqResp)(nil), "msg.SetMsgMinSeqResp") + proto.RegisterType((*SetSendMsgFailedFlagReq)(nil), "msg.SetSendMsgFailedFlagReq") + proto.RegisterType((*SetSendMsgFailedFlagResp)(nil), "msg.SetSendMsgFailedFlagResp") + proto.RegisterType((*GetSendMsgStatusReq)(nil), "msg.GetSendMsgStatusReq") + proto.RegisterType((*GetSendMsgStatusResp)(nil), "msg.GetSendMsgStatusResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -740,6 +920,8 @@ type MsgClient interface { DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error) + SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) + GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) } type msgClient struct { @@ -804,6 +986,24 @@ func (c *msgClient) SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts return out, nil } +func (c *msgClient) SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) { + out := new(SetSendMsgFailedFlagResp) + err := grpc.Invoke(ctx, "/msg.msg/SetSendMsgFailedFlag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) { + out := new(GetSendMsgStatusResp) + err := grpc.Invoke(ctx, "/msg.msg/GetSendMsgStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Msg service type MsgServer interface { @@ -813,6 +1013,8 @@ type MsgServer interface { DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error) SetMsgMinSeq(context.Context, *SetMsgMinSeqReq) (*SetMsgMinSeqResp, error) + SetSendMsgFailedFlag(context.Context, *SetSendMsgFailedFlagReq) (*SetSendMsgFailedFlagResp, error) + GetSendMsgStatus(context.Context, *GetSendMsgStatusReq) (*GetSendMsgStatusResp, error) } func RegisterMsgServer(s *grpc.Server, srv MsgServer) { @@ -927,6 +1129,42 @@ func _Msg_SetMsgMinSeq_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_SetSendMsgFailedFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetSendMsgFailedFlagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetSendMsgFailedFlag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/SetSendMsgFailedFlag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetSendMsgFailedFlag(ctx, req.(*SetSendMsgFailedFlagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_GetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSendMsgStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GetSendMsgStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/GetSendMsgStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GetSendMsgStatus(ctx, req.(*GetSendMsgStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "msg.msg", HandlerType: (*MsgServer)(nil), @@ -955,57 +1193,71 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetMsgMinSeq", Handler: _Msg_SetMsgMinSeq_Handler, }, + { + MethodName: "SetSendMsgFailedFlag", + Handler: _Msg_SetSendMsgFailedFlag_Handler, + }, + { + MethodName: "GetSendMsgStatus", + Handler: _Msg_GetSendMsgStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "msg/msg.proto", } -func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_f78465087fd6709c) } +func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_b3ce531eb8197ddf) } -var fileDescriptor_msg_f78465087fd6709c = []byte{ - // 696 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0x96, 0x9b, 0x26, 0x69, 0xc6, 0xad, 0xd2, 0x7f, 0xff, 0x52, 0x45, 0x16, 0x07, 0xd7, 0x02, - 0x14, 0x01, 0x4a, 0xa4, 0xc0, 0xad, 0x17, 0x48, 0x53, 0xa1, 0x4a, 0x98, 0xb6, 0x4e, 0xb9, 0x70, - 0x09, 0xa6, 0x59, 0x6d, 0xad, 0xc6, 0xf6, 0x66, 0xc7, 0xa1, 0x2d, 0x3c, 0x03, 0x0f, 0xc0, 0x89, - 0x1b, 0xaf, 0xc2, 0x6b, 0xa1, 0xdd, 0x75, 0x92, 0x75, 0x12, 0xa9, 0x51, 0x0f, 0x1c, 0xbf, 0xcf, - 0xb3, 0x33, 0xdf, 0x37, 0x3b, 0xb3, 0x86, 0x9d, 0x18, 0x59, 0x3b, 0x46, 0xd6, 0xe2, 0x22, 0xcd, - 0x52, 0x52, 0x8a, 0x91, 0x39, 0x07, 0xa7, 0x9c, 0x26, 0x83, 0x13, 0xbf, 0xcd, 0xaf, 0x59, 0x5b, - 0xf1, 0x6d, 0x1c, 0x5e, 0x0f, 0x6e, 0xb0, 0x7d, 0x83, 0x3a, 0xce, 0xfb, 0x0e, 0xb6, 0x8f, 0xac, - 0x17, 0x66, 0xe1, 0x45, 0xea, 0x9f, 0x93, 0x3d, 0x28, 0x67, 0xe9, 0x35, 0x4d, 0x1a, 0x96, 0x6b, - 0x35, 0x6b, 0x81, 0x06, 0xc4, 0x05, 0x3b, 0xe5, 0x54, 0x84, 0x59, 0x94, 0x26, 0x27, 0xbd, 0xc6, - 0x86, 0xfa, 0x66, 0x52, 0xe4, 0x35, 0x54, 0x63, 0x9d, 0xa6, 0x51, 0x72, 0xad, 0xa6, 0xdd, 0x71, - 0x5a, 0x48, 0xc5, 0x57, 0x2a, 0x06, 0x21, 0x8f, 0x06, 0x3c, 0x14, 0x61, 0x8c, 0xad, 0xbc, 0x50, - 0x30, 0x0d, 0xf5, 0xa8, 0x51, 0xbc, 0xd7, 0x35, 0x93, 0x58, 0x6b, 0x27, 0xb9, 0x5f, 0x9c, 0xf7, - 0xc3, 0x82, 0xfa, 0xd9, 0x04, 0xaf, 0x4c, 0xa3, 0x2e, 0xd8, 0xa7, 0xc6, 0x29, 0x6d, 0xd7, 0xa4, - 0x4c, 0x35, 0x1b, 0xeb, 0xab, 0xf1, 0x60, 0x9b, 0x4f, 0xf0, 0xea, 0x22, 0xfd, 0x88, 0x54, 0x9c, - 0xf4, 0x54, 0x37, 0x6a, 0x41, 0x81, 0xf3, 0x7e, 0x5b, 0x40, 0xe6, 0x5a, 0xd2, 0x84, 0xa5, 0xdd, - 0x3b, 0xff, 0x9c, 0x34, 0xa0, 0x3a, 0x0a, 0x31, 0xeb, 0xd3, 0xb1, 0x92, 0xb3, 0x19, 0x4c, 0x21, - 0x79, 0x02, 0x3b, 0x21, 0x63, 0x82, 0xb2, 0xa2, 0xc9, 0x22, 0x49, 0x3a, 0x60, 0xc7, 0x14, 0x31, - 0x64, 0xf4, 0x7d, 0x84, 0x59, 0xa3, 0xe4, 0x96, 0x9a, 0x76, 0x67, 0xb7, 0x25, 0x67, 0xc2, 0x70, - 0x1e, 0x98, 0x41, 0xe4, 0x31, 0xd4, 0x32, 0x11, 0x31, 0xa6, 0xb4, 0x6e, 0xaa, 0xac, 0x73, 0xc2, - 0xfb, 0x00, 0xe4, 0x1d, 0xcd, 0xfc, 0xf0, 0xf6, 0x6d, 0x32, 0xf4, 0xa3, 0xa4, 0x4f, 0xc7, 0x01, - 0x1d, 0x93, 0x7d, 0xa8, 0xe4, 0xe6, 0x74, 0xd7, 0x72, 0xb4, 0xd8, 0xd2, 0x8d, 0xa5, 0x96, 0x7a, - 0x37, 0xf0, 0xff, 0x52, 0x3e, 0xe4, 0xd2, 0xf8, 0xb1, 0x10, 0x47, 0xe9, 0x90, 0xaa, 0x8c, 0xe5, - 0x60, 0x0a, 0x65, 0xa9, 0x63, 0x21, 0x7c, 0x64, 0x79, 0xb6, 0x1c, 0x49, 0xde, 0x0f, 0x6f, 0x65, - 0xa7, 0x64, 0x7f, 0x77, 0x82, 0x1c, 0x29, 0x5e, 0xe5, 0x55, 0x5e, 0x24, 0xaf, 0x90, 0xf7, 0x0d, - 0xa0, 0x4f, 0x93, 0xa1, 0x8f, 0x4c, 0x1a, 0xf8, 0xb7, 0x43, 0xfe, 0xcb, 0x02, 0x7b, 0x56, 0x5c, - 0xbb, 0xa5, 0x45, 0xb7, 0x74, 0xee, 0x96, 0x16, 0xdc, 0x6a, 0x24, 0x95, 0xe9, 0x3a, 0x3e, 0xb2, - 0xd9, 0x35, 0x99, 0x94, 0x8c, 0xb8, 0x1c, 0x45, 0x34, 0xc9, 0x74, 0x44, 0x59, 0x47, 0x18, 0x14, - 0x71, 0x60, 0x0b, 0x69, 0x32, 0xbc, 0x88, 0x62, 0xda, 0xa8, 0xb8, 0x56, 0xb3, 0x14, 0xcc, 0xb0, - 0x77, 0x09, 0xf6, 0xd1, 0x88, 0x86, 0x22, 0x6f, 0xcf, 0x3e, 0x54, 0x26, 0x85, 0xfb, 0xd5, 0x48, - 0xa6, 0x48, 0x79, 0x7e, 0xf3, 0x5a, 0xe0, 0x0c, 0x2f, 0x36, 0xaf, 0xb4, 0xbc, 0x84, 0x6f, 0x60, - 0x7b, 0x5e, 0xe4, 0x21, 0x6d, 0xf0, 0x7e, 0x5a, 0x50, 0xef, 0x53, 0xe9, 0xa7, 0x30, 0x8b, 0x2b, - 0xb5, 0x36, 0xa0, 0xca, 0x44, 0x3a, 0xe1, 0x33, 0xa9, 0x53, 0x28, 0x4f, 0xc4, 0x7a, 0x44, 0xf2, - 0xd1, 0xd1, 0x68, 0xd1, 0xc1, 0xe6, 0xf2, 0xf5, 0x9b, 0xfe, 0xcb, 0x45, 0xff, 0x5e, 0x0f, 0x76, - 0x8b, 0xd2, 0x1e, 0xe2, 0xb0, 0xf3, 0xa7, 0x04, 0xf2, 0xdd, 0x26, 0x9f, 0xa1, 0xbe, 0xb0, 0x27, - 0xe4, 0xe9, 0x8a, 0x51, 0x5b, 0xde, 0x4d, 0xe7, 0xd9, 0x3a, 0x61, 0xc8, 0x49, 0x0a, 0x7b, 0x67, - 0x93, 0xd1, 0xc8, 0xd7, 0x4f, 0x41, 0xf7, 0xae, 0x4f, 0xc7, 0xea, 0x3d, 0x78, 0xbe, 0xe2, 0xfc, - 0xaa, 0x40, 0x59, 0xeb, 0xc5, 0xda, 0xb1, 0xc8, 0xc9, 0x4b, 0xa8, 0xe6, 0x4b, 0x40, 0xea, 0xea, - 0x49, 0x9a, 0xef, 0xa3, 0xb3, 0x5b, 0x24, 0x90, 0x93, 0x73, 0x80, 0x1e, 0x1d, 0xf9, 0xc8, 0x94, - 0x28, 0x77, 0x45, 0xa1, 0xf9, 0x67, 0x99, 0xe1, 0xe0, 0x9e, 0x08, 0xe4, 0xa4, 0x0d, 0x5b, 0xd3, - 0xf9, 0x23, 0xba, 0xa0, 0x31, 0xf3, 0xce, 0x7f, 0x0b, 0x0c, 0x72, 0x72, 0x08, 0xdb, 0xe6, 0x95, - 0x92, 0xbd, 0x5c, 0x65, 0x61, 0x00, 0x9d, 0x47, 0x2b, 0x58, 0xe4, 0x5d, 0xfb, 0x53, 0xad, 0x25, - 0xff, 0xc6, 0x87, 0x31, 0xb2, 0x2f, 0x15, 0xf5, 0xab, 0x7d, 0xf5, 0x37, 0x00, 0x00, 0xff, 0xff, - 0x3e, 0x48, 0x33, 0x18, 0xa3, 0x07, 0x00, 0x00, +var fileDescriptor_msg_b3ce531eb8197ddf = []byte{ + // 793 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xfb, 0x44, + 0x10, 0x96, 0x9b, 0x7f, 0xbf, 0x8c, 0x5b, 0x25, 0x2c, 0xa1, 0x18, 0xab, 0x48, 0xa9, 0x05, 0x28, + 0x02, 0x94, 0x48, 0x01, 0x89, 0x43, 0x2f, 0x90, 0xa6, 0xad, 0x2a, 0xd5, 0xb4, 0xb5, 0xcb, 0x85, + 0x4b, 0x6a, 0x9a, 0xd5, 0xd6, 0xaa, 0xff, 0x6c, 0x3c, 0x0e, 0x6d, 0xe1, 0x19, 0x78, 0x00, 0x4e, + 0xdc, 0x78, 0x33, 0xde, 0x03, 0xed, 0xae, 0x93, 0xd8, 0x89, 0xa1, 0x51, 0x0e, 0xbf, 0xe3, 0xf7, + 0x79, 0x76, 0xe6, 0xfb, 0x66, 0x67, 0x27, 0x81, 0x83, 0x10, 0xd9, 0x20, 0x44, 0xd6, 0xe7, 0x49, + 0x9c, 0xc6, 0xa4, 0x12, 0x22, 0x33, 0x8f, 0xaf, 0x39, 0x8d, 0x26, 0x97, 0xf6, 0x80, 0x3f, 0xb1, + 0x81, 0xe4, 0x07, 0x38, 0x7d, 0x9a, 0x3c, 0xe3, 0xe0, 0x19, 0x55, 0x9c, 0xf5, 0x3b, 0xe8, 0x36, + 0xb2, 0xb1, 0x97, 0x7a, 0x77, 0xb1, 0x7d, 0x4b, 0x3a, 0x50, 0x4b, 0xe3, 0x27, 0x1a, 0x19, 0x5a, + 0x57, 0xeb, 0x35, 0x1d, 0x05, 0x48, 0x17, 0xf4, 0x98, 0xd3, 0xc4, 0x4b, 0xfd, 0x38, 0xba, 0x1c, + 0x1b, 0x7b, 0xf2, 0x5b, 0x9e, 0x22, 0xdf, 0x42, 0x23, 0x54, 0x69, 0x8c, 0x4a, 0x57, 0xeb, 0xe9, + 0x43, 0xb3, 0x8f, 0x34, 0xf9, 0x95, 0x26, 0x13, 0x8f, 0xfb, 0x13, 0xee, 0x25, 0x5e, 0x88, 0xfd, + 0xac, 0x90, 0xb3, 0x08, 0xb5, 0x68, 0xae, 0xf8, 0x78, 0x94, 0x4f, 0xa2, 0x6d, 0x9d, 0xe4, 0x6d, + 0x71, 0xd6, 0x1f, 0x1a, 0xb4, 0x6e, 0xe6, 0xf8, 0x98, 0x37, 0xda, 0x05, 0xfd, 0x3a, 0x77, 0x4a, + 0xd9, 0xcd, 0x53, 0x79, 0x35, 0x7b, 0xdb, 0xab, 0xb1, 0x60, 0x9f, 0xcf, 0xf1, 0xf1, 0x2e, 0xfe, + 0x09, 0x69, 0x72, 0x39, 0x96, 0xdd, 0x68, 0x3a, 0x05, 0xce, 0xfa, 0x5b, 0x03, 0xb2, 0xd2, 0x12, + 0x47, 0x2c, 0x1e, 0xbd, 0xda, 0xb7, 0xc4, 0x80, 0x46, 0xe0, 0x61, 0xea, 0xd2, 0x99, 0x94, 0x53, + 0x75, 0x16, 0x90, 0x7c, 0x06, 0x07, 0x1e, 0x63, 0x09, 0x65, 0x45, 0x93, 0x45, 0x92, 0x0c, 0x41, + 0x0f, 0x29, 0xa2, 0xc7, 0xe8, 0x95, 0x8f, 0xa9, 0x51, 0xe9, 0x56, 0x7a, 0xfa, 0xb0, 0xdd, 0x17, + 0x33, 0x91, 0x73, 0xee, 0xe4, 0x83, 0xc8, 0x11, 0x34, 0xd3, 0xc4, 0x67, 0x4c, 0x6a, 0xad, 0xca, + 0xac, 0x2b, 0xc2, 0xfa, 0x11, 0xc8, 0x05, 0x4d, 0x6d, 0xef, 0xe5, 0x87, 0x68, 0x6a, 0xfb, 0x91, + 0x4b, 0x67, 0x0e, 0x9d, 0x91, 0x43, 0xa8, 0x67, 0xe6, 0x54, 0xd7, 0x32, 0xb4, 0xde, 0xd2, 0xbd, + 0x8d, 0x96, 0x5a, 0xcf, 0xf0, 0xe1, 0x46, 0x3e, 0xe4, 0xc2, 0xf8, 0x59, 0x92, 0x9c, 0xc6, 0x53, + 0x2a, 0x33, 0xd6, 0x9c, 0x05, 0x14, 0xa5, 0xce, 0x92, 0xc4, 0x46, 0x96, 0x65, 0xcb, 0x90, 0xe0, + 0x6d, 0xef, 0x45, 0x74, 0x4a, 0xf4, 0xf7, 0xc0, 0xc9, 0x90, 0xe4, 0x65, 0x5e, 0xe9, 0x45, 0xf0, + 0x12, 0x59, 0xbf, 0x01, 0xb8, 0x34, 0x9a, 0xda, 0xc8, 0x84, 0x81, 0xf7, 0x3b, 0xe4, 0x7f, 0x69, + 0xa0, 0x2f, 0x8b, 0x2b, 0xb7, 0xb4, 0xe8, 0x96, 0xae, 0xdc, 0xd2, 0x82, 0x5b, 0x85, 0x84, 0x32, + 0x55, 0xc7, 0x46, 0xb6, 0xbc, 0xa6, 0x3c, 0x25, 0x22, 0x1e, 0x02, 0x9f, 0x46, 0xa9, 0x8a, 0xa8, + 0xa9, 0x88, 0x1c, 0x45, 0x4c, 0x78, 0x87, 0x34, 0x9a, 0xde, 0xf9, 0x21, 0x35, 0xea, 0x5d, 0xad, + 0x57, 0x71, 0x96, 0xd8, 0x7a, 0x00, 0xfd, 0x34, 0xa0, 0x5e, 0x92, 0xb5, 0xe7, 0x10, 0xea, 0xf3, + 0xc2, 0xfd, 0x2a, 0x24, 0x52, 0xc4, 0x3c, 0xbb, 0x79, 0x25, 0x70, 0x89, 0xd7, 0x9b, 0x57, 0xd9, + 0x7c, 0x84, 0xdf, 0xc3, 0xfe, 0xaa, 0xc8, 0x2e, 0x6d, 0xb0, 0xfe, 0xd4, 0xa0, 0xe5, 0x52, 0xe1, + 0xa7, 0x30, 0x8b, 0xa5, 0x5a, 0x0d, 0x68, 0xb0, 0x24, 0x9e, 0xf3, 0xa5, 0xd4, 0x05, 0x14, 0x27, + 0x42, 0x35, 0x22, 0xd9, 0xe8, 0x28, 0xb4, 0xee, 0xa0, 0xba, 0x79, 0xfd, 0x79, 0xff, 0xb5, 0xa2, + 0x7f, 0x6b, 0x0c, 0xed, 0xa2, 0xb4, 0x9d, 0x1c, 0x9e, 0xc0, 0xc7, 0x2e, 0x4d, 0xb3, 0x61, 0x39, + 0xf7, 0xfc, 0x80, 0x4e, 0xcf, 0x03, 0x4f, 0x5e, 0xca, 0x9a, 0x3c, 0x6d, 0xb3, 0xc1, 0x57, 0x60, + 0x94, 0x1f, 0xde, 0x49, 0xca, 0x77, 0xf2, 0xa9, 0x66, 0xd9, 0xdc, 0xd4, 0x4b, 0xe7, 0xb8, 0x9d, + 0x8c, 0x7b, 0xe8, 0x6c, 0x1e, 0xdc, 0x69, 0xec, 0x0f, 0xa1, 0x8e, 0xf2, 0xbc, 0xbc, 0xa9, 0x9a, + 0x93, 0xa1, 0xe1, 0x3f, 0x55, 0x10, 0xbf, 0x6e, 0xe4, 0x1e, 0x5a, 0x6b, 0xdb, 0x84, 0x7c, 0x5e, + 0xf2, 0x20, 0x37, 0x37, 0x98, 0xf9, 0xc5, 0x36, 0x61, 0xc8, 0x49, 0x0c, 0x9d, 0x9b, 0x79, 0x10, + 0xd8, 0x6a, 0x61, 0x8e, 0x5e, 0x5d, 0x3a, 0x93, 0x5b, 0xf3, 0xcb, 0x92, 0xf3, 0x65, 0x81, 0xa2, + 0xd6, 0x57, 0x5b, 0xc7, 0x22, 0x27, 0x5f, 0x43, 0x23, 0xeb, 0x1c, 0x69, 0xc9, 0xc5, 0xbd, 0xda, + 0x5a, 0x66, 0xbb, 0x48, 0x20, 0x27, 0xb7, 0x00, 0x63, 0x1a, 0xd8, 0xc8, 0xa4, 0xa8, 0x6e, 0x49, + 0xa1, 0xd5, 0x67, 0x91, 0xe1, 0xf8, 0x8d, 0x08, 0xe4, 0x64, 0x00, 0xef, 0x16, 0xaf, 0x94, 0xa8, + 0x82, 0xb9, 0xcd, 0x60, 0x7e, 0xb0, 0xc6, 0x20, 0x27, 0x27, 0xb0, 0x9f, 0x1f, 0x7c, 0xd2, 0xc9, + 0x54, 0x16, 0x9e, 0xa9, 0xf9, 0x51, 0x09, 0x8b, 0x9c, 0xb8, 0xd0, 0x29, 0x1b, 0x59, 0x72, 0xb4, + 0x08, 0x2f, 0x7b, 0x0a, 0xe6, 0xa7, 0xff, 0xf3, 0x15, 0x39, 0xb9, 0x80, 0xf6, 0xfa, 0x00, 0x12, + 0x43, 0x1e, 0x29, 0x19, 0x68, 0xf3, 0x93, 0xff, 0xf8, 0x82, 0x7c, 0xa4, 0xff, 0xdc, 0xec, 0x8b, + 0x7f, 0x54, 0x27, 0x21, 0xb2, 0x5f, 0xea, 0xf2, 0xef, 0xd2, 0x37, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0x01, 0x7d, 0x7b, 0xe8, 0x67, 0x09, 0x00, 0x00, } diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index 657e1cf28..1557f38b5 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -3,8 +3,6 @@ import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./msg;msg"; package msg; - - message MsgDataToMQ{ string token =1; string operationID = 2; @@ -104,6 +102,25 @@ message SetMsgMinSeqResp{ string errMsg = 2; } +message SetSendMsgFailedFlagReq{ + string operationID = 1; +} + +message SetSendMsgFailedFlagResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message GetSendMsgStatusReq{ + string operationID = 1; +} + +message GetSendMsgStatusResp{ + int32 errCode = 1; + string errMsg = 2; + int32 status = 3; +} + service msg { rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); @@ -111,4 +128,6 @@ service msg { rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp); rpc ClearMsg(ClearMsgReq) returns(ClearMsgResp); rpc SetMsgMinSeq(SetMsgMinSeqReq) returns(SetMsgMinSeqResp); + rpc SetSendMsgFailedFlag(SetSendMsgFailedFlagReq) returns(SetSendMsgFailedFlagResp); + rpc GetSendMsgStatus(GetSendMsgStatusReq) returns(GetSendMsgStatusResp); } diff --git a/test/mysql/cmd/main.go b/test/mysql/cmd/main.go deleted file mode 100644 index 8bf97b919..000000000 --- a/test/mysql/cmd/main.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import ( - "Open_IM/test/mysql" -) - -func main() { - mysql.ImportUserToSuperGroup() -} diff --git a/test/mysql/importuser.go b/test/mysql/importuser.go deleted file mode 100644 index 09e535914..000000000 --- a/test/mysql/importuser.go +++ /dev/null @@ -1,56 +0,0 @@ -package mysql - -import ( - "Open_IM/pkg/common/db" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "strconv" - "time" -) - -func ImportUserToSuperGroup() { - for i := 18000000700; i <= 18000000800; i++ { - user := db.User{ - UserID: strconv.Itoa(i), - Nickname: strconv.Itoa(i), - FaceURL: "", - Gender: 0, - PhoneNumber: strconv.Itoa(i), - Birth: time.Time{}, - Email: "", - Ex: "", - CreateTime: time.Time{}, - AppMangerLevel: 0, - GlobalRecvMsgOpt: 0, - } - err := im_mysql_model.UserRegister(user) - if err != nil { - log.NewError("", err.Error(), user) - continue - } - - groupMember := db.GroupMember{ - GroupID: "3907826375", - UserID: strconv.Itoa(i), - Nickname: strconv.Itoa(i), - FaceURL: "", - RoleLevel: 0, - JoinTime: time.Time{}, - JoinSource: 0, - InviterUserID: "openIMAdmin", - OperatorUserID: "openIMAdmin", - MuteEndTime: time.Time{}, - Ex: "", - } - - err = im_mysql_model.InsertIntoGroupMember(groupMember) - if err != nil { - log.NewError("", err.Error(), user) - continue - } - - log.NewInfo("success", i) - - } - -} From 2d20c4ee4cfceebbb6a3cd55d63a293bebae0fa5 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Jul 2022 15:23:33 +0800 Subject: [PATCH 09/53] superGroupMaxSeq --- internal/rpc/msg/msg_status.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/msg_status.go b/internal/rpc/msg/msg_status.go index 9aff2b517..bdfa05952 100644 --- a/internal/rpc/msg/msg_status.go +++ b/internal/rpc/msg/msg_status.go @@ -10,7 +10,7 @@ import ( goRedis "github.com/go-redis/redis/v8" ) -func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req pbMsg.SetSendMsgFailedFlagReq) (resp pbMsg.SetSendMsgFailedFlagResp, err error) { +func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req *pbMsg.SetSendMsgFailedFlagReq) (resp *pbMsg.SetSendMsgFailedFlagResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) if err := db.DB.SetSendMsgFailedFlag(req.OperationID); err != nil { resp.ErrCode = constant.ErrDB.ErrCode @@ -21,7 +21,7 @@ func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req pbMsg.SetSendMsg return resp, nil } -func (rpc *rpcChat) GetSendMsgStatus(_ context.Context, req pbMsg.GetSendMsgStatusReq) (resp pbMsg.GetSendMsgStatusResp, err error) { +func (rpc *rpcChat) GetSendMsgStatus(_ context.Context, req *pbMsg.GetSendMsgStatusReq) (resp *pbMsg.GetSendMsgStatusResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) if err := db.DB.GetSendMsgStatus(req.OperationID); err != nil { if err == goRedis.Nil { From f84cc0554f51def765f0530098f03f936b2d7ade Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Jul 2022 15:26:39 +0800 Subject: [PATCH 10/53] superGroupMaxSeq --- internal/rpc/msg/msg_status.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/msg_status.go b/internal/rpc/msg/msg_status.go index bdfa05952..5d4335d8d 100644 --- a/internal/rpc/msg/msg_status.go +++ b/internal/rpc/msg/msg_status.go @@ -11,6 +11,7 @@ import ( ) func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req *pbMsg.SetSendMsgFailedFlagReq) (resp *pbMsg.SetSendMsgFailedFlagResp, err error) { + resp = &pbMsg.SetSendMsgFailedFlagResp{} log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) if err := db.DB.SetSendMsgFailedFlag(req.OperationID); err != nil { resp.ErrCode = constant.ErrDB.ErrCode @@ -23,15 +24,16 @@ func (rpc *rpcChat) SetSendMsgFailedFlag(_ context.Context, req *pbMsg.SetSendMs func (rpc *rpcChat) GetSendMsgStatus(_ context.Context, req *pbMsg.GetSendMsgStatusReq) (resp *pbMsg.GetSendMsgStatusResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp = &pbMsg.GetSendMsgStatusResp{} if err := db.DB.GetSendMsgStatus(req.OperationID); err != nil { if err == goRedis.Nil { resp.Status = 0 - return + return resp, nil } else { log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) resp.ErrMsg = err.Error() resp.ErrCode = constant.ErrDB.ErrCode - return + return resp, nil } } resp.Status = 1 From 192c764c8cdc511b39f6a88b8a6233f6c6d3b70e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Jul 2022 15:41:16 +0800 Subject: [PATCH 11/53] superGroupMaxSeq --- pkg/base_info/manage_api_struct.go | 2 +- pkg/common/db/RedisModel.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go index 52634839f..e7db30f77 100644 --- a/pkg/base_info/manage_api_struct.go +++ b/pkg/base_info/manage_api_struct.go @@ -79,7 +79,7 @@ type ManagementBatchSendMsgResp struct { } type CheckMsgIsSendSuccessReq struct { - OperationID string + OperationID string `json:"operationID"` } type CheckMsgIsSendSuccessResp struct { diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index 409d7de6d..217c4c5c5 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -33,8 +33,8 @@ const ( GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT" FcmToken = "FCM_TOKEN:" groupUserMinSeq = "GROUP_USER_MIN_SEQ:" - groupMaxSeq = "GROUP_MAX_SEQ" - sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG" + groupMaxSeq = "GROUP_MAX_SEQ:" + sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:" ) func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { From 5a262880b970751bdd7fe28e6b73e3e828632b43 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Jul 2022 15:45:07 +0800 Subject: [PATCH 12/53] superGroupMaxSeq --- internal/api/manage/management_chat.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 79896622b..c7837c5c9 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -367,6 +367,11 @@ func ManagementBatchSendMsg(c *gin.Context) { func CheckMsgIsSendSuccess(c *gin.Context) { var req api.CheckMsgIsSendSuccessReq var resp api.CheckMsgIsSendSuccessResp + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + log.Error(c.PostForm("operationID"), "json unmarshal err", err.Error(), c.PostForm("content")) + return + } etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) if etcdConn == nil { errMsg := req.OperationID + "getcdv3.GetConn == nil" From 80d74f6f386b50eff5039c3f8c44df1d49815d9b Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 26 Jul 2022 15:52:38 +0800 Subject: [PATCH 13/53] Push message to client through message queue --- cmd/Open-IM-SDK-Core | 2 +- .../logic/online_history_msg_handler.go | 40 ++++++++++--------- pkg/common/kafka/producer.go | 14 +++---- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index c5e258fa8..3b9c0d84d 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit c5e258fa82dd11c9ca1e553a56920bad3f1a4b73 +Subproject commit 3b9c0d84d43d45c2a73b56a3c3510f86b67ff9bb diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index 7d74d4c22..34f950320 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -107,32 +107,24 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { singleMsgSuccessCount += uint64(len(storageMsgList)) singleMsgSuccessCountMutex.Unlock() och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq) - go func(push, storage []*pbMsg.MsgDataToMQ) { - for _, v := range storage { - sendMessageToPush(v, msgChannelValue.aggregationID) - } - for _, x := range push { - sendMessageToPush(x, msgChannelValue.aggregationID) - } - - }(notStoragePushMsgList, storageMsgList) - + for _, v := range storageMsgList { + sendMessageToPushMQ(v, msgChannelValue.aggregationID) + } + for _, x := range notStoragePushMsgList { + sendMessageToPushMQ(x, msgChannelValue.aggregationID) + } } } else { - go func(push []*pbMsg.MsgDataToMQ) { - for _, x := range push { - sendMessageToPush(x, msgChannelValue.aggregationID) - } - }(notStoragePushMsgList) - + for _, x := range notStoragePushMsgList { + sendMessageToPushMQ(x, msgChannelValue.aggregationID) + } } } - } } - } + func (och *OnlineHistoryRedisConsumerHandler) SendMessageToMongoCH(aggregationID string, triggerID string, messages []*pbMsg.MsgDataToMQ, lastSeq uint64) { if len(messages) > 0 { pid, offset, err := producerToMongo.SendMessage(&pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, AggregationID: aggregationID, MessageList: messages, TriggerID: triggerID}, aggregationID, triggerID) @@ -522,6 +514,7 @@ func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerG // } // return nil //} + func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { log.Info(message.OperationID, "msg_transfer send message to push", "message", message.String()) rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} @@ -549,6 +542,17 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { } } +func sendMessageToPushMQ(message *pbMsg.MsgDataToMQ, pushToUserID string) { + log.Info(message.OperationID, utils.GetSelfFuncName(), "msg ", message.String(), pushToUserID) + rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} + mqPushMsg := pbMsg.PushMsgDataToMQ{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} + pid, offset, err := producer.SendMessage(&mqPushMsg, mqPushMsg.PushToUserID, rpcPushMsg.OperationID) + if err != nil { + log.Error(mqPushMsg.OperationID, "kafka send failed", "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) + } + return +} + // String hashes a string to a unique hashcode. // // crc32 returns a uint32, but for our use we need diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index 1ebaaab10..4eb10aebd 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -1,7 +1,7 @@ package kafka import ( - log2 "Open_IM/pkg/common/log" + log "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "errors" "github.com/Shopify/sarama" @@ -36,26 +36,26 @@ func NewKafkaProducer(addr []string, topic string) *Producer { } func (p *Producer) SendMessage(m proto.Message, key string, operationID string) (int32, int64, error) { - log2.Info(operationID, "SendMessage", "key ", key, m.String(), p.producer) + log.Info(operationID, "SendMessage", "key ", key, m.String(), p.producer) kMsg := &sarama.ProducerMessage{} kMsg.Topic = p.topic kMsg.Key = sarama.StringEncoder(key) bMsg, err := proto.Marshal(m) if err != nil { - log2.Error(operationID, "", "proto marshal err = %s", err.Error()) + log.Error(operationID, "", "proto marshal err = %s", err.Error()) return -1, -1, err } if len(bMsg) == 0 { - log2.Error(operationID, "len(bMsg) == 0 ") + log.Error(operationID, "len(bMsg) == 0 ") return 0, 0, errors.New("len(bMsg) == 0 ") } kMsg.Value = sarama.ByteEncoder(bMsg) - log2.Info(operationID, "ByteEncoder SendMessage begin", "key ", kMsg, p.producer, "len: ", kMsg.Key.Length(), kMsg.Value.Length()) + log.Info(operationID, "ByteEncoder SendMessage begin", "key ", kMsg, p.producer, "len: ", kMsg.Key.Length(), kMsg.Value.Length()) if kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 { - log2.Error(operationID, "kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 ", kMsg) + log.Error(operationID, "kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 ", kMsg) return -1, -1, errors.New("key or value == 0") } a, b, c := p.producer.SendMessage(kMsg) - log2.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg.Key.Length(), kMsg.Value.Length(), p.producer) + log.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg.Key.Length(), kMsg.Value.Length(), p.producer) return a, b, utils.Wrap(c, "") } From 641ac7c503461522356ba187bc22c0a2ff7bacd2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 16:32:18 +0800 Subject: [PATCH 14/53] sdk update --- cmd/Open-IM-SDK-Core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index c5e258fa8..1667b0f4e 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit c5e258fa82dd11c9ca1e553a56920bad3f1a4b73 +Subproject commit 1667b0f4e205fc4ed7c690ab55b662087d61c277 From 0ddf5eadb6ed3b73aa9c42c658dd750231457138 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 26 Jul 2022 16:50:54 +0800 Subject: [PATCH 15/53] Push message to client through message queue --- pkg/common/db/batch_insert_chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/batch_insert_chat.go b/pkg/common/db/batch_insert_chat.go index bef5a312c..f2920813d 100644 --- a/pkg/common/db/batch_insert_chat.go +++ b/pkg/common/db/batch_insert_chat.go @@ -101,7 +101,7 @@ func (d *DataBases) BatchInsertChat2DB(userID string, msgList []*pbMsg.MsgDataTo return utils.Wrap(err, "") } } - log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList)) + log.Debug(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList)) return nil } From 14d5b3b316b9b751a87cd221798b6a6b56625ae6 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 18:47:06 +0800 Subject: [PATCH 16/53] remove validation for notificationFaceURL --- internal/api/manage/management_chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index c7837c5c9..7a1876c83 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -460,7 +460,7 @@ type RevokeElem struct { } type OANotificationElem struct { NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"` - NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL" validate:"required"` + NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL"` NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"` Text string `mapstructure:"text" json:"text" validate:"required"` Url string `mapstructure:"url" json:"url"` From 5a626e9dabd0ddcd609aaa1f67ee32e9a6c46b3e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 21:02:11 +0800 Subject: [PATCH 17/53] add update conversation unread count --- config/config.yaml | 2 +- internal/rpc/conversation/conversaion.go | 3 +++ pkg/common/constant/constant.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index f1fa4fb78..b638b8c5f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -636,7 +636,7 @@ notification: #####################conversation######################### conversationOptUpdate: conversation: - reliabilityLevel: 2 + reliabilityLevel: 1 unreadCount: false offlinePush: switch: true diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 9ea7efcc0..77fc58e63 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -70,6 +70,9 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"ex": conversation.Ex}) case constant.FieldAttachedInfo: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo}) + case constant.FieldUnread: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"unread_count": conversation.UnreadCount}) + } if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error()) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 8c6c45ec0..3edcd0f21 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -252,6 +252,7 @@ const ( FieldGroupAtType = 5 FieldIsNotInGroup = 6 FieldEx = 7 + FieldUnread = 8 ) const ( From 9730ada80519adca7d9fdfe0d90b7343f80f445a Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 27 Jul 2022 11:49:00 +0800 Subject: [PATCH 18/53] debug --- internal/api/user/user.go | 1 + .../msg_gateway/gate/open_im_media/room.go | 38 +------------------ 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 51919fa42..6379a55a8 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -417,6 +417,7 @@ func GetUsersOnlineStatus(c *gin.Context) { flag := false grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) for _, v := range grpcCons { + log.Debug(params.OperationID, "get node ", v) client := pbRelay.NewRelayClient(v) reply, err := client.GetUsersOnlineStatus(context.Background(), req) if err != nil { diff --git a/internal/msg_gateway/gate/open_im_media/room.go b/internal/msg_gateway/gate/open_im_media/room.go index 83796da29..b840de39a 100644 --- a/internal/msg_gateway/gate/open_im_media/room.go +++ b/internal/msg_gateway/gate/open_im_media/room.go @@ -5,8 +5,6 @@ const ( Address = "127.0.0.1:11300" ) -//var roomClient *lksdk.RoomServiceClient - type Media struct { } @@ -14,45 +12,11 @@ func NewMedia() *Media { return &Media{} } -//func (m *Media) GetJoinToken(room, identity string, operationID string, data *open_im_sdk.ParticipantMetaData) (string, string, error) { -// var newData pbRtc.ParticipantMetaData -// copier.Copy(&newData, data) -// conn, err := grpc.Dial(Address, grpc.WithInsecure()) -// if err != nil { -// return "", "", err -// } -// defer conn.Close() -// c := pbRtc.NewRtcServiceClient(conn) -// req := &pbRtc.GetJoinTokenReq{Room: room, OperationID: operationID, Identity: identity, MetaData: &newData} -// resp, err := c.GetJoinToken(context.Background(), req) -// if err != nil { -// return "", "", err -// } -// if resp.CommonResp.ErrCode != 0 { -// return "", "", errors.New(resp.CommonResp.ErrMsg) -// } -// return resp.Jwt, resp.LiveURL, nil -// //at := auth.NewAccessToken(m.ApiKey, m.ApiSecret) -// //grant := &auth.VideoGrant{ -// // RoomJoin: true, -// // Room: room, -// //} -// //at.AddGrant(grant). -// // SetIdentity(identity). -// // SetValidFor(time.Hour) -// // -// //return at.ToJWT() -//} - func init() { - //roomClient = lksdk.NewRoomServiceClient(MediaAddress, ApiKey, ApiSecret) + } func (m *Media) CreateRoom(roomName string) (error, error) { return nil, nil - //return roomClient.CreateRoom(context.Background(), &livekit.CreateRoomRequest{ - // Name: roomName, - // EmptyTimeout: 60 * 3, - //}) } From 17494b45bd82f2ce34deb48b97cfbf3af2fed854 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 27 Jul 2022 12:01:42 +0800 Subject: [PATCH 19/53] debug --- internal/api/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 6379a55a8..167063c54 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -417,7 +417,7 @@ func GetUsersOnlineStatus(c *gin.Context) { flag := false grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) for _, v := range grpcCons { - log.Debug(params.OperationID, "get node ", v) + log.Debug(params.OperationID, "get node ", *v) client := pbRelay.NewRelayClient(v) reply, err := client.GetUsersOnlineStatus(context.Background(), req) if err != nil { From 4c53023ebc98aea5a435383d92e17d2dacb9e114 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 27 Jul 2022 12:04:15 +0800 Subject: [PATCH 20/53] debug --- internal/api/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 167063c54..48171ece0 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -417,7 +417,7 @@ func GetUsersOnlineStatus(c *gin.Context) { flag := false grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) for _, v := range grpcCons { - log.Debug(params.OperationID, "get node ", *v) + log.Debug(params.OperationID, "get node ", *v, v.Target()) client := pbRelay.NewRelayClient(v) reply, err := client.GetUsersOnlineStatus(context.Background(), req) if err != nil { From bbc62ef907ba6cb88078f741eafa0cf23e7313c5 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 27 Jul 2022 12:15:32 +0800 Subject: [PATCH 21/53] remove cache message from redis --- .../logic/online_msg_to_mongo_handler.go | 7 ++++++- pkg/common/db/RedisModel.go | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go index 42efdc428..58575f849 100644 --- a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go +++ b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go @@ -36,7 +36,12 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(cMsg *sarama.Con } err = db.DB.BatchInsertChat2DB(msgFromMQ.AggregationID, msgFromMQ.MessageList, msgFromMQ.TriggerID, msgFromMQ.LastSeq) if err != nil { - log.NewError(msgFromMQ.TriggerID, "single data insert to mongo err", err.Error(), msgFromMQ.MessageList) + log.NewError(msgFromMQ.TriggerID, "single data insert to mongo err", err.Error(), msgFromMQ.MessageList, msgFromMQ.AggregationID, msgFromMQ.TriggerID) + } else { + err = db.DB.DeleteMessageFromCache(msgFromMQ.MessageList, msgFromMQ.AggregationID, msgFromMQ.GetTriggerID()) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "remove cache msg from redis err", err.Error(), msgFromMQ.MessageList, msgFromMQ.AggregationID, msgFromMQ.TriggerID) + } } for _, v := range msgFromMQ.MessageList { if v.MsgData.ContentType == constant.DeleteMessageNotification { diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index 217c4c5c5..163202270 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -221,6 +221,19 @@ func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, _, err := pipe.Exec(ctx) return err } +func (d *DataBases) DeleteMessageFromCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { + ctx := context.Background() + var keys []string + for _, msg := range msgList { + key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq)) + keys = append(keys, key) + } + err := d.RDB.Del(ctx, keys...).Err() + if err != nil { + log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", keys, uid, err.Error(), msgList) + } + return err +} func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID string) error { ctx := context.Background() From 36885b4f9ee8c35cc78ed71b5c692e8daa52ecae Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 28 Jul 2022 15:32:03 +0800 Subject: [PATCH 22/53] test --- internal/push/fcm/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index a9c7e5b39..767ca7ec6 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -23,7 +23,7 @@ var ( ) func init() { - //FcmClient = newFcmClient() + FcmClient = newFcmClient() } func newFcmClient() *Fcm { From 787cef54f53a3deef100b069b95f0295f980cf99 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 28 Jul 2022 18:14:58 +0800 Subject: [PATCH 23/53] manger send msg modify --- internal/api/manage/management_chat.go | 30 ++++++++++---------- internal/push/fcm/push.go | 26 ++++++++---------- internal/rpc/group/group.go | 2 +- pkg/base_info/manage_api_struct.go | 9 +++++- pkg/common/constant/constant.go | 38 +++++++++++++------------- 5 files changed, 55 insertions(+), 50 deletions(-) diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 7a1876c83..98d4ac98b 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -29,10 +29,10 @@ import ( var validate *validator.Validate func SetOptions(options map[string]bool, value bool) { - utils.SetSwitchFromOptions(options, constant.IsOfflinePush, value) utils.SetSwitchFromOptions(options, constant.IsHistory, value) utils.SetSwitchFromOptions(options, constant.IsPersistent, value) utils.SetSwitchFromOptions(options, constant.IsSenderSync, value) + utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, value) } func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { @@ -59,10 +59,12 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { if params.IsOnlineOnly { SetOptions(options, false) } - if params.ContentType == constant.CustomMsgOnlineOnly { - SetOptions(options, false) - } else if params.ContentType == constant.CustomMsgNotTriggerConversation { + if params.NotOfflinePush { + utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) + } + if params.ContentType == constant.CustomOnlineOnly { SetOptions(options, false) + } else if params.ContentType == constant.CustomNotTriggerConversation { utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false) } @@ -146,9 +148,9 @@ func ManagementSendMsg(c *gin.Context) { case constant.OANotification: data = OANotificationElem{} params.SessionType = constant.NotificationChatType - case constant.CustomMsgNotTriggerConversation: + case constant.CustomNotTriggerConversation: data = CustomElem{} - case constant.CustomMsgOnlineOnly: + case constant.CustomOnlineOnly: data = CustomElem{} //case constant.HasReadReceipt: //case constant.Typing: @@ -277,9 +279,9 @@ func ManagementBatchSendMsg(c *gin.Context) { case constant.OANotification: data = OANotificationElem{} params.SessionType = constant.NotificationChatType - case constant.CustomMsgNotTriggerConversation: + case constant.CustomNotTriggerConversation: data = CustomElem{} - case constant.CustomMsgOnlineOnly: + case constant.CustomOnlineOnly: data = CustomElem{} //case constant.HasReadReceipt: //case constant.Typing: @@ -322,12 +324,11 @@ func ManagementBatchSendMsg(c *gin.Context) { return } client := pbChat.NewMsgClient(etcdConn) + req := &api.ManagementSendMsgReq{ + ManagementSendMsg: params.ManagementSendMsg, + } + pbData := newUserSendMsgReq(req) for _, recvID := range params.RecvIDList { - req := &api.ManagementSendMsgReq{ - ManagementSendMsg: params.ManagementSendMsg, - RecvID: recvID, - } - pbData := newUserSendMsgReq(req) pbData.MsgData.RecvID = recvID log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String()) @@ -344,10 +345,11 @@ func ManagementBatchSendMsg(c *gin.Context) { msgSendFailedFlag = true continue } - resp.Data.ResultList = append(resp.Data.ResultList, server_api_params.UserSendMsgResp{ + resp.Data.ResultList = append(resp.Data.ResultList, &api.SingleReturnResult{ ServerMsgID: rpcResp.ServerMsgID, ClientMsgID: rpcResp.ClientMsgID, SendTime: rpcResp.SendTime, + RecvID: recvID, }) } if msgSendFailedFlag { diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 767ca7ec6..7878f11f3 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -4,23 +4,20 @@ import ( "Open_IM/internal/push" "Open_IM/pkg/common/config" "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" "context" - "log" - "path/filepath" - "strconv" - firebase "firebase.google.com/go" "firebase.google.com/go/messaging" "google.golang.org/api/option" + "path/filepath" + "strconv" ) type Fcm struct { + FcmMsgCli *messaging.Client } -var ( - FcmClient *Fcm - FcmMsgCli *messaging.Client -) +var FcmClient *Fcm func init() { FcmClient = newFcmClient() @@ -30,7 +27,7 @@ func newFcmClient() *Fcm { opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount)) fcmApp, err := firebase.NewApp(context.Background(), nil, opt) if err != nil { - log.Println("error initializing app: %v\n", err) + log.Debug("", "error initializing app: ", err.Error()) return nil } //授权 @@ -41,13 +38,12 @@ func newFcmClient() *Fcm { // } // log.Printf("%#v\r\n", fcmClient) ctx := context.Background() - FcmMsgCli, err = fcmApp.Messaging(ctx) + fcmMsgClient, err := fcmApp.Messaging(ctx) if err != nil { - log.Fatalf("error getting Messaging client: %v\n", err) + panic(err.Error()) return nil } - log.Println(FcmMsgCli) - return &Fcm{} + return &Fcm{FcmMsgCli: fcmMsgClient} } func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) { @@ -87,9 +83,9 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, //An error from SendMulticast indicates a total failure -- i.e. //the message could not be sent to any of the recipients. //Partial failures are indicated by a `BatchResponse` return value. - response, err := FcmMsgCli.SendMulticast(ctx, Msg) + response, err := f.FcmMsgCli.SendMulticast(ctx, Msg) if err != nil { - log.Fatalln(err) + return "", err } Success = Success + response.SuccessCount Fail = Fail + response.FailureCount diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 0101ef077..cfe7f4825 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -274,7 +274,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.GroupID, err) - return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil } if groupInfo.Status == constant.GroupStatusDismissed { errMsg := " group status is dismissed " diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go index e7db30f77..7d9f43653 100644 --- a/pkg/base_info/manage_api_struct.go +++ b/pkg/base_info/manage_api_struct.go @@ -52,6 +52,7 @@ type ManagementSendMsg struct { ContentType int32 `json:"contentType" binding:"required"` SessionType int32 `json:"sessionType" binding:"required"` IsOnlineOnly bool `json:"isOnlineOnly"` + NotOfflinePush bool `json:"notOfflinePush"` OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"` } @@ -73,10 +74,16 @@ type ManagementBatchSendMsgReq struct { type ManagementBatchSendMsgResp struct { CommResp Data struct { - ResultList []server_api_params.UserSendMsgResp `json:"resultList"` + ResultList []*SingleReturnResult `json:"resultList"` FailedIDList []string } `json:"data"` } +type SingleReturnResult struct { + ServerMsgID string `json:"serverMsgID"` + ClientMsgID string `json:"clientMsgID"` + SendTime int64 `json:"sendTime"` + RecvID string `json:"recvID" ` +} type CheckMsgIsSendSuccessReq struct { OperationID string `json:"operationID"` diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 3edcd0f21..58b53d7b7 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -28,25 +28,25 @@ const ( ///ContentType //UserRelated - Text = 101 - Picture = 102 - Voice = 103 - Video = 104 - File = 105 - AtText = 106 - Merger = 107 - Card = 108 - Location = 109 - Custom = 110 - Revoke = 111 - HasReadReceipt = 112 - Typing = 113 - Quote = 114 - GroupHasReadReceipt = 116 - AdvancedText = 117 - AdvancedRevoke = 118 //影响前者消息 - CustomMsgNotTriggerConversation = 119 - CustomMsgOnlineOnly = 120 + Text = 101 + Picture = 102 + Voice = 103 + Video = 104 + File = 105 + AtText = 106 + Merger = 107 + Card = 108 + Location = 109 + Custom = 110 + Revoke = 111 + HasReadReceipt = 112 + Typing = 113 + Quote = 114 + GroupHasReadReceipt = 116 + AdvancedText = 117 + AdvancedRevoke = 118 //影响前者消息 + CustomNotTriggerConversation = 119 + CustomOnlineOnly = 120 Common = 200 GroupMsg = 201 From 1eda0ebea7f1d47febd2634852e4278bfd80b722 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 28 Jul 2022 18:58:57 +0800 Subject: [PATCH 24/53] fcm push modify --- internal/push/fcm/push.go | 9 +++------ internal/push/logic/init.go | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 7878f11f3..3f0552d62 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -1,4 +1,4 @@ -package push +package fcm import ( "Open_IM/internal/push" @@ -17,12 +17,9 @@ type Fcm struct { FcmMsgCli *messaging.Client } -var FcmClient *Fcm - -func init() { - FcmClient = newFcmClient() +func NewFcm() *Fcm { + return newFcmClient() } - func newFcmClient() *Fcm { opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount)) fcmApp, err := firebase.NewApp(context.Background(), nil, opt) diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go index 0b540af6a..6d6229dca 100644 --- a/internal/push/logic/init.go +++ b/internal/push/logic/init.go @@ -44,7 +44,7 @@ func init() { } if config.Config.Push.Fcm.Enable { - offlinePusher = fcm.FcmClient + offlinePusher = fcm.NewFcm() } } From 51679b47a6a8fab3be2bfd290aa302fbc7029380 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 12:24:54 +0800 Subject: [PATCH 25/53] delete super group message --- internal/api/msg/del_msg.go | 45 +- internal/rpc/msg/del_msg.go | 27 + pkg/proto/msg/msg.pb.go | 1263 ----------------------------------- pkg/proto/msg/msg.proto | 12 +- 4 files changed, 69 insertions(+), 1278 deletions(-) delete mode 100644 pkg/proto/msg/msg.pb.go diff --git a/internal/api/msg/del_msg.go b/internal/api/msg/del_msg.go index b52990d73..2ae84505f 100644 --- a/internal/api/msg/del_msg.go +++ b/internal/api/msg/del_msg.go @@ -78,15 +78,18 @@ func DelSuperGroupMsg(c *gin.Context) { req api.DelSuperGroupMsgReq resp api.DelSuperGroupMsgResp ) + rpcReq := &rpc.DelSuperGroupMsgReq{} + utils.CopyStructFields(req, &req) if err := c.BindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - - ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + var ok bool + var errInfo string + ok, rpcReq.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) if !ok { - errMsg := req.OperationID + " " + opUserID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + errMsg := req.OperationID + " " + rpcReq.OpUserID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) return @@ -137,18 +140,32 @@ func DelSuperGroupMsg(c *gin.Context) { client := rpc.NewMsgClient(etcdConn) log.Info(req.OperationID, "", "api DelSuperGroupMsg call, api call rpc...") - - RpcResp, err := client.SendMsg(context.Background(), &pbData) - if err != nil { - log.NewError(req.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) - return + if req.IsAllDelete { + RpcResp, err := client.DelSuperGroupMsg(context.Background(),rpcReq) + if err != nil { + log.NewError(req.OperationID, "call delete DelSuperGroupMsg rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call DelSuperGroupMsg rpc server failed"}) + return + } + log.Info(req.OperationID, "", "api DelSuperGroupMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) + resp.ErrCode = RpcResp.ErrCode + resp.ErrMsg = RpcResp.ErrMsg + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) + }else{ + RpcResp, err := client.SendMsg(context.Background(), &pbData) + if err != nil { + log.NewError(req.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) + return + } + log.Info(req.OperationID, "", "api DelSuperGroupMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) + resp.ErrCode = RpcResp.ErrCode + resp.ErrMsg = RpcResp.ErrMsg + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) } - log.Info(req.OperationID, "", "api DelSuperGroupMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) - resp.ErrCode = RpcResp.ErrCode - resp.ErrMsg = RpcResp.ErrMsg - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) - c.JSON(http.StatusOK, resp) + } // @Summary 清空用户消息 diff --git a/internal/rpc/msg/del_msg.go b/internal/rpc/msg/del_msg.go index c6856bb98..06ec06e06 100644 --- a/internal/rpc/msg/del_msg.go +++ b/internal/rpc/msg/del_msg.go @@ -2,8 +2,11 @@ package msg import ( "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/proto/msg" "Open_IM/pkg/utils" "context" "time" @@ -27,3 +30,27 @@ func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) ( log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } +func (rpc *rpcChat) DelSuperGroupMsg(_ context.Context, req *msg.DelSuperGroupMsgReq) (*msg.DelSuperGroupMsgResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.UserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.UserID) + return &msg.DelSuperGroupMsgResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + resp := &msg.DelSuperGroupMsgResp{} + groupMaxSeq, err := db.DB.GetGroupMaxSeq(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMaxSeq false ", req.OpUserID, req.UserID,req.GroupID) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + return resp, nil + } + err = db.DB.SetGroupUserMinSeq(req.GroupID,req.UserID, groupMaxSeq) + if err != nil { + log.NewError(req.OperationID, "SetGroupUserMinSeq false ", req.OpUserID, req.UserID,req.GroupID) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} \ No newline at end of file diff --git a/pkg/proto/msg/msg.pb.go b/pkg/proto/msg/msg.pb.go deleted file mode 100644 index f2002012f..000000000 --- a/pkg/proto/msg/msg.pb.go +++ /dev/null @@ -1,1263 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: msg/msg.proto - -package msg // import "./msg" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import sdk_ws "Open_IM/pkg/proto/sdk_ws" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type MsgDataToMQ struct { - Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } -func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } -func (*MsgDataToMQ) ProtoMessage() {} -func (*MsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{0} -} -func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) -} -func (m *MsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgDataToMQ.Marshal(b, m, deterministic) -} -func (dst *MsgDataToMQ) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDataToMQ.Merge(dst, src) -} -func (m *MsgDataToMQ) XXX_Size() int { - return xxx_messageInfo_MsgDataToMQ.Size(m) -} -func (m *MsgDataToMQ) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDataToMQ.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDataToMQ proto.InternalMessageInfo - -func (m *MsgDataToMQ) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *MsgDataToMQ) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData { - if m != nil { - return m.MsgData - } - return nil -} - -type MsgDataToDB struct { - MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } -func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } -func (*MsgDataToDB) ProtoMessage() {} -func (*MsgDataToDB) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{1} -} -func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) -} -func (m *MsgDataToDB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgDataToDB.Marshal(b, m, deterministic) -} -func (dst *MsgDataToDB) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDataToDB.Merge(dst, src) -} -func (m *MsgDataToDB) XXX_Size() int { - return xxx_messageInfo_MsgDataToDB.Size(m) -} -func (m *MsgDataToDB) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDataToDB.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo - -func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData { - if m != nil { - return m.MsgData - } - return nil -} - -func (m *MsgDataToDB) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type PushMsgDataToMQ struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` - PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } -func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } -func (*PushMsgDataToMQ) ProtoMessage() {} -func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{2} -} -func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) -} -func (m *PushMsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PushMsgDataToMQ.Marshal(b, m, deterministic) -} -func (dst *PushMsgDataToMQ) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushMsgDataToMQ.Merge(dst, src) -} -func (m *PushMsgDataToMQ) XXX_Size() int { - return xxx_messageInfo_PushMsgDataToMQ.Size(m) -} -func (m *PushMsgDataToMQ) XXX_DiscardUnknown() { - xxx_messageInfo_PushMsgDataToMQ.DiscardUnknown(m) -} - -var xxx_messageInfo_PushMsgDataToMQ proto.InternalMessageInfo - -func (m *PushMsgDataToMQ) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData { - if m != nil { - return m.MsgData - } - return nil -} - -func (m *PushMsgDataToMQ) GetPushToUserID() string { - if m != nil { - return m.PushToUserID - } - return "" -} - -type MsgDataToMongoByMQ struct { - LastSeq uint64 `protobuf:"varint,1,opt,name=lastSeq" json:"lastSeq,omitempty"` - AggregationID string `protobuf:"bytes,2,opt,name=aggregationID" json:"aggregationID,omitempty"` - MessageList []*MsgDataToMQ `protobuf:"bytes,3,rep,name=messageList" json:"messageList,omitempty"` - TriggerID string `protobuf:"bytes,4,opt,name=triggerID" json:"triggerID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } -func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } -func (*MsgDataToMongoByMQ) ProtoMessage() {} -func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{3} -} -func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) -} -func (m *MsgDataToMongoByMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgDataToMongoByMQ.Marshal(b, m, deterministic) -} -func (dst *MsgDataToMongoByMQ) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDataToMongoByMQ.Merge(dst, src) -} -func (m *MsgDataToMongoByMQ) XXX_Size() int { - return xxx_messageInfo_MsgDataToMongoByMQ.Size(m) -} -func (m *MsgDataToMongoByMQ) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDataToMongoByMQ.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDataToMongoByMQ proto.InternalMessageInfo - -func (m *MsgDataToMongoByMQ) GetLastSeq() uint64 { - if m != nil { - return m.LastSeq - } - return 0 -} - -func (m *MsgDataToMongoByMQ) GetAggregationID() string { - if m != nil { - return m.AggregationID - } - return "" -} - -func (m *MsgDataToMongoByMQ) GetMessageList() []*MsgDataToMQ { - if m != nil { - return m.MessageList - } - return nil -} - -func (m *MsgDataToMongoByMQ) GetTriggerID() string { - if m != nil { - return m.TriggerID - } - return "" -} - -// message PullMessageReq { -// string UserID = 1; -// int64 SeqBegin = 2; -// int64 SeqEnd = 3; -// string OperationID = 4; -// } -// -// message PullMessageResp { -// int32 ErrCode = 1; -// string ErrMsg = 2; -// int64 MaxSeq = 3; -// int64 MinSeq = 4; -// repeated GatherFormat SingleUserMsg = 5; -// repeated GatherFormat GroupUserMsg = 6; -// } -// message PullMessageBySeqListReq{ -// string UserID = 1; -// string OperationID = 2; -// repeated int64 seqList =3; -// } -type GetMaxAndMinSeqReq struct { - UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } -func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } -func (*GetMaxAndMinSeqReq) ProtoMessage() {} -func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{4} -} -func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) -} -func (m *GetMaxAndMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMaxAndMinSeqReq.Marshal(b, m, deterministic) -} -func (dst *GetMaxAndMinSeqReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMaxAndMinSeqReq.Merge(dst, src) -} -func (m *GetMaxAndMinSeqReq) XXX_Size() int { - return xxx_messageInfo_GetMaxAndMinSeqReq.Size(m) -} -func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetMaxAndMinSeqReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo - -func (m *GetMaxAndMinSeqReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetMaxAndMinSeqReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetMaxAndMinSeqResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - MaxSeq uint32 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` - MinSeq uint32 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } -func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } -func (*GetMaxAndMinSeqResp) ProtoMessage() {} -func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{5} -} -func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) -} -func (m *GetMaxAndMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMaxAndMinSeqResp.Marshal(b, m, deterministic) -} -func (dst *GetMaxAndMinSeqResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMaxAndMinSeqResp.Merge(dst, src) -} -func (m *GetMaxAndMinSeqResp) XXX_Size() int { - return xxx_messageInfo_GetMaxAndMinSeqResp.Size(m) -} -func (m *GetMaxAndMinSeqResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetMaxAndMinSeqResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetMaxAndMinSeqResp proto.InternalMessageInfo - -func (m *GetMaxAndMinSeqResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *GetMaxAndMinSeqResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *GetMaxAndMinSeqResp) GetMaxSeq() uint32 { - if m != nil { - return m.MaxSeq - } - return 0 -} - -func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { - if m != nil { - return m.MinSeq - } - return 0 -} - -type SendMsgReq struct { - Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } -func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } -func (*SendMsgReq) ProtoMessage() {} -func (*SendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{6} -} -func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) -} -func (m *SendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SendMsgReq.Marshal(b, m, deterministic) -} -func (dst *SendMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendMsgReq.Merge(dst, src) -} -func (m *SendMsgReq) XXX_Size() int { - return xxx_messageInfo_SendMsgReq.Size(m) -} -func (m *SendMsgReq) XXX_DiscardUnknown() { - xxx_messageInfo_SendMsgReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SendMsgReq proto.InternalMessageInfo - -func (m *SendMsgReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *SendMsgReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData { - if m != nil { - return m.MsgData - } - return nil -} - -type SendMsgResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - ServerMsgID string `protobuf:"bytes,4,opt,name=serverMsgID" json:"serverMsgID,omitempty"` - ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"` - SendTime int64 `protobuf:"varint,6,opt,name=sendTime" json:"sendTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } -func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } -func (*SendMsgResp) ProtoMessage() {} -func (*SendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{7} -} -func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) -} -func (m *SendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SendMsgResp.Marshal(b, m, deterministic) -} -func (dst *SendMsgResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendMsgResp.Merge(dst, src) -} -func (m *SendMsgResp) XXX_Size() int { - return xxx_messageInfo_SendMsgResp.Size(m) -} -func (m *SendMsgResp) XXX_DiscardUnknown() { - xxx_messageInfo_SendMsgResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SendMsgResp proto.InternalMessageInfo - -func (m *SendMsgResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *SendMsgResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *SendMsgResp) GetServerMsgID() string { - if m != nil { - return m.ServerMsgID - } - return "" -} - -func (m *SendMsgResp) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -func (m *SendMsgResp) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -type ClearMsgReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} } -func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } -func (*ClearMsgReq) ProtoMessage() {} -func (*ClearMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{8} -} -func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) -} -func (m *ClearMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClearMsgReq.Marshal(b, m, deterministic) -} -func (dst *ClearMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClearMsgReq.Merge(dst, src) -} -func (m *ClearMsgReq) XXX_Size() int { - return xxx_messageInfo_ClearMsgReq.Size(m) -} -func (m *ClearMsgReq) XXX_DiscardUnknown() { - xxx_messageInfo_ClearMsgReq.DiscardUnknown(m) -} - -var xxx_messageInfo_ClearMsgReq proto.InternalMessageInfo - -func (m *ClearMsgReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *ClearMsgReq) GetOpUserID() string { - if m != nil { - return m.OpUserID - } - return "" -} - -func (m *ClearMsgReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type ClearMsgResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} } -func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } -func (*ClearMsgResp) ProtoMessage() {} -func (*ClearMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{9} -} -func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) -} -func (m *ClearMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClearMsgResp.Marshal(b, m, deterministic) -} -func (dst *ClearMsgResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClearMsgResp.Merge(dst, src) -} -func (m *ClearMsgResp) XXX_Size() int { - return xxx_messageInfo_ClearMsgResp.Size(m) -} -func (m *ClearMsgResp) XXX_DiscardUnknown() { - xxx_messageInfo_ClearMsgResp.DiscardUnknown(m) -} - -var xxx_messageInfo_ClearMsgResp proto.InternalMessageInfo - -func (m *ClearMsgResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *ClearMsgResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type SetMsgMinSeqReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"` - MinSeq uint32 `protobuf:"varint,3,opt,name=minSeq" json:"minSeq,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,5,opt,name=opUserID" json:"opUserID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetMsgMinSeqReq) Reset() { *m = SetMsgMinSeqReq{} } -func (m *SetMsgMinSeqReq) String() string { return proto.CompactTextString(m) } -func (*SetMsgMinSeqReq) ProtoMessage() {} -func (*SetMsgMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{10} -} -func (m *SetMsgMinSeqReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetMsgMinSeqReq.Unmarshal(m, b) -} -func (m *SetMsgMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetMsgMinSeqReq.Marshal(b, m, deterministic) -} -func (dst *SetMsgMinSeqReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetMsgMinSeqReq.Merge(dst, src) -} -func (m *SetMsgMinSeqReq) XXX_Size() int { - return xxx_messageInfo_SetMsgMinSeqReq.Size(m) -} -func (m *SetMsgMinSeqReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetMsgMinSeqReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SetMsgMinSeqReq proto.InternalMessageInfo - -func (m *SetMsgMinSeqReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *SetMsgMinSeqReq) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" -} - -func (m *SetMsgMinSeqReq) GetMinSeq() uint32 { - if m != nil { - return m.MinSeq - } - return 0 -} - -func (m *SetMsgMinSeqReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *SetMsgMinSeqReq) GetOpUserID() string { - if m != nil { - return m.OpUserID - } - return "" -} - -type SetMsgMinSeqResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetMsgMinSeqResp) Reset() { *m = SetMsgMinSeqResp{} } -func (m *SetMsgMinSeqResp) String() string { return proto.CompactTextString(m) } -func (*SetMsgMinSeqResp) ProtoMessage() {} -func (*SetMsgMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{11} -} -func (m *SetMsgMinSeqResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetMsgMinSeqResp.Unmarshal(m, b) -} -func (m *SetMsgMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetMsgMinSeqResp.Marshal(b, m, deterministic) -} -func (dst *SetMsgMinSeqResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetMsgMinSeqResp.Merge(dst, src) -} -func (m *SetMsgMinSeqResp) XXX_Size() int { - return xxx_messageInfo_SetMsgMinSeqResp.Size(m) -} -func (m *SetMsgMinSeqResp) XXX_DiscardUnknown() { - xxx_messageInfo_SetMsgMinSeqResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SetMsgMinSeqResp proto.InternalMessageInfo - -func (m *SetMsgMinSeqResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *SetMsgMinSeqResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type SetSendMsgFailedFlagReq struct { - OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetSendMsgFailedFlagReq) Reset() { *m = SetSendMsgFailedFlagReq{} } -func (m *SetSendMsgFailedFlagReq) String() string { return proto.CompactTextString(m) } -func (*SetSendMsgFailedFlagReq) ProtoMessage() {} -func (*SetSendMsgFailedFlagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{12} -} -func (m *SetSendMsgFailedFlagReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetSendMsgFailedFlagReq.Unmarshal(m, b) -} -func (m *SetSendMsgFailedFlagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetSendMsgFailedFlagReq.Marshal(b, m, deterministic) -} -func (dst *SetSendMsgFailedFlagReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetSendMsgFailedFlagReq.Merge(dst, src) -} -func (m *SetSendMsgFailedFlagReq) XXX_Size() int { - return xxx_messageInfo_SetSendMsgFailedFlagReq.Size(m) -} -func (m *SetSendMsgFailedFlagReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetSendMsgFailedFlagReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SetSendMsgFailedFlagReq proto.InternalMessageInfo - -func (m *SetSendMsgFailedFlagReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type SetSendMsgFailedFlagResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetSendMsgFailedFlagResp) Reset() { *m = SetSendMsgFailedFlagResp{} } -func (m *SetSendMsgFailedFlagResp) String() string { return proto.CompactTextString(m) } -func (*SetSendMsgFailedFlagResp) ProtoMessage() {} -func (*SetSendMsgFailedFlagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{13} -} -func (m *SetSendMsgFailedFlagResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetSendMsgFailedFlagResp.Unmarshal(m, b) -} -func (m *SetSendMsgFailedFlagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetSendMsgFailedFlagResp.Marshal(b, m, deterministic) -} -func (dst *SetSendMsgFailedFlagResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetSendMsgFailedFlagResp.Merge(dst, src) -} -func (m *SetSendMsgFailedFlagResp) XXX_Size() int { - return xxx_messageInfo_SetSendMsgFailedFlagResp.Size(m) -} -func (m *SetSendMsgFailedFlagResp) XXX_DiscardUnknown() { - xxx_messageInfo_SetSendMsgFailedFlagResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SetSendMsgFailedFlagResp proto.InternalMessageInfo - -func (m *SetSendMsgFailedFlagResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *SetSendMsgFailedFlagResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type GetSendMsgStatusReq struct { - OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetSendMsgStatusReq) Reset() { *m = GetSendMsgStatusReq{} } -func (m *GetSendMsgStatusReq) String() string { return proto.CompactTextString(m) } -func (*GetSendMsgStatusReq) ProtoMessage() {} -func (*GetSendMsgStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{14} -} -func (m *GetSendMsgStatusReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetSendMsgStatusReq.Unmarshal(m, b) -} -func (m *GetSendMsgStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetSendMsgStatusReq.Marshal(b, m, deterministic) -} -func (dst *GetSendMsgStatusReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSendMsgStatusReq.Merge(dst, src) -} -func (m *GetSendMsgStatusReq) XXX_Size() int { - return xxx_messageInfo_GetSendMsgStatusReq.Size(m) -} -func (m *GetSendMsgStatusReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetSendMsgStatusReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSendMsgStatusReq proto.InternalMessageInfo - -func (m *GetSendMsgStatusReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetSendMsgStatusResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - Status int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetSendMsgStatusResp) Reset() { *m = GetSendMsgStatusResp{} } -func (m *GetSendMsgStatusResp) String() string { return proto.CompactTextString(m) } -func (*GetSendMsgStatusResp) ProtoMessage() {} -func (*GetSendMsgStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_b3ce531eb8197ddf, []int{15} -} -func (m *GetSendMsgStatusResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetSendMsgStatusResp.Unmarshal(m, b) -} -func (m *GetSendMsgStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetSendMsgStatusResp.Marshal(b, m, deterministic) -} -func (dst *GetSendMsgStatusResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSendMsgStatusResp.Merge(dst, src) -} -func (m *GetSendMsgStatusResp) XXX_Size() int { - return xxx_messageInfo_GetSendMsgStatusResp.Size(m) -} -func (m *GetSendMsgStatusResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetSendMsgStatusResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSendMsgStatusResp proto.InternalMessageInfo - -func (m *GetSendMsgStatusResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *GetSendMsgStatusResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *GetSendMsgStatusResp) GetStatus() int32 { - if m != nil { - return m.Status - } - return 0 -} - -func init() { - proto.RegisterType((*MsgDataToMQ)(nil), "msg.MsgDataToMQ") - proto.RegisterType((*MsgDataToDB)(nil), "msg.MsgDataToDB") - proto.RegisterType((*PushMsgDataToMQ)(nil), "msg.PushMsgDataToMQ") - proto.RegisterType((*MsgDataToMongoByMQ)(nil), "msg.MsgDataToMongoByMQ") - proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "msg.GetMaxAndMinSeqReq") - proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "msg.GetMaxAndMinSeqResp") - proto.RegisterType((*SendMsgReq)(nil), "msg.SendMsgReq") - proto.RegisterType((*SendMsgResp)(nil), "msg.SendMsgResp") - proto.RegisterType((*ClearMsgReq)(nil), "msg.ClearMsgReq") - proto.RegisterType((*ClearMsgResp)(nil), "msg.ClearMsgResp") - proto.RegisterType((*SetMsgMinSeqReq)(nil), "msg.SetMsgMinSeqReq") - proto.RegisterType((*SetMsgMinSeqResp)(nil), "msg.SetMsgMinSeqResp") - proto.RegisterType((*SetSendMsgFailedFlagReq)(nil), "msg.SetSendMsgFailedFlagReq") - proto.RegisterType((*SetSendMsgFailedFlagResp)(nil), "msg.SetSendMsgFailedFlagResp") - proto.RegisterType((*GetSendMsgStatusReq)(nil), "msg.GetSendMsgStatusReq") - proto.RegisterType((*GetSendMsgStatusResp)(nil), "msg.GetSendMsgStatusResp") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Msg service - -type MsgClient interface { - GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) - PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) - SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) - DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) - ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) - SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error) - SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) - GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) -} - -type msgClient struct { - cc *grpc.ClientConn -} - -func NewMsgClient(cc *grpc.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) { - out := new(sdk_ws.GetMaxAndMinSeqResp) - err := grpc.Invoke(ctx, "/msg.msg/GetMaxAndMinSeq", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) { - out := new(sdk_ws.PullMessageBySeqListResp) - err := grpc.Invoke(ctx, "/msg.msg/PullMessageBySeqList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) { - out := new(SendMsgResp) - err := grpc.Invoke(ctx, "/msg.msg/SendMsg", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) { - out := new(sdk_ws.DelMsgListResp) - err := grpc.Invoke(ctx, "/msg.msg/DelMsgList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) { - out := new(ClearMsgResp) - err := grpc.Invoke(ctx, "/msg.msg/ClearMsg", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error) { - out := new(SetMsgMinSeqResp) - err := grpc.Invoke(ctx, "/msg.msg/SetMsgMinSeq", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) { - out := new(SetSendMsgFailedFlagResp) - err := grpc.Invoke(ctx, "/msg.msg/SetSendMsgFailedFlag", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) { - out := new(GetSendMsgStatusResp) - err := grpc.Invoke(ctx, "/msg.msg/GetSendMsgStatus", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Msg service - -type MsgServer interface { - GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error) - PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) - SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) - DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) - ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error) - SetMsgMinSeq(context.Context, *SetMsgMinSeqReq) (*SetMsgMinSeqResp, error) - SetSendMsgFailedFlag(context.Context, *SetSendMsgFailedFlagReq) (*SetSendMsgFailedFlagResp, error) - GetSendMsgStatus(context.Context, *GetSendMsgStatusReq) (*GetSendMsgStatusResp, error) -} - -func RegisterMsgServer(s *grpc.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(sdk_ws.GetMaxAndMinSeqReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).GetMaxAndMinSeq(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/GetMaxAndMinSeq", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(sdk_ws.PullMessageBySeqListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).PullMessageBySeqList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/PullMessageBySeqList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMsgReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SendMsg(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/SendMsg", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SendMsg(ctx, req.(*SendMsgReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(sdk_ws.DelMsgListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DelMsgList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/DelMsgList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClearMsgReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ClearMsg(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/ClearMsg", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ClearMsg(ctx, req.(*ClearMsgReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SetMsgMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetMsgMinSeqReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetMsgMinSeq(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/SetMsgMinSeq", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetMsgMinSeq(ctx, req.(*SetMsgMinSeqReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SetSendMsgFailedFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetSendMsgFailedFlagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetSendMsgFailedFlag(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/SetSendMsgFailedFlag", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetSendMsgFailedFlag(ctx, req.(*SetSendMsgFailedFlagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_GetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSendMsgStatusReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).GetSendMsgStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/msg.msg/GetSendMsgStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).GetSendMsgStatus(ctx, req.(*GetSendMsgStatusReq)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "msg.msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetMaxAndMinSeq", - Handler: _Msg_GetMaxAndMinSeq_Handler, - }, - { - MethodName: "PullMessageBySeqList", - Handler: _Msg_PullMessageBySeqList_Handler, - }, - { - MethodName: "SendMsg", - Handler: _Msg_SendMsg_Handler, - }, - { - MethodName: "DelMsgList", - Handler: _Msg_DelMsgList_Handler, - }, - { - MethodName: "ClearMsg", - Handler: _Msg_ClearMsg_Handler, - }, - { - MethodName: "SetMsgMinSeq", - Handler: _Msg_SetMsgMinSeq_Handler, - }, - { - MethodName: "SetSendMsgFailedFlag", - Handler: _Msg_SetSendMsgFailedFlag_Handler, - }, - { - MethodName: "GetSendMsgStatus", - Handler: _Msg_GetSendMsgStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "msg/msg.proto", -} - -func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_b3ce531eb8197ddf) } - -var fileDescriptor_msg_b3ce531eb8197ddf = []byte{ - // 793 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xfb, 0x44, - 0x10, 0x96, 0x9b, 0x7f, 0xbf, 0x8c, 0x5b, 0x25, 0x2c, 0xa1, 0x18, 0xab, 0x48, 0xa9, 0x05, 0x28, - 0x02, 0x94, 0x48, 0x01, 0x89, 0x43, 0x2f, 0x90, 0xa6, 0xad, 0x2a, 0xd5, 0xb4, 0xb5, 0xcb, 0x85, - 0x4b, 0x6a, 0x9a, 0xd5, 0xd6, 0xaa, 0xff, 0x6c, 0x3c, 0x0e, 0x6d, 0xe1, 0x19, 0x78, 0x00, 0x4e, - 0xdc, 0x78, 0x33, 0xde, 0x03, 0xed, 0xae, 0x93, 0xd8, 0x89, 0xa1, 0x51, 0x0e, 0xbf, 0xe3, 0xf7, - 0x79, 0x76, 0xe6, 0xfb, 0x66, 0x67, 0x27, 0x81, 0x83, 0x10, 0xd9, 0x20, 0x44, 0xd6, 0xe7, 0x49, - 0x9c, 0xc6, 0xa4, 0x12, 0x22, 0x33, 0x8f, 0xaf, 0x39, 0x8d, 0x26, 0x97, 0xf6, 0x80, 0x3f, 0xb1, - 0x81, 0xe4, 0x07, 0x38, 0x7d, 0x9a, 0x3c, 0xe3, 0xe0, 0x19, 0x55, 0x9c, 0xf5, 0x3b, 0xe8, 0x36, - 0xb2, 0xb1, 0x97, 0x7a, 0x77, 0xb1, 0x7d, 0x4b, 0x3a, 0x50, 0x4b, 0xe3, 0x27, 0x1a, 0x19, 0x5a, - 0x57, 0xeb, 0x35, 0x1d, 0x05, 0x48, 0x17, 0xf4, 0x98, 0xd3, 0xc4, 0x4b, 0xfd, 0x38, 0xba, 0x1c, - 0x1b, 0x7b, 0xf2, 0x5b, 0x9e, 0x22, 0xdf, 0x42, 0x23, 0x54, 0x69, 0x8c, 0x4a, 0x57, 0xeb, 0xe9, - 0x43, 0xb3, 0x8f, 0x34, 0xf9, 0x95, 0x26, 0x13, 0x8f, 0xfb, 0x13, 0xee, 0x25, 0x5e, 0x88, 0xfd, - 0xac, 0x90, 0xb3, 0x08, 0xb5, 0x68, 0xae, 0xf8, 0x78, 0x94, 0x4f, 0xa2, 0x6d, 0x9d, 0xe4, 0x6d, - 0x71, 0xd6, 0x1f, 0x1a, 0xb4, 0x6e, 0xe6, 0xf8, 0x98, 0x37, 0xda, 0x05, 0xfd, 0x3a, 0x77, 0x4a, - 0xd9, 0xcd, 0x53, 0x79, 0x35, 0x7b, 0xdb, 0xab, 0xb1, 0x60, 0x9f, 0xcf, 0xf1, 0xf1, 0x2e, 0xfe, - 0x09, 0x69, 0x72, 0x39, 0x96, 0xdd, 0x68, 0x3a, 0x05, 0xce, 0xfa, 0x5b, 0x03, 0xb2, 0xd2, 0x12, - 0x47, 0x2c, 0x1e, 0xbd, 0xda, 0xb7, 0xc4, 0x80, 0x46, 0xe0, 0x61, 0xea, 0xd2, 0x99, 0x94, 0x53, - 0x75, 0x16, 0x90, 0x7c, 0x06, 0x07, 0x1e, 0x63, 0x09, 0x65, 0x45, 0x93, 0x45, 0x92, 0x0c, 0x41, - 0x0f, 0x29, 0xa2, 0xc7, 0xe8, 0x95, 0x8f, 0xa9, 0x51, 0xe9, 0x56, 0x7a, 0xfa, 0xb0, 0xdd, 0x17, - 0x33, 0x91, 0x73, 0xee, 0xe4, 0x83, 0xc8, 0x11, 0x34, 0xd3, 0xc4, 0x67, 0x4c, 0x6a, 0xad, 0xca, - 0xac, 0x2b, 0xc2, 0xfa, 0x11, 0xc8, 0x05, 0x4d, 0x6d, 0xef, 0xe5, 0x87, 0x68, 0x6a, 0xfb, 0x91, - 0x4b, 0x67, 0x0e, 0x9d, 0x91, 0x43, 0xa8, 0x67, 0xe6, 0x54, 0xd7, 0x32, 0xb4, 0xde, 0xd2, 0xbd, - 0x8d, 0x96, 0x5a, 0xcf, 0xf0, 0xe1, 0x46, 0x3e, 0xe4, 0xc2, 0xf8, 0x59, 0x92, 0x9c, 0xc6, 0x53, - 0x2a, 0x33, 0xd6, 0x9c, 0x05, 0x14, 0xa5, 0xce, 0x92, 0xc4, 0x46, 0x96, 0x65, 0xcb, 0x90, 0xe0, - 0x6d, 0xef, 0x45, 0x74, 0x4a, 0xf4, 0xf7, 0xc0, 0xc9, 0x90, 0xe4, 0x65, 0x5e, 0xe9, 0x45, 0xf0, - 0x12, 0x59, 0xbf, 0x01, 0xb8, 0x34, 0x9a, 0xda, 0xc8, 0x84, 0x81, 0xf7, 0x3b, 0xe4, 0x7f, 0x69, - 0xa0, 0x2f, 0x8b, 0x2b, 0xb7, 0xb4, 0xe8, 0x96, 0xae, 0xdc, 0xd2, 0x82, 0x5b, 0x85, 0x84, 0x32, - 0x55, 0xc7, 0x46, 0xb6, 0xbc, 0xa6, 0x3c, 0x25, 0x22, 0x1e, 0x02, 0x9f, 0x46, 0xa9, 0x8a, 0xa8, - 0xa9, 0x88, 0x1c, 0x45, 0x4c, 0x78, 0x87, 0x34, 0x9a, 0xde, 0xf9, 0x21, 0x35, 0xea, 0x5d, 0xad, - 0x57, 0x71, 0x96, 0xd8, 0x7a, 0x00, 0xfd, 0x34, 0xa0, 0x5e, 0x92, 0xb5, 0xe7, 0x10, 0xea, 0xf3, - 0xc2, 0xfd, 0x2a, 0x24, 0x52, 0xc4, 0x3c, 0xbb, 0x79, 0x25, 0x70, 0x89, 0xd7, 0x9b, 0x57, 0xd9, - 0x7c, 0x84, 0xdf, 0xc3, 0xfe, 0xaa, 0xc8, 0x2e, 0x6d, 0xb0, 0xfe, 0xd4, 0xa0, 0xe5, 0x52, 0xe1, - 0xa7, 0x30, 0x8b, 0xa5, 0x5a, 0x0d, 0x68, 0xb0, 0x24, 0x9e, 0xf3, 0xa5, 0xd4, 0x05, 0x14, 0x27, - 0x42, 0x35, 0x22, 0xd9, 0xe8, 0x28, 0xb4, 0xee, 0xa0, 0xba, 0x79, 0xfd, 0x79, 0xff, 0xb5, 0xa2, - 0x7f, 0x6b, 0x0c, 0xed, 0xa2, 0xb4, 0x9d, 0x1c, 0x9e, 0xc0, 0xc7, 0x2e, 0x4d, 0xb3, 0x61, 0x39, - 0xf7, 0xfc, 0x80, 0x4e, 0xcf, 0x03, 0x4f, 0x5e, 0xca, 0x9a, 0x3c, 0x6d, 0xb3, 0xc1, 0x57, 0x60, - 0x94, 0x1f, 0xde, 0x49, 0xca, 0x77, 0xf2, 0xa9, 0x66, 0xd9, 0xdc, 0xd4, 0x4b, 0xe7, 0xb8, 0x9d, - 0x8c, 0x7b, 0xe8, 0x6c, 0x1e, 0xdc, 0x69, 0xec, 0x0f, 0xa1, 0x8e, 0xf2, 0xbc, 0xbc, 0xa9, 0x9a, - 0x93, 0xa1, 0xe1, 0x3f, 0x55, 0x10, 0xbf, 0x6e, 0xe4, 0x1e, 0x5a, 0x6b, 0xdb, 0x84, 0x7c, 0x5e, - 0xf2, 0x20, 0x37, 0x37, 0x98, 0xf9, 0xc5, 0x36, 0x61, 0xc8, 0x49, 0x0c, 0x9d, 0x9b, 0x79, 0x10, - 0xd8, 0x6a, 0x61, 0x8e, 0x5e, 0x5d, 0x3a, 0x93, 0x5b, 0xf3, 0xcb, 0x92, 0xf3, 0x65, 0x81, 0xa2, - 0xd6, 0x57, 0x5b, 0xc7, 0x22, 0x27, 0x5f, 0x43, 0x23, 0xeb, 0x1c, 0x69, 0xc9, 0xc5, 0xbd, 0xda, - 0x5a, 0x66, 0xbb, 0x48, 0x20, 0x27, 0xb7, 0x00, 0x63, 0x1a, 0xd8, 0xc8, 0xa4, 0xa8, 0x6e, 0x49, - 0xa1, 0xd5, 0x67, 0x91, 0xe1, 0xf8, 0x8d, 0x08, 0xe4, 0x64, 0x00, 0xef, 0x16, 0xaf, 0x94, 0xa8, - 0x82, 0xb9, 0xcd, 0x60, 0x7e, 0xb0, 0xc6, 0x20, 0x27, 0x27, 0xb0, 0x9f, 0x1f, 0x7c, 0xd2, 0xc9, - 0x54, 0x16, 0x9e, 0xa9, 0xf9, 0x51, 0x09, 0x8b, 0x9c, 0xb8, 0xd0, 0x29, 0x1b, 0x59, 0x72, 0xb4, - 0x08, 0x2f, 0x7b, 0x0a, 0xe6, 0xa7, 0xff, 0xf3, 0x15, 0x39, 0xb9, 0x80, 0xf6, 0xfa, 0x00, 0x12, - 0x43, 0x1e, 0x29, 0x19, 0x68, 0xf3, 0x93, 0xff, 0xf8, 0x82, 0x7c, 0xa4, 0xff, 0xdc, 0xec, 0x8b, - 0x7f, 0x54, 0x27, 0x21, 0xb2, 0x5f, 0xea, 0xf2, 0xef, 0xd2, 0x37, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0x01, 0x7d, 0x7b, 0xe8, 0x67, 0x09, 0x00, 0x00, -} diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index 1557f38b5..b2ea4fbbc 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -120,12 +120,22 @@ message GetSendMsgStatusResp{ string errMsg = 2; int32 status = 3; } - +message DelSuperGroupMsgReq{ + string opUserID = 1; + string userID = 2; + string groupID = 3; + string operationID = 4; +} +message DelSuperGroupMsgResp{ + int32 errCode = 1; + string errMsg = 2; +} service msg { rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); rpc SendMsg(SendMsgReq) returns(SendMsgResp); rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp); + rpc DelSuperGroupMsg(DelSuperGroupMsgReq) returns(DelSuperGroupMsgResp); rpc ClearMsg(ClearMsgReq) returns(ClearMsgResp); rpc SetMsgMinSeq(SetMsgMinSeqReq) returns(SetMsgMinSeqResp); rpc SetSendMsgFailedFlag(SetSendMsgFailedFlagReq) returns(SetSendMsgFailedFlagResp); From 6d15e5b5a10f28a39d154bd153432b0c6e027fe3 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 13:05:51 +0800 Subject: [PATCH 26/53] msg --- internal/rpc/msg/chat.go | 2 +- pkg/common/db/RedisModel.go | 2 +- pkg/proto/msg/msg.pb.go | 1410 +++++++++++++++++++++++++++++++++++ 3 files changed, 1412 insertions(+), 2 deletions(-) create mode 100644 pkg/proto/msg/msg.pb.go diff --git a/internal/rpc/msg/chat.go b/internal/rpc/msg/chat.go index a525dab09..1d403e3a4 100644 --- a/internal/rpc/msg/chat.go +++ b/internal/rpc/msg/chat.go @@ -53,7 +53,7 @@ func (rpc *rpcChat) SetMsgMinSeq(_ context.Context, req *pbChat.SetMsgMinSeqReq) } return &pbChat.SetMsgMinSeqResp{}, nil } - err := db.DB.SetGroupUserMinSeq(req.GroupID, req.UserID, req.MinSeq) + err := db.DB.SetGroupUserMinSeq(req.GroupID, req.UserID, uint64(req.MinSeq)) if err != nil { errMsg := "SetGroupUserMinSeq failed " + err.Error() + req.OperationID + req.GroupID + req.UserID + utils.Uint32ToString(req.MinSeq) log.Error(req.OperationID, errMsg) diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index 163202270..2ef11d59b 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -88,7 +88,7 @@ func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { return uint64(utils.StringToInt(seq)), err } -func (d *DataBases) SetGroupUserMinSeq(groupID, userID string, minSeq uint32) (err error) { +func (d *DataBases) SetGroupUserMinSeq(groupID, userID string, minSeq uint64) (err error) { key := groupUserMinSeq + "g:" + groupID + "u:" + userID return d.RDB.Set(context.Background(), key, minSeq, 0).Err() } diff --git a/pkg/proto/msg/msg.pb.go b/pkg/proto/msg/msg.pb.go new file mode 100644 index 000000000..38616ae68 --- /dev/null +++ b/pkg/proto/msg/msg.pb.go @@ -0,0 +1,1410 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: msg/msg.proto + +package msg // import "./msg" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type MsgDataToMQ struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } +func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMQ) ProtoMessage() {} +func (*MsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{0} +} +func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) +} +func (m *MsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMQ.Merge(dst, src) +} +func (m *MsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMQ.Size(m) +} +func (m *MsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToMQ proto.InternalMessageInfo + +func (m *MsgDataToMQ) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *MsgDataToMQ) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +type MsgDataToDB struct { + MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } +func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } +func (*MsgDataToDB) ProtoMessage() {} +func (*MsgDataToDB) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{1} +} +func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) +} +func (m *MsgDataToDB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToDB.Marshal(b, m, deterministic) +} +func (dst *MsgDataToDB) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToDB.Merge(dst, src) +} +func (m *MsgDataToDB) XXX_Size() int { + return xxx_messageInfo_MsgDataToDB.Size(m) +} +func (m *MsgDataToDB) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToDB.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo + +func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *MsgDataToDB) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type PushMsgDataToMQ struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } +func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*PushMsgDataToMQ) ProtoMessage() {} +func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{2} +} +func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) +} +func (m *PushMsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushMsgDataToMQ.Marshal(b, m, deterministic) +} +func (dst *PushMsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgDataToMQ.Merge(dst, src) +} +func (m *PushMsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_PushMsgDataToMQ.Size(m) +} +func (m *PushMsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_PushMsgDataToMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_PushMsgDataToMQ proto.InternalMessageInfo + +func (m *PushMsgDataToMQ) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *PushMsgDataToMQ) GetPushToUserID() string { + if m != nil { + return m.PushToUserID + } + return "" +} + +type MsgDataToMongoByMQ struct { + LastSeq uint64 `protobuf:"varint,1,opt,name=lastSeq" json:"lastSeq,omitempty"` + AggregationID string `protobuf:"bytes,2,opt,name=aggregationID" json:"aggregationID,omitempty"` + MessageList []*MsgDataToMQ `protobuf:"bytes,3,rep,name=messageList" json:"messageList,omitempty"` + TriggerID string `protobuf:"bytes,4,opt,name=triggerID" json:"triggerID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } +func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMongoByMQ) ProtoMessage() {} +func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{3} +} +func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) +} +func (m *MsgDataToMongoByMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMongoByMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToMongoByMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMongoByMQ.Merge(dst, src) +} +func (m *MsgDataToMongoByMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMongoByMQ.Size(m) +} +func (m *MsgDataToMongoByMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMongoByMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToMongoByMQ proto.InternalMessageInfo + +func (m *MsgDataToMongoByMQ) GetLastSeq() uint64 { + if m != nil { + return m.LastSeq + } + return 0 +} + +func (m *MsgDataToMongoByMQ) GetAggregationID() string { + if m != nil { + return m.AggregationID + } + return "" +} + +func (m *MsgDataToMongoByMQ) GetMessageList() []*MsgDataToMQ { + if m != nil { + return m.MessageList + } + return nil +} + +func (m *MsgDataToMongoByMQ) GetTriggerID() string { + if m != nil { + return m.TriggerID + } + return "" +} + +// message PullMessageReq { +// string UserID = 1; +// int64 SeqBegin = 2; +// int64 SeqEnd = 3; +// string OperationID = 4; +// } +// +// message PullMessageResp { +// int32 ErrCode = 1; +// string ErrMsg = 2; +// int64 MaxSeq = 3; +// int64 MinSeq = 4; +// repeated GatherFormat SingleUserMsg = 5; +// repeated GatherFormat GroupUserMsg = 6; +// } +// message PullMessageBySeqListReq{ +// string UserID = 1; +// string OperationID = 2; +// repeated int64 seqList =3; +// } +type GetMaxAndMinSeqReq struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } +func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqReq) ProtoMessage() {} +func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{4} +} +func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) +} +func (m *GetMaxAndMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqReq.Marshal(b, m, deterministic) +} +func (dst *GetMaxAndMinSeqReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqReq.Merge(dst, src) +} +func (m *GetMaxAndMinSeqReq) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqReq.Size(m) +} +func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo + +func (m *GetMaxAndMinSeqReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetMaxAndMinSeqReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetMaxAndMinSeqResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + MaxSeq uint32 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } +func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqResp) ProtoMessage() {} +func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{5} +} +func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) +} +func (m *GetMaxAndMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqResp.Marshal(b, m, deterministic) +} +func (dst *GetMaxAndMinSeqResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqResp.Merge(dst, src) +} +func (m *GetMaxAndMinSeqResp) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqResp.Size(m) +} +func (m *GetMaxAndMinSeqResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMaxAndMinSeqResp proto.InternalMessageInfo + +func (m *GetMaxAndMinSeqResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetMaxAndMinSeqResp) GetMaxSeq() uint32 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +type SendMsgReq struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } +func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } +func (*SendMsgReq) ProtoMessage() {} +func (*SendMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{6} +} +func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) +} +func (m *SendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgReq.Marshal(b, m, deterministic) +} +func (dst *SendMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgReq.Merge(dst, src) +} +func (m *SendMsgReq) XXX_Size() int { + return xxx_messageInfo_SendMsgReq.Size(m) +} +func (m *SendMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsgReq proto.InternalMessageInfo + +func (m *SendMsgReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SendMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +type SendMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ServerMsgID string `protobuf:"bytes,4,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + SendTime int64 `protobuf:"varint,6,opt,name=sendTime" json:"sendTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } +func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } +func (*SendMsgResp) ProtoMessage() {} +func (*SendMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{7} +} +func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) +} +func (m *SendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgResp.Marshal(b, m, deterministic) +} +func (dst *SendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgResp.Merge(dst, src) +} +func (m *SendMsgResp) XXX_Size() int { + return xxx_messageInfo_SendMsgResp.Size(m) +} +func (m *SendMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsgResp proto.InternalMessageInfo + +func (m *SendMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SendMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *SendMsgResp) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *SendMsgResp) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *SendMsgResp) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +type ClearMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} } +func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } +func (*ClearMsgReq) ProtoMessage() {} +func (*ClearMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{8} +} +func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) +} +func (m *ClearMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgReq.Marshal(b, m, deterministic) +} +func (dst *ClearMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgReq.Merge(dst, src) +} +func (m *ClearMsgReq) XXX_Size() int { + return xxx_messageInfo_ClearMsgReq.Size(m) +} +func (m *ClearMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgReq proto.InternalMessageInfo + +func (m *ClearMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ClearMsgReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ClearMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ClearMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} } +func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } +func (*ClearMsgResp) ProtoMessage() {} +func (*ClearMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{9} +} +func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) +} +func (m *ClearMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgResp.Marshal(b, m, deterministic) +} +func (dst *ClearMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgResp.Merge(dst, src) +} +func (m *ClearMsgResp) XXX_Size() int { + return xxx_messageInfo_ClearMsgResp.Size(m) +} +func (m *ClearMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgResp proto.InternalMessageInfo + +func (m *ClearMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *ClearMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type SetMsgMinSeqReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"` + MinSeq uint32 `protobuf:"varint,3,opt,name=minSeq" json:"minSeq,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,5,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetMsgMinSeqReq) Reset() { *m = SetMsgMinSeqReq{} } +func (m *SetMsgMinSeqReq) String() string { return proto.CompactTextString(m) } +func (*SetMsgMinSeqReq) ProtoMessage() {} +func (*SetMsgMinSeqReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{10} +} +func (m *SetMsgMinSeqReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetMsgMinSeqReq.Unmarshal(m, b) +} +func (m *SetMsgMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetMsgMinSeqReq.Marshal(b, m, deterministic) +} +func (dst *SetMsgMinSeqReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetMsgMinSeqReq.Merge(dst, src) +} +func (m *SetMsgMinSeqReq) XXX_Size() int { + return xxx_messageInfo_SetMsgMinSeqReq.Size(m) +} +func (m *SetMsgMinSeqReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetMsgMinSeqReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetMsgMinSeqReq proto.InternalMessageInfo + +func (m *SetMsgMinSeqReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetMsgMinSeqReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *SetMsgMinSeqReq) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +func (m *SetMsgMinSeqReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SetMsgMinSeqReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type SetMsgMinSeqResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetMsgMinSeqResp) Reset() { *m = SetMsgMinSeqResp{} } +func (m *SetMsgMinSeqResp) String() string { return proto.CompactTextString(m) } +func (*SetMsgMinSeqResp) ProtoMessage() {} +func (*SetMsgMinSeqResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{11} +} +func (m *SetMsgMinSeqResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetMsgMinSeqResp.Unmarshal(m, b) +} +func (m *SetMsgMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetMsgMinSeqResp.Marshal(b, m, deterministic) +} +func (dst *SetMsgMinSeqResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetMsgMinSeqResp.Merge(dst, src) +} +func (m *SetMsgMinSeqResp) XXX_Size() int { + return xxx_messageInfo_SetMsgMinSeqResp.Size(m) +} +func (m *SetMsgMinSeqResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetMsgMinSeqResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetMsgMinSeqResp proto.InternalMessageInfo + +func (m *SetMsgMinSeqResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SetMsgMinSeqResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type SetSendMsgFailedFlagReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetSendMsgFailedFlagReq) Reset() { *m = SetSendMsgFailedFlagReq{} } +func (m *SetSendMsgFailedFlagReq) String() string { return proto.CompactTextString(m) } +func (*SetSendMsgFailedFlagReq) ProtoMessage() {} +func (*SetSendMsgFailedFlagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{12} +} +func (m *SetSendMsgFailedFlagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Unmarshal(m, b) +} +func (m *SetSendMsgFailedFlagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Marshal(b, m, deterministic) +} +func (dst *SetSendMsgFailedFlagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetSendMsgFailedFlagReq.Merge(dst, src) +} +func (m *SetSendMsgFailedFlagReq) XXX_Size() int { + return xxx_messageInfo_SetSendMsgFailedFlagReq.Size(m) +} +func (m *SetSendMsgFailedFlagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetSendMsgFailedFlagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetSendMsgFailedFlagReq proto.InternalMessageInfo + +func (m *SetSendMsgFailedFlagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetSendMsgFailedFlagResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetSendMsgFailedFlagResp) Reset() { *m = SetSendMsgFailedFlagResp{} } +func (m *SetSendMsgFailedFlagResp) String() string { return proto.CompactTextString(m) } +func (*SetSendMsgFailedFlagResp) ProtoMessage() {} +func (*SetSendMsgFailedFlagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{13} +} +func (m *SetSendMsgFailedFlagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Unmarshal(m, b) +} +func (m *SetSendMsgFailedFlagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Marshal(b, m, deterministic) +} +func (dst *SetSendMsgFailedFlagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetSendMsgFailedFlagResp.Merge(dst, src) +} +func (m *SetSendMsgFailedFlagResp) XXX_Size() int { + return xxx_messageInfo_SetSendMsgFailedFlagResp.Size(m) +} +func (m *SetSendMsgFailedFlagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetSendMsgFailedFlagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetSendMsgFailedFlagResp proto.InternalMessageInfo + +func (m *SetSendMsgFailedFlagResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SetSendMsgFailedFlagResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetSendMsgStatusReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSendMsgStatusReq) Reset() { *m = GetSendMsgStatusReq{} } +func (m *GetSendMsgStatusReq) String() string { return proto.CompactTextString(m) } +func (*GetSendMsgStatusReq) ProtoMessage() {} +func (*GetSendMsgStatusReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{14} +} +func (m *GetSendMsgStatusReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSendMsgStatusReq.Unmarshal(m, b) +} +func (m *GetSendMsgStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSendMsgStatusReq.Marshal(b, m, deterministic) +} +func (dst *GetSendMsgStatusReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSendMsgStatusReq.Merge(dst, src) +} +func (m *GetSendMsgStatusReq) XXX_Size() int { + return xxx_messageInfo_GetSendMsgStatusReq.Size(m) +} +func (m *GetSendMsgStatusReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSendMsgStatusReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSendMsgStatusReq proto.InternalMessageInfo + +func (m *GetSendMsgStatusReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetSendMsgStatusResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSendMsgStatusResp) Reset() { *m = GetSendMsgStatusResp{} } +func (m *GetSendMsgStatusResp) String() string { return proto.CompactTextString(m) } +func (*GetSendMsgStatusResp) ProtoMessage() {} +func (*GetSendMsgStatusResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{15} +} +func (m *GetSendMsgStatusResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSendMsgStatusResp.Unmarshal(m, b) +} +func (m *GetSendMsgStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSendMsgStatusResp.Marshal(b, m, deterministic) +} +func (dst *GetSendMsgStatusResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSendMsgStatusResp.Merge(dst, src) +} +func (m *GetSendMsgStatusResp) XXX_Size() int { + return xxx_messageInfo_GetSendMsgStatusResp.Size(m) +} +func (m *GetSendMsgStatusResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSendMsgStatusResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSendMsgStatusResp proto.InternalMessageInfo + +func (m *GetSendMsgStatusResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetSendMsgStatusResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetSendMsgStatusResp) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +type DelSuperGroupMsgReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DelSuperGroupMsgReq) Reset() { *m = DelSuperGroupMsgReq{} } +func (m *DelSuperGroupMsgReq) String() string { return proto.CompactTextString(m) } +func (*DelSuperGroupMsgReq) ProtoMessage() {} +func (*DelSuperGroupMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{16} +} +func (m *DelSuperGroupMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DelSuperGroupMsgReq.Unmarshal(m, b) +} +func (m *DelSuperGroupMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DelSuperGroupMsgReq.Marshal(b, m, deterministic) +} +func (dst *DelSuperGroupMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelSuperGroupMsgReq.Merge(dst, src) +} +func (m *DelSuperGroupMsgReq) XXX_Size() int { + return xxx_messageInfo_DelSuperGroupMsgReq.Size(m) +} +func (m *DelSuperGroupMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_DelSuperGroupMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DelSuperGroupMsgReq proto.InternalMessageInfo + +func (m *DelSuperGroupMsgReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DelSuperGroupMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DelSuperGroupMsgReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *DelSuperGroupMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DelSuperGroupMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DelSuperGroupMsgResp) Reset() { *m = DelSuperGroupMsgResp{} } +func (m *DelSuperGroupMsgResp) String() string { return proto.CompactTextString(m) } +func (*DelSuperGroupMsgResp) ProtoMessage() {} +func (*DelSuperGroupMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_110411abaacf415d, []int{17} +} +func (m *DelSuperGroupMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DelSuperGroupMsgResp.Unmarshal(m, b) +} +func (m *DelSuperGroupMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DelSuperGroupMsgResp.Marshal(b, m, deterministic) +} +func (dst *DelSuperGroupMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelSuperGroupMsgResp.Merge(dst, src) +} +func (m *DelSuperGroupMsgResp) XXX_Size() int { + return xxx_messageInfo_DelSuperGroupMsgResp.Size(m) +} +func (m *DelSuperGroupMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_DelSuperGroupMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DelSuperGroupMsgResp proto.InternalMessageInfo + +func (m *DelSuperGroupMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DelSuperGroupMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func init() { + proto.RegisterType((*MsgDataToMQ)(nil), "msg.MsgDataToMQ") + proto.RegisterType((*MsgDataToDB)(nil), "msg.MsgDataToDB") + proto.RegisterType((*PushMsgDataToMQ)(nil), "msg.PushMsgDataToMQ") + proto.RegisterType((*MsgDataToMongoByMQ)(nil), "msg.MsgDataToMongoByMQ") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "msg.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "msg.GetMaxAndMinSeqResp") + proto.RegisterType((*SendMsgReq)(nil), "msg.SendMsgReq") + proto.RegisterType((*SendMsgResp)(nil), "msg.SendMsgResp") + proto.RegisterType((*ClearMsgReq)(nil), "msg.ClearMsgReq") + proto.RegisterType((*ClearMsgResp)(nil), "msg.ClearMsgResp") + proto.RegisterType((*SetMsgMinSeqReq)(nil), "msg.SetMsgMinSeqReq") + proto.RegisterType((*SetMsgMinSeqResp)(nil), "msg.SetMsgMinSeqResp") + proto.RegisterType((*SetSendMsgFailedFlagReq)(nil), "msg.SetSendMsgFailedFlagReq") + proto.RegisterType((*SetSendMsgFailedFlagResp)(nil), "msg.SetSendMsgFailedFlagResp") + proto.RegisterType((*GetSendMsgStatusReq)(nil), "msg.GetSendMsgStatusReq") + proto.RegisterType((*GetSendMsgStatusResp)(nil), "msg.GetSendMsgStatusResp") + proto.RegisterType((*DelSuperGroupMsgReq)(nil), "msg.DelSuperGroupMsgReq") + proto.RegisterType((*DelSuperGroupMsgResp)(nil), "msg.DelSuperGroupMsgResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Msg service + +type MsgClient interface { + GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) + PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) + DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) + DelSuperGroupMsg(ctx context.Context, in *DelSuperGroupMsgReq, opts ...grpc.CallOption) (*DelSuperGroupMsgResp, error) + ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) + SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error) + SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) + GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) +} + +type msgClient struct { + cc *grpc.ClientConn +} + +func NewMsgClient(cc *grpc.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) { + out := new(sdk_ws.GetMaxAndMinSeqResp) + err := grpc.Invoke(ctx, "/msg.msg/GetMaxAndMinSeq", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) { + out := new(sdk_ws.PullMessageBySeqListResp) + err := grpc.Invoke(ctx, "/msg.msg/PullMessageBySeqList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) { + out := new(SendMsgResp) + err := grpc.Invoke(ctx, "/msg.msg/SendMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) { + out := new(sdk_ws.DelMsgListResp) + err := grpc.Invoke(ctx, "/msg.msg/DelMsgList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelSuperGroupMsg(ctx context.Context, in *DelSuperGroupMsgReq, opts ...grpc.CallOption) (*DelSuperGroupMsgResp, error) { + out := new(DelSuperGroupMsgResp) + err := grpc.Invoke(ctx, "/msg.msg/DelSuperGroupMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) { + out := new(ClearMsgResp) + err := grpc.Invoke(ctx, "/msg.msg/ClearMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error) { + out := new(SetMsgMinSeqResp) + err := grpc.Invoke(ctx, "/msg.msg/SetMsgMinSeq", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetSendMsgFailedFlag(ctx context.Context, in *SetSendMsgFailedFlagReq, opts ...grpc.CallOption) (*SetSendMsgFailedFlagResp, error) { + out := new(SetSendMsgFailedFlagResp) + err := grpc.Invoke(ctx, "/msg.msg/SetSendMsgFailedFlag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) { + out := new(GetSendMsgStatusResp) + err := grpc.Invoke(ctx, "/msg.msg/GetSendMsgStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Msg service + +type MsgServer interface { + GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error) + PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) + DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) + DelSuperGroupMsg(context.Context, *DelSuperGroupMsgReq) (*DelSuperGroupMsgResp, error) + ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error) + SetMsgMinSeq(context.Context, *SetMsgMinSeqReq) (*SetMsgMinSeqResp, error) + SetSendMsgFailedFlag(context.Context, *SetSendMsgFailedFlagReq) (*SetSendMsgFailedFlagResp, error) + GetSendMsgStatus(context.Context, *GetSendMsgStatusReq) (*GetSendMsgStatusResp, error) +} + +func RegisterMsgServer(s *grpc.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(sdk_ws.GetMaxAndMinSeqReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GetMaxAndMinSeq(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/GetMaxAndMinSeq", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(sdk_ws.PullMessageBySeqListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PullMessageBySeqList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/PullMessageBySeqList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SendMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/SendMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SendMsg(ctx, req.(*SendMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(sdk_ws.DelMsgListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelMsgList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/DelMsgList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DelSuperGroupMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DelSuperGroupMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelSuperGroupMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/DelSuperGroupMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DelSuperGroupMsg(ctx, req.(*DelSuperGroupMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClearMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/ClearMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClearMsg(ctx, req.(*ClearMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetMsgMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMsgMinSeqReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMsgMinSeq(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/SetMsgMinSeq", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMsgMinSeq(ctx, req.(*SetMsgMinSeqReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetSendMsgFailedFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetSendMsgFailedFlagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetSendMsgFailedFlag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/SetSendMsgFailedFlag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetSendMsgFailedFlag(ctx, req.(*SetSendMsgFailedFlagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_GetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSendMsgStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GetSendMsgStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/GetSendMsgStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GetSendMsgStatus(ctx, req.(*GetSendMsgStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "msg.msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetMaxAndMinSeq", + Handler: _Msg_GetMaxAndMinSeq_Handler, + }, + { + MethodName: "PullMessageBySeqList", + Handler: _Msg_PullMessageBySeqList_Handler, + }, + { + MethodName: "SendMsg", + Handler: _Msg_SendMsg_Handler, + }, + { + MethodName: "DelMsgList", + Handler: _Msg_DelMsgList_Handler, + }, + { + MethodName: "DelSuperGroupMsg", + Handler: _Msg_DelSuperGroupMsg_Handler, + }, + { + MethodName: "ClearMsg", + Handler: _Msg_ClearMsg_Handler, + }, + { + MethodName: "SetMsgMinSeq", + Handler: _Msg_SetMsgMinSeq_Handler, + }, + { + MethodName: "SetSendMsgFailedFlag", + Handler: _Msg_SetSendMsgFailedFlag_Handler, + }, + { + MethodName: "GetSendMsgStatus", + Handler: _Msg_GetSendMsgStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "msg/msg.proto", +} + +func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_110411abaacf415d) } + +var fileDescriptor_msg_110411abaacf415d = []byte{ + // 850 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0x1b, 0x55, + 0x10, 0xd7, 0xc6, 0xb1, 0xd3, 0xcc, 0x26, 0xb2, 0x79, 0x35, 0x61, 0x59, 0x15, 0xc9, 0x5d, 0x01, + 0xb2, 0x00, 0xd9, 0x92, 0x41, 0xe2, 0x90, 0x0b, 0xb8, 0x6e, 0x43, 0xa4, 0x2e, 0x6d, 0x76, 0xc3, + 0x85, 0x8b, 0xbb, 0xd4, 0x4f, 0xaf, 0xab, 0xec, 0xc7, 0xf3, 0xce, 0x9a, 0xb4, 0x70, 0xe6, 0xc8, + 0x1f, 0xc0, 0x89, 0x1b, 0x47, 0xfe, 0x46, 0xf4, 0x3e, 0x6c, 0xef, 0x57, 0x88, 0xe5, 0x43, 0x8f, + 0x33, 0x3b, 0x6f, 0xe6, 0xf7, 0x9b, 0xf9, 0xbd, 0x79, 0x0b, 0xa7, 0x31, 0xb2, 0x71, 0x8c, 0x6c, + 0xc4, 0xb3, 0x34, 0x4f, 0x49, 0x2b, 0x46, 0x66, 0x3f, 0x7e, 0xc1, 0x69, 0x32, 0xbf, 0x74, 0xc7, + 0xfc, 0x86, 0x8d, 0xa5, 0x7f, 0x8c, 0x8b, 0x9b, 0xf9, 0x2d, 0x8e, 0x6f, 0x51, 0xc5, 0x39, 0xbf, + 0x83, 0xe9, 0x22, 0x9b, 0x05, 0x79, 0x70, 0x9d, 0xba, 0x57, 0xa4, 0x0f, 0xed, 0x3c, 0xbd, 0xa1, + 0x89, 0x65, 0x0c, 0x8c, 0xe1, 0xb1, 0xa7, 0x0c, 0x32, 0x00, 0x33, 0xe5, 0x34, 0x0b, 0xf2, 0x30, + 0x4d, 0x2e, 0x67, 0xd6, 0x81, 0xfc, 0x56, 0x74, 0x91, 0x6f, 0xe0, 0x28, 0x56, 0x69, 0xac, 0xd6, + 0xc0, 0x18, 0x9a, 0x13, 0x7b, 0x84, 0x34, 0xfb, 0x95, 0x66, 0xf3, 0x80, 0x87, 0x73, 0x1e, 0x64, + 0x41, 0x8c, 0x23, 0x5d, 0xc8, 0x5b, 0x87, 0x3a, 0xb4, 0x50, 0x7c, 0x36, 0x2d, 0x26, 0x31, 0x76, + 0x4e, 0x72, 0x3f, 0x38, 0xe7, 0x4f, 0x03, 0xba, 0x2f, 0x57, 0xf8, 0xa6, 0x48, 0x74, 0x00, 0xe6, + 0x8b, 0xc2, 0x29, 0x45, 0xb7, 0xe8, 0x2a, 0xa2, 0x39, 0xd8, 0x1d, 0x8d, 0x03, 0x27, 0x7c, 0x85, + 0x6f, 0xae, 0xd3, 0x9f, 0x90, 0x66, 0x97, 0x33, 0xd9, 0x8d, 0x63, 0xaf, 0xe4, 0x73, 0xfe, 0x31, + 0x80, 0x6c, 0xb1, 0xa4, 0x09, 0x4b, 0xa7, 0xef, 0xdc, 0x2b, 0x62, 0xc1, 0x51, 0x14, 0x60, 0xee, + 0xd3, 0xa5, 0x84, 0x73, 0xe8, 0xad, 0x4d, 0xf2, 0x29, 0x9c, 0x06, 0x8c, 0x65, 0x94, 0x95, 0x49, + 0x96, 0x9d, 0x64, 0x02, 0x66, 0x4c, 0x11, 0x03, 0x46, 0x9f, 0x87, 0x98, 0x5b, 0xad, 0x41, 0x6b, + 0x68, 0x4e, 0x7a, 0x23, 0xa1, 0x89, 0x02, 0x73, 0xaf, 0x18, 0x44, 0x1e, 0xc1, 0x71, 0x9e, 0x85, + 0x8c, 0x49, 0xac, 0x87, 0x32, 0xeb, 0xd6, 0xe1, 0xfc, 0x08, 0xe4, 0x82, 0xe6, 0x6e, 0xf0, 0xf6, + 0xfb, 0x64, 0xe1, 0x86, 0x89, 0x4f, 0x97, 0x1e, 0x5d, 0x92, 0x33, 0xe8, 0x68, 0x72, 0xaa, 0x6b, + 0xda, 0xaa, 0xb6, 0xf4, 0xa0, 0xd6, 0x52, 0xe7, 0x16, 0x1e, 0xd6, 0xf2, 0x21, 0x17, 0xc4, 0x9f, + 0x66, 0xd9, 0x93, 0x74, 0x41, 0x65, 0xc6, 0xb6, 0xb7, 0x36, 0x45, 0xa9, 0xa7, 0x59, 0xe6, 0x22, + 0xd3, 0xd9, 0xb4, 0x25, 0xfc, 0x6e, 0xf0, 0x56, 0x74, 0x4a, 0xf4, 0xf7, 0xd4, 0xd3, 0x96, 0xf4, + 0xcb, 0xbc, 0x92, 0x8b, 0xf0, 0x4b, 0xcb, 0xf9, 0x0d, 0xc0, 0xa7, 0xc9, 0xc2, 0x45, 0x26, 0x08, + 0xbc, 0x5f, 0x91, 0xff, 0x6d, 0x80, 0xb9, 0x29, 0xae, 0xd8, 0xd2, 0x32, 0x5b, 0xba, 0x65, 0x4b, + 0x4b, 0x6c, 0x95, 0x25, 0x90, 0xa9, 0x3a, 0x2e, 0xb2, 0xcd, 0x98, 0x8a, 0x2e, 0x11, 0xf1, 0x3a, + 0x0a, 0x69, 0x92, 0xab, 0x88, 0xb6, 0x8a, 0x28, 0xb8, 0x88, 0x0d, 0x0f, 0x90, 0x26, 0x8b, 0xeb, + 0x30, 0xa6, 0x56, 0x67, 0x60, 0x0c, 0x5b, 0xde, 0xc6, 0x76, 0x5e, 0x83, 0xf9, 0x24, 0xa2, 0x41, + 0xa6, 0xdb, 0x73, 0x06, 0x9d, 0x55, 0x69, 0xbe, 0xca, 0x12, 0x29, 0x52, 0xae, 0x27, 0xaf, 0x00, + 0x6e, 0xec, 0x6a, 0xf3, 0x5a, 0xf5, 0x4b, 0xf8, 0x1d, 0x9c, 0x6c, 0x8b, 0xec, 0xd3, 0x06, 0xe7, + 0x2f, 0x03, 0xba, 0x3e, 0x15, 0x7c, 0x4a, 0x5a, 0x6c, 0xc4, 0x6a, 0xc1, 0x11, 0xcb, 0xd2, 0x15, + 0xdf, 0x40, 0x5d, 0x9b, 0xe2, 0x44, 0xac, 0x24, 0xa2, 0xa5, 0xa3, 0xac, 0x2a, 0x83, 0xc3, 0xfa, + 0xf8, 0x8b, 0xfc, 0xdb, 0x65, 0xfe, 0xce, 0x0c, 0x7a, 0x65, 0x68, 0x7b, 0x31, 0x3c, 0x87, 0x8f, + 0x7c, 0x9a, 0x6b, 0xb1, 0x3c, 0x0b, 0xc2, 0x88, 0x2e, 0x9e, 0x45, 0x81, 0x1c, 0x4a, 0x05, 0x9e, + 0x51, 0x6f, 0xf0, 0x73, 0xb0, 0x9a, 0x0f, 0xef, 0x05, 0xe5, 0x5b, 0x79, 0x55, 0x75, 0x36, 0x3f, + 0x0f, 0xf2, 0x15, 0xee, 0x06, 0xe3, 0x15, 0xf4, 0xeb, 0x07, 0xf7, 0x92, 0xfd, 0x19, 0x74, 0x50, + 0x9e, 0x97, 0x93, 0x6a, 0x7b, 0xda, 0x72, 0xfe, 0x30, 0xe0, 0xe1, 0x8c, 0x46, 0xfe, 0x8a, 0xd3, + 0xec, 0x42, 0x4c, 0x55, 0xeb, 0xb6, 0x38, 0x1f, 0xa3, 0xa2, 0xcf, 0xad, 0x4e, 0x0e, 0xee, 0xd2, + 0x49, 0xab, 0xac, 0x93, 0x7b, 0xf5, 0xe0, 0xfc, 0x00, 0xfd, 0x3a, 0x8c, 0x7d, 0x98, 0x4e, 0xfe, + 0x6d, 0x83, 0x78, 0xaf, 0xc9, 0x2b, 0xe8, 0x56, 0xf6, 0x23, 0xf9, 0xac, 0x61, 0xc5, 0xd4, 0x77, + 0xb2, 0xfd, 0xf9, 0x2e, 0x61, 0xc8, 0x49, 0x0a, 0xfd, 0x97, 0xab, 0x28, 0x72, 0xd5, 0x13, 0x30, + 0x7d, 0xe7, 0xd3, 0xa5, 0x7c, 0x07, 0xbe, 0x68, 0x38, 0xdf, 0x14, 0x28, 0x6a, 0x7d, 0xb9, 0x73, + 0x2c, 0x72, 0xf2, 0x15, 0x1c, 0x69, 0x2d, 0x90, 0xae, 0x7c, 0x8a, 0xb6, 0x7b, 0xd8, 0xee, 0x95, + 0x1d, 0xc8, 0xc9, 0x15, 0xc0, 0x8c, 0x46, 0x2e, 0x32, 0x09, 0x6a, 0xd0, 0x50, 0x68, 0xfb, 0x59, + 0x64, 0x78, 0x7c, 0x4f, 0x04, 0x72, 0x72, 0x01, 0xbd, 0xea, 0x94, 0x88, 0x25, 0x0b, 0x37, 0x68, + 0xc8, 0xfe, 0xf8, 0x8e, 0x2f, 0xc8, 0xc9, 0x18, 0x1e, 0xac, 0x17, 0x18, 0x51, 0xc8, 0x0b, 0x4b, + 0xd3, 0xfe, 0xa0, 0xe2, 0x41, 0x4e, 0xce, 0xe1, 0xa4, 0xb8, 0x13, 0x48, 0x5f, 0xd3, 0x2d, 0x6d, + 0x30, 0xfb, 0xc3, 0x06, 0x2f, 0x72, 0xe2, 0x43, 0xbf, 0xe9, 0x36, 0x93, 0x47, 0xeb, 0xf0, 0xa6, + 0x2d, 0x61, 0x7f, 0xf2, 0x3f, 0x5f, 0x55, 0x2f, 0xaa, 0x77, 0x53, 0xf7, 0xa2, 0xe1, 0xae, 0xeb, + 0x5e, 0x34, 0x5d, 0xe6, 0xa9, 0xf9, 0xf3, 0xf1, 0x48, 0xfc, 0x6c, 0x9e, 0xc7, 0xc8, 0x7e, 0xe9, + 0xc8, 0x3f, 0xc9, 0xaf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xcc, 0x3b, 0xac, 0x82, 0x0a, + 0x00, 0x00, +} From 8f12fa52b450521f524bbda80ef886083326d73e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 14:36:07 +0800 Subject: [PATCH 27/53] mongodb superGroup to cache --- config/config.yaml | 12 ++- go.mod | 9 +- go.sum | 31 +----- .../api/third/minio_storage_credential.go | 1 + internal/push/logic/callback.go | 84 ++++++++++++--- internal/push/logic/push_to_client.go | 72 +++++++++---- internal/rpc/group/group.go | 102 ++++++++---------- internal/rpc/group/super_group.go | 25 ++--- internal/rpc/msg/send_msg.go | 2 +- pkg/base_info/third_api_struct.go | 1 + pkg/call_back_struct/common.go | 13 ++- pkg/call_back_struct/push.go | 25 ++++- pkg/common/config/config.go | 21 ++-- pkg/common/constant/constant.go | 18 ++-- pkg/common/db/model.go | 14 +-- pkg/common/db/mongoModel.go | 20 ++-- pkg/common/db/rocks_cache/rocks_cache.go | 87 ++++++++++----- 17 files changed, 320 insertions(+), 217 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index b638b8c5f..0d58c8b46 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -118,6 +118,7 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问 accessKeyID: user12345 secretAccessKey: key12345 + storageTime: 50 #文件在minio中保存的时间 ali: # ali oss regionID: "oss-cn-beijing" accessKeyID: "" @@ -130,7 +131,7 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 OssRoleArn: "acs:ram::xxx:role/xxx" dtm: - serverURL: 43.128.5.63:10007 + serverURL: 127.0.0.1:10007 rpcport: #rpc服务端口 默认即可 openImUserPort: [ 10110 ] @@ -300,6 +301,15 @@ callback: enable: false callbackTimeOut: 2 callbackFailedContinue: true # 回调超时是否继续离线推送 + callbackOnlinePush: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true # 回调超时是否继续离线推送 + callbackSuperGroupOnlinePush: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true # 回调超时是否继续离线推送 + notification: groupCreated: diff --git a/go.mod b/go.mod index 90b7ad844..568aee953 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,7 @@ require ( github.com/alibabacloud-go/tea v1.1.17 github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/bwmarrin/snowflake v0.3.0 - github.com/dtm-labs/dtmcli v1.15.0 // indirect - github.com/dtm-labs/dtmgrpc v1.15.0 // indirect - github.com/dtm-labs/rockscache v0.0.8 + github.com/dtm-labs/rockscache v0.0.11 github.com/fatih/structs v1.1.0 github.com/gin-gonic/gin v1.8.1 github.com/go-openapi/spec v0.20.6 // indirect @@ -30,14 +28,12 @@ require ( github.com/jonboulle/clockwork v0.2.2 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/lestrrat-go/strftime v1.0.4 // indirect - github.com/lithammer/shortuuid v3.0.0+incompatible // indirect github.com/minio/minio-go/v7 v7.0.22 github.com/mitchellh/mapstructure v1.4.2 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/olivere/elastic/v7 v7.0.23 github.com/pelletier/go-toml/v2 v2.0.2 // indirect github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.11.1 github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.2 @@ -50,6 +46,9 @@ require ( go.etcd.io/etcd/api/v3 v3.5.4 go.etcd.io/etcd/client/v3 v3.5.4 go.mongodb.org/mongo-driver v1.8.3 + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.7.0 // indirect + go.uber.org/zap v1.19.1 // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb golang.org/x/net v0.0.0-20220622184535-263ec571b305 diff --git a/go.sum b/go.sum index 767f591c2..16b96bd44 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= -github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= @@ -105,7 +103,6 @@ github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLj github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= @@ -139,14 +136,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dtm-labs/dtmcli v1.15.0 h1:kqiV47I9Am/0QuzX11cGTPp/Z2AcOaRDXU7E7SZWYNk= -github.com/dtm-labs/dtmcli v1.15.0/go.mod h1:otEdxUwM5FIKlCLmg5hL5+Z539DmCK2YJ0G4WNsP6Tw= -github.com/dtm-labs/dtmdriver v0.0.3 h1:9iAtvXKR3lJXQ7dvS87e4xdtmqkzN+ofek+CF9AvUSY= -github.com/dtm-labs/dtmdriver v0.0.3/go.mod h1:fLiEeD2BPwM9Yq96TfcP9KpbTwFsn5nTxa/PP0jmFuk= -github.com/dtm-labs/dtmgrpc v1.15.0 h1:ZLSbCa/83J4LUR2A/h1h68D6EPuFfDkiUTZ5btKlJvg= -github.com/dtm-labs/dtmgrpc v1.15.0/go.mod h1:fc7Mg6UGrNsHVsPrFNZhAH12/ddNHUP5E84EQY1Fz7w= -github.com/dtm-labs/rockscache v0.0.8 h1:H6cXO7YhguE9jdvdfK5rrbUUu2MWjgWqsGEA645iFQQ= -github.com/dtm-labs/rockscache v0.0.8/go.mod h1:vJmJJmuBNxcio03abYk1QPLmmQo/Kg92jB+28QmLcgY= +github.com/dtm-labs/rockscache v0.0.11 h1:V6M+KH9fFRFDXgB+Uux1d6zwhZt1O34sgPwM0wjud9Y= +github.com/dtm-labs/rockscache v0.0.11/go.mod h1:vJmJJmuBNxcio03abYk1QPLmmQo/Kg92jB+28QmLcgY= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= @@ -217,12 +208,8 @@ github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw= github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.6.0/go.mod h1:PwvJS6hvaPkjtjNg9ph+VrSD92bi5Zq73w/BIH7cC3Q= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -418,7 +405,6 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= @@ -440,8 +426,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= -github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -459,7 +443,6 @@ github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= @@ -484,21 +467,17 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -711,9 +690,7 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220622184535-263ec571b305 h1:dAgbJ2SP4jD6XYfMNLVj0BF21jo2PjChrtGaAvF5M3I= golang.org/x/net v0.0.0-20220622184535-263ec571b305/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -989,7 +966,6 @@ google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKr google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= @@ -1023,7 +999,6 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -1061,8 +1036,6 @@ gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go index e21550044..7f6c81638 100644 --- a/internal/api/third/minio_storage_credential.go +++ b/internal/api/third/minio_storage_credential.go @@ -160,6 +160,7 @@ func MinioStorageCredential(c *gin.Context) { resp.AccessKeyID = v.AccessKeyID resp.BucketName = config.Config.Credential.Minio.Bucket resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint + resp.StorageTime = config.Config.Credential.Minio.StorageTime c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) } diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index e8fd576a5..5b95e9102 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -5,22 +5,22 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" http2 "net/http" ) -func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { - callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} - if !config.Config.Callback.CallbackOfflinePush.Enable { - return callbackResp - } - callbackOfflinePushReq := cbApi.CallbackOfflinePushReq{ - UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ - CallbackCommand: constant.CallbackOfflinePushCommand, - OperationID: operationID, - UserID: userID, - PlatformID: msg.SenderPlatformID, - Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), +func callbackBeforePush(operationID string, userIDList []string, msg *commonPb.MsgData, command string, callbackResp cbApi.CommonCallbackResp, timeOut int) cbApi.CommonCallbackResp { + req := cbApi.CallbackBeforePushReq{ + UserStatusBatchCallbackReq: cbApi.UserStatusBatchCallbackReq{ + UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ + CallbackCommand: command, + OperationID: operationID, + PlatformID: msg.SenderPlatformID, + Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), + }, + UserIDList: userIDList, }, OfflinePushInfo: msg.OfflinePushInfo, SendID: msg.SendID, @@ -30,8 +30,8 @@ func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbAp AtUserIDList: msg.AtUserIDList, Content: string(msg.Content), } - callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: &callbackResp} - if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflinePushReq, callbackOfflinePushResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil { + resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, timeOut); err != nil { callbackResp.ErrCode = http2.StatusInternalServerError callbackResp.ErrMsg = err.Error() if !config.Config.Callback.CallbackOfflinePush.CallbackFailedContinue { @@ -44,3 +44,59 @@ func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbAp } return callbackResp } + +func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackOfflinePush.Enable { + return callbackResp + } + return callbackBeforePush(operationID, userIDList, msg, constant.CallbackOfflinePushCommand, callbackResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut) +} + +func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackOnlinePush.Enable { + return callbackResp + } + return callbackBeforePush(operationID, userIDList, msg, constant.CallbackOnlinePushCommand, callbackResp, config.Config.Callback.CallbackOnlinePush.CallbackTimeOut) +} + +func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg *commonPb.MsgData, pushToUserList *[]string) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable { + return callbackResp + } + req := cbApi.CallbackBeforeSuperGroupOnlinePushReq{ + UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ + CallbackCommand: constant.CallbackSuperGroupOnlinePushCommand, + OperationID: operationID, + PlatformID: msg.SenderPlatformID, + Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), + }, + OfflinePushInfo: msg.OfflinePushInfo, + SendID: msg.SendID, + GroupID: groupID, + ContentType: msg.ContentType, + SessionType: msg.SessionType, + AtUserIDList: msg.AtUserIDList, + Content: string(msg.Content), + } + resp := &cbApi.CallbackBeforeSuperGroupOnlinePushResp{CommonCallbackResp: &callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + if !config.Config.Callback.CallbackOfflinePush.CallbackFailedContinue { + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp + } else { + callbackResp.ActionCode = constant.ActionAllow + return callbackResp + } + } + if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow && len(resp.UserIDList) != 0 { + *pushToUserList = resp.UserIDList + } + log.NewDebug(operationID, utils.GetSelfFuncName(), pushToUserList, resp.UserIDList) + return callbackResp + +} diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index e6dabe074..16087026b 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -47,6 +47,18 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ") grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) } + + var UIDList = []string{pushMsg.PushToUserID} + callbackResp := callbackOnlinePush(pushMsg.OperationID, UIDList, pushMsg.MsgData) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "OnlinePush callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOnlinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "OnlinePush stop") + return + } + //Online push message log.Debug(pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) for _, v := range grpcCons { @@ -75,9 +87,6 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { return } } - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, pushMsg.PushToUserID) customContent := OpenIMContent{ SessionType: int(pushMsg.MsgData.SessionType), From: pushMsg.MsgData.SendID, @@ -118,7 +127,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { } } - callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData) + callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList, pushMsg.MsgData) log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") if callbackResp.ErrCode != 0 { log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) @@ -148,32 +157,49 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { var wsResult []*pbRelay.SingelMsgToUserResultList isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String()) - getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, pushMsg.OperationID) - if etcdConn == nil { - errMsg := pushMsg.OperationID + "getcdv3.GetConn == nil" - log.NewError(pushMsg.OperationID, errMsg) - return - } - client := pbCache.NewCacheClient(etcdConn) - cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) - if err != nil { - log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) - return - } - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) - return + var pushToUserIDList []string + if config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable { + callbackResp := callbackBeforeSuperGroupOnlinePush(pushMsg.OperationID, pushMsg.PushToUserID, pushMsg.MsgData, &pushToUserIDList) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "onlinePush stop") + return + } + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "callback userIDList Resp", pushToUserIDList) + } else { + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, pushMsg.OperationID) + if etcdConn == nil { + errMsg := pushMsg.OperationID + "getcdv3.GetConn == nil" + log.NewError(pushMsg.OperationID, errMsg) + return + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + return + } + pushToUserIDList = cacheResp.UserIDList } + if len(grpcCons) == 0 { log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ") grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) } + //Online push message log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) for _, v := range grpcCons { msgClient := pbRelay.NewRelayClient(v) - reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: cacheResp.UserIDList}) + reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: pushToUserIDList}) if err != nil { log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err) continue @@ -192,7 +218,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { onlineSuccessUserIDList = append(onlineSuccessUserIDList, v.UserID) } } - onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, cacheResp.UserIDList) + onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, pushToUserIDList) //Use offline push messaging customContent := OpenIMContent{ SessionType: int(pushMsg.MsgData.SessionType), @@ -234,7 +260,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { } } if len(onlineFailedUserIDList) > 0 { - callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList[0], pushMsg.MsgData) + callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList, pushMsg.MsgData) log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") if callbackResp.ErrCode != 0 { log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 0101ef077..e5fd06afb 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -178,6 +178,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR resp.GroupInfo.OwnerUserID = req.OwnerUserID okUserIDList = append(okUserIDList, req.OwnerUserID) } + // superGroup stored in mongodb } else { for _, v := range req.InitMemberList { okUserIDList = append(okUserIDList, v.UserID) @@ -186,20 +187,25 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) resp.ErrCode = constant.ErrDB.ErrCode resp.ErrMsg = err.Error() + ": CreateSuperGroup failed" - } - } - - for _, userID := range okUserIDList { - if err := rocksCache.DelJoinedGroupIDListFromCache(userID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), userID, err.Error()) + return resp, nil } } if len(okUserIDList) != 0 { log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) if req.GroupInfo.GroupType != constant.SuperGroup { + for _, userID := range okUserIDList { + if err := rocksCache.DelJoinedGroupIDListFromCache(userID); err != nil { + log.NewWarn(req.OperationID, utils.GetSelfFuncName(), userID, err.Error()) + } + } chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) } else { + for _, userID := range okUserIDList { + if err := rocksCache.DelJoinedSuperGroupIDListFromCache(userID); err != nil { + log.NewWarn(req.OperationID, utils.GetSelfFuncName(), userID, err.Error()) + } + } go func() { for _, v := range okUserIDList { chat.SuperGroupNotification(req.OperationID, v, v) @@ -426,7 +432,6 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite log.NewError(req.OperationID, "AddUserToSuperGroup failed ", req.GroupID, err) return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil } - } etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) @@ -449,19 +454,23 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - for _, userID := range okUserIDList { - err = rocksCache.DelJoinedGroupIDListFromCache(userID) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), userID) - } - } - if groupInfo.GroupType != constant.SuperGroup { + for _, userID := range okUserIDList { + err = rocksCache.DelJoinedGroupIDListFromCache(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), userID) + } + } if err := rocksCache.DelAllGroupMembersInfoFromCache(req.GroupID); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) } chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) } else { + for _, v := range req.InvitedUserIDList { + if err := rocksCache.DelJoinedSuperGroupIDListFromCache(v); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + } go func() { for _, v := range req.InvitedUserIDList { chat.SuperGroupNotification(req.OperationID, v, v) @@ -492,18 +501,9 @@ func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGro resp.ErrMsg = constant.ErrDB.ErrMsg return &resp, nil } - //memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) - //if err != nil { - // log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) - // resp.ErrCode = constant.ErrDB.ErrCode - // resp.ErrMsg = constant.ErrDB.ErrMsg - // return &resp, nil - //} for _, v := range memberList { var node open_im_sdk.GroupMemberFullInfo cp.GroupMemberDBCopyOpenIM(&node, v) - //log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) - //log.Debug(req.OperationID, "cp value: ", node) resp.MemberList = append(resp.MemberList, &node) } } @@ -681,22 +681,24 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - for _, userID := range okUserIDList { - err = rocksCache.DelJoinedGroupIDListFromCache(userID) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), userID) - } - } - if err = rocksCache.DelAllGroupMembersInfoFromCache(req.GroupID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) - } - if groupInfo.GroupType != constant.SuperGroup { + for _, userID := range okUserIDList { + err = rocksCache.DelJoinedGroupIDListFromCache(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), userID) + } + } if err := rocksCache.DelAllGroupMembersInfoFromCache(req.GroupID); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) } chat.MemberKickedNotification(req, okUserIDList) } else { + for _, userID := range okUserIDList { + err = rocksCache.DelJoinedSuperGroupIDListFromCache(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), userID) + } + } go func() { for _, v := range req.KickedUserIDList { chat.SuperGroupNotification(req.OperationID, v, v) @@ -711,24 +713,8 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetGroupMembersInfoReq) (*pbGroup.GetGroupMembersInfoResp, error) { log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) - var resp pbGroup.GetGroupMembersInfoResp resp.MemberList = []*open_im_sdk.GroupMemberFullInfo{} - - //for _, v := range req.MemberList { - // var memberNode open_im_sdk.GroupMemberFullInfo - // memberInfo, err := imdb.GetMemberInfoByID(req.GroupID, v) - // memberNode.UserID = v - // if err != nil { - // log.NewError(req.OperationID, "GetMemberInfoById failed ", err.Error(), req.GroupID, v) - // continue - // } else { - // utils.CopyStructFields(&memberNode, memberInfo) - // memberNode.JoinTime = int32(memberInfo.JoinTime.Unix()) - // resp.MemberList = append(resp.MemberList, &memberNode) - // } - //} - groupMembers, err := rocksCache.GetAllGroupMembersInfoFromCache(req.GroupID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, err.Error()) @@ -791,7 +777,6 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) groupsInfoList := make([]*open_im_sdk.GroupInfo, 0) for _, groupID := range req.GroupIDList { - //groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID) groupInfoFromRedis, err := rocksCache.GetGroupInfoFromCache(groupID) if err != nil { log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID) @@ -1021,7 +1006,6 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - // //_, err = imdb.GetGroupMemberListByGroupIDAndRoleLevel(req.GroupID, constant.GroupOwner) //if err != nil { // log.NewError(req.OperationID, "GetGroupMemberListByGroupIDAndRoleLevel failed ", err.Error(), req.GroupID, constant.GroupOwner) @@ -1110,17 +1094,19 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) } if groupInfo.GroupType != constant.SuperGroup { + if err := rocksCache.DelAllGroupMembersInfoFromCache(req.GroupID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) + } + if err := rocksCache.DelJoinedGroupIDListFromCache(req.OpUserID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.OpUserID) + } chat.MemberQuitNotification(req) } else { + if err := rocksCache.DelJoinedSuperGroupIDListFromCache(req.OpUserID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.OpUserID) + } chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.OpUserID) } - if err := rocksCache.DelAllGroupMembersInfoFromCache(req.GroupID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) - } - if err := rocksCache.DelJoinedGroupIDListFromCache(req.OpUserID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.OpUserID) - } - log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}) return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } diff --git a/internal/rpc/group/super_group.go b/internal/rpc/group/super_group.go index 09e924db9..d08a38742 100644 --- a/internal/rpc/group/super_group.go +++ b/internal/rpc/group/super_group.go @@ -2,47 +2,42 @@ package group import ( "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + rocksCache "Open_IM/pkg/common/db/rocks_cache" "Open_IM/pkg/common/log" cp "Open_IM/pkg/common/utils" pbGroup "Open_IM/pkg/proto/group" commonPb "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" - "go.mongodb.org/mongo-driver/mongo" ) func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp := &pbGroup.GetJoinedSuperGroupListResp{CommonResp: &pbGroup.CommonResp{}} - userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) - if err == mongo.ErrNoDocuments { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID) - return resp, nil - } + //userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) + groupIDList, err := rocksCache.GetJoinedSuperGroupListFromCache(req.UserID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID) resp.CommonResp.ErrCode = constant.ErrDB.ErrCode resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg return resp, nil } - for _, groupID := range userToSuperGroup.GroupIDList { - groupInfoDB, err := imdb.GetGroupInfoByGroupID(groupID) + for _, groupID := range groupIDList { + groupInfoFromCache, err := rocksCache.GetGroupInfoFromCache(groupID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupInfoByGroupID failed", groupID, err.Error()) continue } groupInfo := &commonPb.GroupInfo{} - if err := utils.CopyStructFields(groupInfo, groupInfoDB); err != nil { + if err := utils.CopyStructFields(groupInfo, groupInfoFromCache); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) } - group, err := db.DB.GetSuperGroup(groupID) + groupMemberIDList, err := rocksCache.GetGroupMemberIDListFromCache(groupID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroup failed", groupID, err.Error()) continue } - groupInfo.MemberCount = uint32(len(group.MemberIDList)) + groupInfo.MemberCount = uint32(len(groupMemberIDList)) resp.GroupList = append(resp.GroupList, groupInfo) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) @@ -54,13 +49,13 @@ func (s *groupServer) GetSuperGroupsInfo(_ context.Context, req *pbGroup.GetSupe resp = &pbGroup.GetSuperGroupsInfoResp{CommonResp: &pbGroup.CommonResp{}} groupsInfoList := make([]*commonPb.GroupInfo, 0) for _, groupID := range req.GroupIDList { - groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID) + groupInfoFromRedis, err := rocksCache.GetGroupInfoFromCache(groupID) if err != nil { log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID) continue } var groupInfo commonPb.GroupInfo - cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromRedis) groupsInfoList = append(groupsInfoList, &groupInfo) } resp.GroupInfoList = groupsInfoList diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 2892be4ab..e1fa4b0de 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -74,7 +74,7 @@ func messageVerification(data *pbChat.SendMsgReq) (bool, int32, string, []string if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) { return true, 0, "", nil } - if data.MsgData.ContentType <= constant.FriendApplicationNotification && data.MsgData.ContentType >= constant.FriendApplicationApprovedNotification { + if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin { return true, 0, "", nil } log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) diff --git a/pkg/base_info/third_api_struct.go b/pkg/base_info/third_api_struct.go index 72924e873..8785ecd37 100644 --- a/pkg/base_info/third_api_struct.go +++ b/pkg/base_info/third_api_struct.go @@ -12,6 +12,7 @@ type MiniostorageCredentialResp struct { SessionToken string `json:"sessionToken"` BucketName string `json:"bucketName"` StsEndpointURL string `json:"stsEndpointURL"` + StorageTime int `json:"storageTime"` } type MinioUploadFileReq struct { diff --git a/pkg/call_back_struct/common.go b/pkg/call_back_struct/common.go index d40315d7f..acbfced6d 100644 --- a/pkg/call_back_struct/common.go +++ b/pkg/call_back_struct/common.go @@ -25,10 +25,19 @@ type CommonCallbackResp struct { OperationID string `json:"operationID"` } -type UserStatusCallbackReq struct { +type UserStatusBaseCallback struct { CallbackCommand string `json:"callbackCommand"` OperationID string `json:"operationID"` - UserID string `json:"userID"` PlatformID int32 `json:"platformID"` Platform string `json:"platform"` } + +type UserStatusCallbackReq struct { + UserStatusBaseCallback + UserID string `json:"userID"` +} + +type UserStatusBatchCallbackReq struct { + UserStatusBaseCallback + UserIDList []string `json:"userIDList"` +} diff --git a/pkg/call_back_struct/push.go b/pkg/call_back_struct/push.go index 1f6d1c2a4..e0b46bd0c 100644 --- a/pkg/call_back_struct/push.go +++ b/pkg/call_back_struct/push.go @@ -2,18 +2,33 @@ package call_back_struct import commonPb "Open_IM/pkg/proto/sdk_ws" -type CallbackOfflinePushReq struct { - UserStatusCallbackReq +type CallbackBeforePushReq struct { + UserStatusBatchCallbackReq *commonPb.OfflinePushInfo - //CommonCallbackReq SendID string `json:"sendID"` GroupID string `json:"groupID"` ContentType int32 `json:"contentType"` SessionType int32 `json:"sessionType"` AtUserIDList []string `json:"atUserIDList"` - Content string `json` + Content string `json:"content"` } -type CallbackOfflinePushResp struct { +type CallbackBeforePushResp struct { *CommonCallbackResp } + +type CallbackBeforeSuperGroupOnlinePushReq struct { + *commonPb.OfflinePushInfo + UserStatusBaseCallback + SendID string `json:"sendID"` + GroupID string `json:"groupID"` + ContentType int32 `json:"contentType"` + SessionType int32 `json:"sessionType"` + AtUserIDList []string `json:"atUserIDList"` + Content string `json:"content"` +} + +type CallbackBeforeSuperGroupOnlinePushResp struct { + *CommonCallbackResp + UserIDList []string `json:"userIDList"` +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 87c7921cc..6c0e1a499 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -71,6 +71,7 @@ type config struct { SecretAccessKey string `yaml:"secretAccessKey"` EndpointInner string `yaml:"endpointInner"` EndpointInnerEnable bool `yaml:"endpointInnerEnable"` + StorageTime int `yaml:"storageTime"` } `yaml:"minio"` } @@ -253,15 +254,17 @@ type config struct { } Callback struct { - CallbackUrl string `yaml:"callbackUrl"` - CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackBeforeSendSingleMsg"` - CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"` - CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"` - CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"` - CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"` - CallbackUserOnline callBackConfig `yaml:"callbackUserOnline"` - CallbackUserOffline callBackConfig `yaml:"callbackUserOffline"` - CallbackOfflinePush callBackConfig `yaml:"callbackOfflinePush"` + CallbackUrl string `yaml:"callbackUrl"` + CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackBeforeSendSingleMsg"` + CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"` + CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"` + CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"` + CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"` + CallbackUserOnline callBackConfig `yaml:"callbackUserOnline"` + CallbackUserOffline callBackConfig `yaml:"callbackUserOffline"` + CallbackOfflinePush callBackConfig `yaml:"callbackOfflinePush"` + CallbackOnlinePush callBackConfig `yaml:"callbackOnlinePush"` + CallbackBeforeSuperGroupOnlinePush callBackConfig `yaml:"callbackSuperGroupOnlinePush"` } `yaml:"callback"` Notification struct { ///////////////////////group///////////////////////////// diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 3edcd0f21..f7c8a7650 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -192,14 +192,16 @@ const ( VerificationCodeForResetSuffix = "_forReset" //callbackCommand - CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand" - CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand" - CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" - CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand" - CallbackWordFilterCommand = "callbackWordFilterCommand" - CallbackUserOnlineCommand = "callbackUserOnlineCommand" - CallbackUserOfflineCommand = "callbackUserOfflineCommand" - CallbackOfflinePushCommand = "callbackOfflinePushCommand" + CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand" + CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand" + CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" + CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand" + CallbackWordFilterCommand = "callbackWordFilterCommand" + CallbackUserOnlineCommand = "callbackUserOnlineCommand" + CallbackUserOfflineCommand = "callbackUserOfflineCommand" + CallbackOfflinePushCommand = "callbackOfflinePushCommand" + CallbackOnlinePushCommand = "callbackOnlinePushCommand" + CallbackSuperGroupOnlinePushCommand = "callbackSuperGroupOnlinePushCommand" //callback actionCode ActionAllow = 0 ActionForbidden = 1 diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 9041b8d89..0fd699018 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -147,21 +147,11 @@ func init() { } } // 强一致性缓存,当一个key被标记删除,其他请求线程会被锁住轮询直到新的key生成,适合各种同步的拉取, 如果弱一致可能导致拉取还是老数据,毫无意义 - DB.Rc = rockscache.NewClient(go_redis.NewClient(&go_redis.Options{ - Addr: config.Config.Redis.DBAddress[0], - Password: config.Config.Redis.DBPassWord, // no password set - DB: 0, // use default DB - PoolSize: 100, // 连接池大小 - }), rockscache.NewDefaultOptions()) + DB.Rc = rockscache.NewClient(DB.RDB, rockscache.NewDefaultOptions()) DB.Rc.Options.StrongConsistency = true // 弱一致性缓存,当一个key被标记删除,其他请求线程直接返回该key的value,适合高频并且生成很缓存很慢的情况 如大群发消息缓存的缓存 - DB.WeakRc = rockscache.NewClient(go_redis.NewClient(&go_redis.Options{ - Addr: config.Config.Redis.DBAddress[0], - Password: config.Config.Redis.DBPassWord, // no password set - DB: 0, // use default DB - PoolSize: 100, // 连接池大小 - }), rockscache.NewDefaultOptions()) + DB.WeakRc = rockscache.NewClient(DB.RDB, rockscache.NewDefaultOptions()) DB.WeakRc.Options.StrongConsistency = false } diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 2df5125ef..d3e9d50c5 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -908,8 +908,8 @@ func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, page result, err := c.Find(ctx, bson.D{ // 等价条件: select * from {"user_id", userID}, {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{userID}}}}}, - bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{userID}}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{opUserID}}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{opUserID}}}}}, bson.D{{"permission", constant.WorkMomentPublic}}, }}, }, findOpts) @@ -970,7 +970,7 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, } _, err = c.InsertOne(sCtx, superGroup) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } var users []UserToSuperGroup @@ -992,7 +992,7 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, for _, userID := range initMemberIDList { _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } @@ -1022,7 +1022,7 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err } _, err = c.UpdateOne(sCtx, bson.M{"group_id": groupID}, bson.M{"$addToSet": bson.M{"member_id_list": bson.M{"$each": userIDList}}}) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) @@ -1039,11 +1039,11 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err for _, userID := range userIDList { _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } } - session.CommitTransaction(ctx) + _ := session.CommitTransaction(ctx) return err } @@ -1058,15 +1058,15 @@ func (d *DataBases) RemoverUserFromSuperGroup(groupID string, userIDList []strin sCtx := mongo.NewSessionContext(ctx, session) _, err = c.UpdateOne(ctx, bson.M{"group_id": groupID}, bson.M{"$pull": bson.M{"member_id_list": bson.M{"$in": userIDList}}}) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } err = d.RemoveGroupFromUser(ctx, sCtx, groupID, userIDList) if err != nil { - session.AbortTransaction(ctx) + _ := session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } - session.CommitTransaction(ctx) + _ := session.CommitTransaction(ctx) return err } diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index 3fe11f509..86ce3dea6 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -1,6 +1,7 @@ package rocksCache import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" @@ -12,18 +13,19 @@ import ( ) const ( - userInfoCache = "USER_INFO_CACHE:" - friendRelationCache = "FRIEND_RELATION_CACHE:" - blackListCache = "BLACK_LIST_CACHE:" - groupCache = "GROUP_CACHE:" - groupInfoCache = "GROUP_INFO_CACHE:" - groupOwnerIDCache = "GROUP_OWNER_ID:" - joinedGroupListCache = "JOINED_GROUP_LIST_CACHE:" - groupMemberInfoCache = "GROUP_MEMBER_INFO_CACHE:" - groupAllMemberInfoCache = "GROUP_ALL_MEMBER_INFO_CACHE:" - allFriendInfoCache = "ALL_FRIEND_INFO_CACHE:" - allDepartmentCache = "ALL_DEPARTMENT_CACHE:" - allDepartmentMemberCache = "ALL_DEPARTMENT_MEMBER_CACHE:" + userInfoCache = "USER_INFO_CACHE:" + friendRelationCache = "FRIEND_RELATION_CACHE:" + blackListCache = "BLACK_LIST_CACHE:" + groupCache = "GROUP_CACHE:" + groupInfoCache = "GROUP_INFO_CACHE:" + groupOwnerIDCache = "GROUP_OWNER_ID:" + joinedGroupListCache = "JOINED_GROUP_LIST_CACHE:" + groupMemberInfoCache = "GROUP_MEMBER_INFO_CACHE:" + groupAllMemberInfoCache = "GROUP_ALL_MEMBER_INFO_CACHE:" + allFriendInfoCache = "ALL_FRIEND_INFO_CACHE:" + allDepartmentCache = "ALL_DEPARTMENT_CACHE:" + allDepartmentMemberCache = "ALL_DEPARTMENT_MEMBER_CACHE:" + joinedSuperGroupListCache = "JOINED_SUPER_GROUP_LIST_CACHE:" ) func init() { @@ -41,13 +43,7 @@ func init() { panic(err.Error()) } n += len(keys) - //fmt.Printf("\n %s key found %d keys: %v, current cursor %d\n", key, n, keys, cursor) - //if len(keys) > 0 { - // err = db.DB.RDB.Del(context.Background(), keys...).Err() - // if err != nil { - // panic(err.Error()) - // } - //} + // for each for redis cluster for _, key := range keys { if err = db.DB.RDB.Del(context.Background(), key).Err(); err != nil { log.NewError("", fName, key, err.Error()) @@ -132,15 +128,28 @@ func DelJoinedGroupIDListFromCache(userID string) error { } func GetGroupMemberIDListFromCache(groupID string) ([]string, error) { - getGroupMemberIDList := func() (string, error) { - groupMemberIDList, err := imdb.GetGroupMemberIDListByGroupID(groupID) + f := func() (string, error) { + groupInfo, err := GetGroupInfoFromCache(groupID) if err != nil { - return "", utils.Wrap(err, "") + return "", utils.Wrap(err, "GetGroupInfoFromCache failed") + } + var groupMemberIDList []string + if groupInfo.GroupType == constant.SuperGroup { + superGroup, err := db.DB.GetSuperGroup(groupID) + if err != nil { + return "", utils.Wrap(err, "") + } + groupMemberIDList = superGroup.MemberIDList + } else { + groupMemberIDList, err = imdb.GetGroupMemberIDListByGroupID(groupID) + if err != nil { + return "", utils.Wrap(err, "") + } } bytes, err := json.Marshal(groupMemberIDList) return string(bytes), utils.Wrap(err, "") } - groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, getGroupMemberIDList) + groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f) if err != nil { return nil, utils.Wrap(err, "") } @@ -149,8 +158,8 @@ func GetGroupMemberIDListFromCache(groupID string) ([]string, error) { return groupMemberIDList, utils.Wrap(err, "") } -func DelGroupMemberIDListFromCache(userID string) error { - err := db.DB.Rc.TagAsDeleted(groupCache + userID) +func DelGroupMemberIDListFromCache(groupID string) error { + err := db.DB.Rc.TagAsDeleted(groupCache + groupID) return err } @@ -307,3 +316,31 @@ func GetAllDepartmentMembersFromCache() ([]db.DepartmentMember, error) { func DelAllDepartmentMembersFromCache() error { return db.DB.Rc.TagAsDeleted(allDepartmentMemberCache) } + +func GetJoinedSuperGroupListFromCache(userID string) ([]string, error) { + getJoinedSuperGroupIDList := func() (string, error) { + userToSuperGroup, err := db.DB.GetSuperGroupByUserID(userID) + if err != nil { + return "", utils.Wrap(err, "") + } + bytes, err := json.Marshal(userToSuperGroup.GroupIDList) + return string(bytes), utils.Wrap(err, "") + } + joinedSuperGroupListStr, err := db.DB.Rc.Fetch(joinedSuperGroupListCache+userID, time.Second, getJoinedSuperGroupIDList) + var joinedSuperGroupList []string + err = json.Unmarshal([]byte(joinedSuperGroupListStr), &joinedSuperGroupList) + return joinedSuperGroupList, err +} + +func DelJoinedSuperGroupIDListFromCache(userID string) error { + err := db.DB.Rc.TagAsDeleted(joinedSuperGroupListCache + userID) + return err +} + +func GetSuperGroupMemberIDListFromCache(groupID string) ([]string, error) { + return GetGroupMemberIDListFromCache(groupID) +} + +func DelSuperGroupMemberIDListFromCache(groupID string) error { + return DelGroupMemberIDListFromCache(groupID) +} From 766d9c2641254f4f5c31bdef09cfd997b46321d7 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 14:43:59 +0800 Subject: [PATCH 28/53] fcm json file update --- config/config.yaml | 6 +++--- ...nim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json diff --git a/config/config.yaml b/config/config.yaml index b638b8c5f..f183ca1d6 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -210,7 +210,7 @@ push: masterSecret: 02204efe3f3832947a236ee5 pushUrl: "https://api.jpush.cn/v3/push" pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" - enable: true + enable: false getui: #个推推送 pushUrl: "https://restapi.getui.com/v2/$appId" masterSecret: "" @@ -218,8 +218,8 @@ push: intent: "" enable: false fcm: #firebase cloud message 消息推送 - serviceAccount: "openim-*-firebase-adminsdk-*-*.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 - enable: false + serviceAccount: "openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 + enable: true diff --git a/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json b/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json new file mode 100644 index 000000000..5541c4dd5 --- /dev/null +++ b/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "openim-47ece", + "private_key_id": "ad09c38418bb1677da2b24db60732357c6955b0a", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChRq9vR9ONP8Mn\nmP0JRrgVPYvESc0GfonLP/Zy81tbtKKQesbJdhTkAmQ5UIYY9gxjDKnrFg8KLNpv\n4JkZ72Y8EIMLkaGsPhpO3tranjhCkMI4g+4ak/+KNUv6pvzb3Evu7s7NTEvXP+8e\n0LLr0Qx8HevTzm0ZFv7s1HVJzHU2jRgqxJUbUUEFZFGS6HhoOhGu/2FNDFT5yifz\nrFciLFgLtxgVEJykC7mKOilBUahoGLy9ALDNcgq8D9bE8u1gUCLBl+Cho7BvDtpW\nlrZbJ0C8bO2OF1XrKs+84UEkUnTydrJVEj52BhtGNp1g7UsJ1uy2hnaHtWUZZTT/\nsszUJEqdAgMBAAECggEAHZVni4BvtkaWwB4AdpHmJSFN0OMfzJvsH2A7j0EERml3\nc4zOB7kVInEs3NWgT5Zc1dOGHNVGS33IUQLwWrFPPd/ihf4AG+YlccfP+g/RbqZ6\nth6/T9lLpBjcN92nXxZFSI4+Warv84trC+pJE9hcU60ya/8/BH3zI9LiM/ghHTEQ\njHTl2Und6yLkzX32KljdRjXyPLOr1ZbHdd1uHL6TH8oVc1LUDLRCHlnG8kZjF34N\nSesd8TEPEHAftGZzvh9DeSsl6CkCARvp1BfR18MaFh5HJtUWMnbHVRJe1l6QSU6D\n2r5v3T+mrzx5eQKSL73U/b+Gm3lKi2m0ib7IXVvhIQKBgQDMhYxIyYrBNV+HV7bK\nfN9wW6so6+eyMLAZMIQgbQgMGK+xOAoGliN4O3W3OqQWkApeaDS/cJIyS46tM7mb\nlOvdXbGcdbcdsLBOvDPI4Z7vlZ4AnlRKvyPylUkIl42SXoCUA6cXl3VaR7BSxkvL\nw916jqLLmQZjwjO2I8oYTng0IQKBgQDJ3pbNkFnHp9bsIod03/ST8K6G6Ur/YVMl\n1mIb9+Q34caXbDSiJifH9RIiCAMxf52z44guPOUfAUXWZ87AlYgmkUq9E5dkCVV4\nQxHNJyTyxiISBjpjrVmq4Crxja55cB8LIZxqNyKfzwzGHSPZRNWxQtUGe9ff8NcW\n+/5LsiAG/QKBgQCIz81H44ouNMXyg3qDeYT+ZFPay/Px/x/NueaoykbX0Ku2oQYT\n4dtYUm4sY83gSfqlrI+cgHFLs799nVxL9xLQwhxNzXDxK4DFKqB5gHQRUMShJUi9\nt58UZ0iztq29e/oHCWp9HZQjEFGjDYMmi59cnI3KJFNh6EcvUEGggN1oAQKBgQCI\nGnUeX4bIoBa92oHtgNmLrSheeYhBKsM+rY40QSwzqRuWGDRcZtFHdaomG7TbeKlB\nEdVNJ21rPBZz+kVhfu/u4OK9HCpkHg7sKHwmD5BPxtpNwLk5XzUnikAp4FaUNc4Y\nWS72RfooORbps9fpswlInEC4QGNJ7z11l6zaKFyDmQKBgAKiF3TODw+/cBVOC4rf\nMuOcMoqIloHHEoNz0k/qVGAsRT9bHjVmywwL5lmmJYrSJiwVWYTmsLFkWQKu7zYl\nABlRtGJp38Pgncrsk6cirk8AEQFy1+C9RUyYruAEdkILE+YnwcIkIOJsyUBpjxic\ncxtx/1/35RKjTBfLV8w5Fq9l\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-cj2bl@openim-47ece.iam.gserviceaccount.com", + "client_id": "102073195295372303631", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-cj2bl%40openim-47ece.iam.gserviceaccount.com" +} From 783a982ca8bdb0df02c3d61abbe05d1f5e96f8fe Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 15:01:06 +0800 Subject: [PATCH 29/53] remove _: --- pkg/common/db/mongoModel.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index d3e9d50c5..9ddcd0085 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -970,7 +970,7 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, } _, err = c.InsertOne(sCtx, superGroup) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } var users []UserToSuperGroup @@ -992,7 +992,7 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, for _, userID := range initMemberIDList { _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } @@ -1022,7 +1022,7 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err } _, err = c.UpdateOne(sCtx, bson.M{"group_id": groupID}, bson.M{"$addToSet": bson.M{"member_id_list": bson.M{"$each": userIDList}}}) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) @@ -1039,11 +1039,11 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err for _, userID := range userIDList { _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } } - _ := session.CommitTransaction(ctx) + _ = session.CommitTransaction(ctx) return err } @@ -1058,15 +1058,15 @@ func (d *DataBases) RemoverUserFromSuperGroup(groupID string, userIDList []strin sCtx := mongo.NewSessionContext(ctx, session) _, err = c.UpdateOne(ctx, bson.M{"group_id": groupID}, bson.M{"$pull": bson.M{"member_id_list": bson.M{"$in": userIDList}}}) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } err = d.RemoveGroupFromUser(ctx, sCtx, groupID, userIDList) if err != nil { - _ := session.AbortTransaction(ctx) + _ = session.AbortTransaction(ctx) return utils.Wrap(err, "transaction failed") } - _ := session.CommitTransaction(ctx) + _ = session.CommitTransaction(ctx) return err } From 73c5dc159b8f54f5530b399121c0b704b031a444 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 15:09:00 +0800 Subject: [PATCH 30/53] mongodb superGroup --- internal/msg_gateway/gate/callback.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index 02b771a97..24750d705 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -17,11 +17,13 @@ func callbackUserOnline(operationID, userID string, platformID int, token string callbackUserOnlineReq := cbApi.CallbackUserOnlineReq{ Token: token, UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ - CallbackCommand: constant.CallbackUserOnlineCommand, - OperationID: operationID, - UserID: userID, - PlatformID: int32(platformID), - Platform: constant.PlatformIDToName(platformID), + UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ + CallbackCommand: constant.CallbackUserOnlineCommand, + OperationID: operationID, + PlatformID: int32(platformID), + Platform: constant.PlatformIDToName(platformID), + }, + UserID: userID, }, Seq: int(time.Now().UnixNano() / 1e6), } @@ -40,11 +42,13 @@ func callbackUserOffline(operationID, userID string, platformID int) cbApi.Commo } callbackOfflineReq := cbApi.CallbackUserOfflineReq{ UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ - CallbackCommand: constant.CallbackUserOfflineCommand, - OperationID: operationID, - UserID: userID, - PlatformID: int32(platformID), - Platform: constant.PlatformIDToName(platformID), + UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ + CallbackCommand: constant.CallbackUserOnlineCommand, + OperationID: operationID, + PlatformID: int32(platformID), + Platform: constant.PlatformIDToName(platformID), + }, + UserID: userID, }, Seq: int(time.Now().UnixNano() / 1e6), } From 64bfff569089b131cd999f4d50975e746cfaaa5f Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 15:23:09 +0800 Subject: [PATCH 31/53] remove _: --- config/config.yaml | 2 +- ...nim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json | 12 ------------ ...nim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json | 12 ++++++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json create mode 100644 config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json diff --git a/config/config.yaml b/config/config.yaml index d1290e8d1..19ea87728 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -219,7 +219,7 @@ push: intent: "" enable: false fcm: #firebase cloud message 消息推送 - serviceAccount: "openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 + serviceAccount: "openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 enable: true diff --git a/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json b/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json deleted file mode 100644 index 5541c4dd5..000000000 --- a/config/openim-47ece-firebase-adminsdk-cj2bl-ad09c38418.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "openim-47ece", - "private_key_id": "ad09c38418bb1677da2b24db60732357c6955b0a", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChRq9vR9ONP8Mn\nmP0JRrgVPYvESc0GfonLP/Zy81tbtKKQesbJdhTkAmQ5UIYY9gxjDKnrFg8KLNpv\n4JkZ72Y8EIMLkaGsPhpO3tranjhCkMI4g+4ak/+KNUv6pvzb3Evu7s7NTEvXP+8e\n0LLr0Qx8HevTzm0ZFv7s1HVJzHU2jRgqxJUbUUEFZFGS6HhoOhGu/2FNDFT5yifz\nrFciLFgLtxgVEJykC7mKOilBUahoGLy9ALDNcgq8D9bE8u1gUCLBl+Cho7BvDtpW\nlrZbJ0C8bO2OF1XrKs+84UEkUnTydrJVEj52BhtGNp1g7UsJ1uy2hnaHtWUZZTT/\nsszUJEqdAgMBAAECggEAHZVni4BvtkaWwB4AdpHmJSFN0OMfzJvsH2A7j0EERml3\nc4zOB7kVInEs3NWgT5Zc1dOGHNVGS33IUQLwWrFPPd/ihf4AG+YlccfP+g/RbqZ6\nth6/T9lLpBjcN92nXxZFSI4+Warv84trC+pJE9hcU60ya/8/BH3zI9LiM/ghHTEQ\njHTl2Und6yLkzX32KljdRjXyPLOr1ZbHdd1uHL6TH8oVc1LUDLRCHlnG8kZjF34N\nSesd8TEPEHAftGZzvh9DeSsl6CkCARvp1BfR18MaFh5HJtUWMnbHVRJe1l6QSU6D\n2r5v3T+mrzx5eQKSL73U/b+Gm3lKi2m0ib7IXVvhIQKBgQDMhYxIyYrBNV+HV7bK\nfN9wW6so6+eyMLAZMIQgbQgMGK+xOAoGliN4O3W3OqQWkApeaDS/cJIyS46tM7mb\nlOvdXbGcdbcdsLBOvDPI4Z7vlZ4AnlRKvyPylUkIl42SXoCUA6cXl3VaR7BSxkvL\nw916jqLLmQZjwjO2I8oYTng0IQKBgQDJ3pbNkFnHp9bsIod03/ST8K6G6Ur/YVMl\n1mIb9+Q34caXbDSiJifH9RIiCAMxf52z44guPOUfAUXWZ87AlYgmkUq9E5dkCVV4\nQxHNJyTyxiISBjpjrVmq4Crxja55cB8LIZxqNyKfzwzGHSPZRNWxQtUGe9ff8NcW\n+/5LsiAG/QKBgQCIz81H44ouNMXyg3qDeYT+ZFPay/Px/x/NueaoykbX0Ku2oQYT\n4dtYUm4sY83gSfqlrI+cgHFLs799nVxL9xLQwhxNzXDxK4DFKqB5gHQRUMShJUi9\nt58UZ0iztq29e/oHCWp9HZQjEFGjDYMmi59cnI3KJFNh6EcvUEGggN1oAQKBgQCI\nGnUeX4bIoBa92oHtgNmLrSheeYhBKsM+rY40QSwzqRuWGDRcZtFHdaomG7TbeKlB\nEdVNJ21rPBZz+kVhfu/u4OK9HCpkHg7sKHwmD5BPxtpNwLk5XzUnikAp4FaUNc4Y\nWS72RfooORbps9fpswlInEC4QGNJ7z11l6zaKFyDmQKBgAKiF3TODw+/cBVOC4rf\nMuOcMoqIloHHEoNz0k/qVGAsRT9bHjVmywwL5lmmJYrSJiwVWYTmsLFkWQKu7zYl\nABlRtGJp38Pgncrsk6cirk8AEQFy1+C9RUyYruAEdkILE+YnwcIkIOJsyUBpjxic\ncxtx/1/35RKjTBfLV8w5Fq9l\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-cj2bl@openim-47ece.iam.gserviceaccount.com", - "client_id": "102073195295372303631", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-cj2bl%40openim-47ece.iam.gserviceaccount.com" -} diff --git a/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json b/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json new file mode 100644 index 000000000..e6870bbc1 --- /dev/null +++ b/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "openim-5c6c0", + "private_key_id": "8765884a7875fd3c0a73bbc1718bdaeca39fd609", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC90b1YDn14JsY8\nu5a0RIx7yAWmsn8JuoceVPvFzAv45iuU3MfsD51TKY+gjmydFAMpUuEQKYF2hXie\nJt5+EaBf/RWch2zmHK+husQVJpRvKmTNPjT/fT2FqneozriQZ7QedRiKhkv2lb9A\n3QFO3kmeAI7W4DR+22wadNKBX/REv+nZECz6uaPZ9cRvUYb8GCYkcteau62P0z4E\n3sOHe52Pix0OV06vI47PTNmbhZOozF0wdVfxOe5eE5kQ8VZq2oQ+6SHZwNhl+7py\nHAN8Cgq4JXGrjNdafku9UNuLpYLv3a7DejNe1R5tkITE2P01Us43T7HRuZ8W8mV0\nCl9DU+HfAgMBAAECggEAVxu4M3+6znekw1wmpaVLfsZk6YHCULmbpizDuZqQ5/Dg\nkRjcWhU0UmShN8IET/VOGhmhlOQnODe6CYG22s3F9ibTUxjGvbbuVl65+ybQOU+Q\nIKvqcFCN+hgnf30WL5aXjt6Xm4JTu94ufVqubf4OdIa3Bh6vmIOjUWTI8XwSQbWx\n8llfOL4ElMdmtxg0N5iDmkSXfTgZWfty861s76bqazD1cQhMOYPXPnGP78DKyOjH\nN6XchHDXm5I0eEIa+jACW0p6DMArdwREhVgfQotxzRfExXLUR5XxJnMNuA1IwnWF\nJRAg9cEUeIQoJY/kDuNQlxsS2Manb+3exNk52BlFAQKBgQDjo+tENZ3Ozt/JPtev\nOHolhkGCJNWMJPV6SVuBta1/u0/T8HKxkXdNOrooM+dsK5xk+V6Dp8wwrQiUSy/f\n6RVXUcTKTahlTNhwrxmRisJbeyEoX8tJGDVjwJba4sKdkfsWeh4IduyvwQnRCNn8\nmx9Pfp5EyCnWkpyJLvM7OykqXwKBgQDVd5qD88UOvV73xZUPzPlnNQHzBS+TgPlI\n3CLesi8i5I3zBHYS8ynCi0eNyaLqmtatVL6XhnUAWI/U9NKNmP3AH2pigBVIAjM8\nMmSO8iaYYQA3/TOlIsNE6yFjd3t54yFkQ7J6yLPRQWWKwE+3hQ3VZ5WmyM5jOh/s\nD+g5lOd4gQKBgQCH4qSg7eSKvCEID5ROi0cWuULHfldfNfy3B60xC5NK6TRozmKY\nrr3pgwH216zwfEP6XoVVz8dq0w+I/izQ22Ea47u2C49XEP0unseDgrIsS57qa+x8\ncJAGQMOMW8pSpv6cVz8wTFVTQMcsWb1ONgcFvA6b/mRDKvd4SGd3VwRmvwKBgD48\nP5VG5eXVOjHcrgfMR85aOvZCRcuoZ4VhgN0ScAGpRuVaIJ6HvF4Ww0bISbJCcGJa\nebKtpcDzEQQSWKyltR1lS1vqYcn7sjpTqtOuL6hvZ2Prczoq92lJcBOSyzIPETYt\nMoTvrNVOTq90QAmORik4qP3WP63YTWRCgv7+tbmBAoGALVYhJB3KDuOfn4gowiBL\neCCsW93VdLBmrR4PIZlaLLNZSUu3hmM+XNhKCLzMHMoTtptHKq5aQusDlefxhioS\nuWuUXqFyZRdjP81lLBMZQmh6j7kPLC/fWZdN5iBlZX2JTANaOQZHDy8KEHMYq6zf\nYzLbTvrNYxxKyb5q6IXrErk=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-ppwol@openim-5c6c0.iam.gserviceaccount.com", + "client_id": "117878683878601533433", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ppwol%40openim-5c6c0.iam.gserviceaccount.com" +} From da540522ac57fd60caf9da288dd471031f525fcc Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 15:28:23 +0800 Subject: [PATCH 32/53] mongodb superGroup --- internal/msg_gateway/gate/callback.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index 24750d705..9df9c6373 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -43,7 +43,7 @@ func callbackUserOffline(operationID, userID string, platformID int) cbApi.Commo callbackOfflineReq := cbApi.CallbackUserOfflineReq{ UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ - CallbackCommand: constant.CallbackUserOnlineCommand, + CallbackCommand: constant.CallbackUserOfflineCommand, OperationID: operationID, PlatformID: int32(platformID), Platform: constant.PlatformIDToName(platformID), From c43290338da5a448e723b1580b4dc37675b0b0f8 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 15:47:09 +0800 Subject: [PATCH 33/53] add test file --- internal/api/third/fcm_update_token.go | 2 +- internal/push/fcm/push.go | 1 + internal/push/fcm/push_test.go | 15 +++++++++++++++ pkg/common/db/redisModel_test.go | 20 ++++++++++++++------ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 internal/push/fcm/push_test.go diff --git a/internal/api/third/fcm_update_token.go b/internal/api/third/fcm_update_token.go index a5a3a9d42..d9c5f03ff 100644 --- a/internal/api/third/fcm_update_token.go +++ b/internal/api/third/fcm_update_token.go @@ -39,7 +39,7 @@ func FcmUpdateToken(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req, UserId) //逻辑处理开始 - err := db.DB.SetFcmToken(UserId, int(req.Platform), req.FcmToken, 0) + err := db.DB.SetFcmToken(UserId, req.Platform, req.FcmToken, 0) if err != nil { errMsg := req.OperationID + " " + "SetFcmToken failed " + err.Error() + " token:" + c.Request.Header.Get("token") log.NewError(req.OperationID, errMsg) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 3f0552d62..ac485a708 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -50,6 +50,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, for _, account := range accounts { IosfcmToken, IosErr := db.DB.GetFcmToken(account, 1) AndroidfcmToken, AndroidErr := db.DB.GetFcmToken(account, 2) + if IosErr == nil { Tokens = append(Tokens, IosfcmToken) } diff --git a/internal/push/fcm/push_test.go b/internal/push/fcm/push_test.go new file mode 100644 index 000000000..caf09d947 --- /dev/null +++ b/internal/push/fcm/push_test.go @@ -0,0 +1,15 @@ +package fcm + +import ( + "Open_IM/internal/push" + "fmt" + "github.com/stretchr/testify/assert" + "testing" +) + +func Test_Push(t *testing.T) { + offlinePusher := NewFcm() + resp, err := offlinePusher.Push([]string{"test_uid"}, "哈哈", "嘿嘿", "12321", push.PushOpts{}) + assert.Nil(t, err) + fmt.Println(resp) +} diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index 66025f6ab..2f14b7fc2 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -35,7 +35,7 @@ func Test_GetKeyTTL(t *testing.T) { ctx := context.Background() key := flag.String("key", "key", "key value") flag.Parse() - ttl, err := DB.rdb.TTL(ctx, *key).Result() + ttl, err := DB.RDB.TTL(ctx, *key).Result() assert.Nil(t, err) fmt.Println(ttl) } @@ -43,7 +43,7 @@ func Test_HGetAll(t *testing.T) { ctx := context.Background() key := flag.String("key", "key", "key value") flag.Parse() - ttl, err := DB.rdb.TTL(ctx, *key).Result() + ttl, err := DB.RDB.TTL(ctx, *key).Result() assert.Nil(t, err) fmt.Println(ttl) } @@ -119,9 +119,17 @@ func Test_GetAccountCode(t *testing.T) { assert.Nil(t, err) fmt.Println(code) } -func Test_GetGroupMemberList(t *testing.T) { - groupID := "3791742301" - list, err := DB.GetGroupMemberIDListFromCache(groupID) +func Test_SetFcmToken(t *testing.T) { + uid := "test_uid" + token := "dfnWBtOjSj-XIZnUvDlegv:APA91bG09XTtiXfpE6U7gUVMOhnKcUkNCv4WHn0UZr2clUi-tS1jEH-HiCEW8GIAhjLIGcfUJ6NIKteC023ZxDH7J0PJ5sTxoup3fHDUPLU7KgQoZS4tPyFqCbZ6bRB7esDPEnD1n_s0" + platformID := 2 + err := DB.SetFcmToken(uid, platformID, token, 0) assert.Nil(t, err) - fmt.Println(list) } + +//func Test_GetGroupMemberList(t *testing.T) { +// groupID := "3791742301" +// list, err := DB.GetGroupMemberIDListFromCache(groupID) +// assert.Nil(t, err) +// fmt.Println(list) +//} From 6a19c8130c69943764b0362f873e8eda65fb0345 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 15:47:19 +0800 Subject: [PATCH 34/53] Adjust error code --- internal/api/auth/auth.go | 4 +- internal/msg_gateway/gate/logic.go | 3 + internal/msg_gateway/gate/relay_rpc_server.go | 7 + internal/msg_gateway/gate/ws_server.go | 78 +++++ pkg/grpc-etcdv3/getcdv3/register.go | 5 + pkg/proto/relay/relay.pb.go | 273 ++++++++++++++---- pkg/proto/relay/relay.proto | 20 +- 7 files changed, 322 insertions(+), 68 deletions(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 733d9206b..60bf1d8a5 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -150,7 +150,7 @@ func ParseToken(c *gin.Context) { if err := c.BindJSON(¶ms); err != nil { errMsg := " BindJSON failed " + err.Error() log.NewError("0", errMsg) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 200, "errMsg": errMsg}) return } @@ -161,7 +161,7 @@ func ParseToken(c *gin.Context) { if !ok { errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(params.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 200, "errMsg": errMsg}) return } diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 88021c929..0d18e0653 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -52,6 +52,9 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { case constant.WSPullMsgBySeqList: log.NewInfo(m.OperationID, "pullMsgBySeqListReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.pullMsgBySeqListReq(conn, &m) + case constant.WsLogoutMsg: + log.NewInfo(m.OperationID, "conn.Close()", m.SendID, m.MsgIncr, m.ReqIdentifier) + conn.Close() default: log.Error(m.OperationID, "ReqIdentifier failed ", m.SendID, m.MsgIncr, m.ReqIdentifier) } diff --git a/internal/msg_gateway/gate/relay_rpc_server.go b/internal/msg_gateway/gate/relay_rpc_server.go index 0f48519c8..cc64285e6 100644 --- a/internal/msg_gateway/gate/relay_rpc_server.go +++ b/internal/msg_gateway/gate/relay_rpc_server.go @@ -28,6 +28,7 @@ type RPCServer struct { etcdAddr []string platformList []int pushTerminal []int + target string } func (r *RPCServer) onInit(rpcPort int) { @@ -66,6 +67,7 @@ func (r *RPCServer) run() { if err != nil { log.Error("", "register push message rpc to etcd err", "", "err", err.Error(), r.etcdSchema, strings.Join(r.etcdAddr, ","), rpcRegisterIP, r.rpcPort, r.rpcRegisterName) } + r.target = getcdv3.GetTarget(r.etcdSchema, rpcRegisterIP, r.rpcPort, r.rpcRegisterName) err = srv.Serve(listener) if err != nil { log.Error("", "push message rpc listening err", "", "err", err.Error()) @@ -301,6 +303,11 @@ func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOffl return &pbRelay.KickUserOfflineResp{}, nil } +func (r *RPCServer) MultiTerminalLoginCheck(ctx context.Context, req *pbRelay.MultiTerminalLoginCheckReq) (*pbRelay.MultiTerminalLoginCheckResp, error) { + ws.MultiTerminalLoginCheckerWithLock(req.UserID, int(req.PlatformID), req.Token, req.OperationID) + return &pbRelay.MultiTerminalLoginCheckResp{}, nil +} + func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm int, RecvID string) (ResultCode int64) { err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 6f51ca993..ff68124a4 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -6,11 +6,15 @@ import ( "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/utils" "bytes" + "context" "encoding/gob" go_redis "github.com/go-redis/redis/v8" "github.com/pkg/errors" + "strings" //"gopkg.in/errgo.v2/errors" "net/http" @@ -113,6 +117,79 @@ func (ws *WServer) SetWriteTimeoutWriteMsg(conn *UserConn, a int, msg []byte, ti conn.SetWriteDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) return conn.WriteMessage(a, msg) } + +func (ws *WServer) MultiTerminalLoginRemoteChecker(userID string, platformID int32, token string, operationID string) { + grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName) + for _, v := range grpcCons { + if v.Target() == rpcSvr.target { + log.Debug(operationID, "Filter out this node ", rpcSvr.target) + continue + } + client := pbRelay.NewRelayClient(v) + req := &pbRelay.MultiTerminalLoginCheckReq{OperationID: operationID, PlatformID: platformID, UserID: userID, Token: token} + log.NewInfo(operationID, "MultiTerminalLoginCheckReq ", client, req.String()) + resp, err := client.MultiTerminalLoginCheck(context.Background(), req) + if err != nil { + log.Error(operationID, "MultiTerminalLoginCheck failed ", err.Error()) + } + if resp.ErrCode != 0 { + log.Error(operationID, "MultiTerminalLoginCheck errCode, errMsg: ", resp.ErrCode, resp.ErrMsg) + } + } +} + +func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int, token string, operationID string) { + rwLock.Lock() + defer rwLock.Unlock() + switch config.Config.MultiLoginPolicy { + case constant.AllLoginButSameTermKick: + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] + if oldConn, ok := oldConnMap[platformID]; ok { + log.NewDebug(operationID, uid, platformID, "kick old conn") + m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) + if err != nil && err != go_redis.Nil { + log.NewError(operationID, "get token from redis err", err.Error(), uid, constant.PlatformIDToName(platformID)) + return + } + if m == nil { + log.NewError(operationID, "get token from redis err", "m is nil", uid, constant.PlatformIDToName(platformID)) + return + } + log.NewDebug(operationID, "get token map is ", m, uid, constant.PlatformIDToName(platformID)) + + for k, _ := range m { + if k != token { + m[k] = constant.KickedToken + } + } + log.NewDebug(operationID, "set token map is ", m, uid, constant.PlatformIDToName(platformID)) + err = db.DB.SetTokenMapByUidPid(uid, platformID, m) + if err != nil { + log.NewError(operationID, "SetTokenMapByUidPid err", err.Error(), uid, platformID, m) + return + } + err = oldConn.Close() + delete(oldConnMap, platformID) + ws.wsUserToConn[uid] = oldConnMap + if len(oldConnMap) == 0 { + delete(ws.wsUserToConn, uid) + } + delete(ws.wsConnToUser, oldConn) + if err != nil { + log.NewError(operationID, "conn close err", err.Error(), uid, platformID) + } + } else { + log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[platformID]) + } + + } else { + log.NewDebug(operationID, "no other conn", ws.wsUserToConn, uid, platformID) + } + case constant.SingleTerminalLogin: + case constant.WebAndOther: + } +} + func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn *UserConn, token string, operationID string) { switch config.Config.MultiLoginPolicy { case constant.AllLoginButSameTermKick: @@ -191,6 +268,7 @@ func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) } + go ws.MultiTerminalLoginRemoteChecker(uid, int32(platformID), token, operationID) ws.MultiTerminalLoginChecker(uid, platformID, conn, token, operationID) if oldConnMap, ok := ws.wsUserToConn[uid]; ok { oldConnMap[platformID] = conn diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go index 4d9e3ee27..d30d3a3a7 100644 --- a/pkg/grpc-etcdv3/getcdv3/register.go +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -37,6 +37,11 @@ func RegisterEtcd4Unique(schema, etcdAddr, myHost string, myPort int, serviceNam return RegisterEtcd(schema, etcdAddr, myHost, myPort, serviceName, ttl) } +func GetTarget(schema, myHost string, myPort int, serviceName string) string { + serviceName = serviceName + ":" + net.JoinHostPort(myHost, strconv.Itoa(myPort)) + return serviceName +} + //etcdAddr separated by commas func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int) error { operationID := utils.OperationIDGenerator() diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index c26e1816f..fe204b02d 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgReq) ProtoMessage() {} func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{0} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{0} } func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) @@ -89,7 +89,7 @@ func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgResp) ProtoMessage() {} func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{1} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{1} } func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) @@ -129,7 +129,7 @@ func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResult func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } func (*SingelMsgToUserResultList) ProtoMessage() {} func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{2} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{2} } func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) @@ -183,7 +183,7 @@ func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgR func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{3} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{3} } func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) @@ -235,7 +235,7 @@ func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsg func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{4} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{4} } func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) @@ -275,7 +275,7 @@ func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUserPlatform) ProtoMessage() {} func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{5} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{5} } func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) @@ -329,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusReq) ProtoMessage() {} func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{6} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{6} } func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) @@ -384,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{7} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{7} } func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) @@ -446,7 +446,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{7, 0} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{7, 0} } func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) @@ -493,7 +493,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{7, 1} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{7, 1} } func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) @@ -549,7 +549,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{7, 2} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{7, 2} } func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) @@ -603,7 +603,7 @@ func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} } func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineReq) ProtoMessage() {} func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{8} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{8} } func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) @@ -654,7 +654,7 @@ func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} } func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineResp) ProtoMessage() {} func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_9ac412c3c8c99f28, []int{9} + return fileDescriptor_relay_e9fd8824fb6cabec, []int{9} } func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) @@ -674,6 +674,114 @@ func (m *KickUserOfflineResp) XXX_DiscardUnknown() { var xxx_messageInfo_KickUserOfflineResp proto.InternalMessageInfo +type MultiTerminalLoginCheckReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + PlatformID int32 `protobuf:"varint,2,opt,name=platformID" json:"platformID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MultiTerminalLoginCheckReq) Reset() { *m = MultiTerminalLoginCheckReq{} } +func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) } +func (*MultiTerminalLoginCheckReq) ProtoMessage() {} +func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_e9fd8824fb6cabec, []int{10} +} +func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b) +} +func (m *MultiTerminalLoginCheckReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MultiTerminalLoginCheckReq.Marshal(b, m, deterministic) +} +func (dst *MultiTerminalLoginCheckReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiTerminalLoginCheckReq.Merge(dst, src) +} +func (m *MultiTerminalLoginCheckReq) XXX_Size() int { + return xxx_messageInfo_MultiTerminalLoginCheckReq.Size(m) +} +func (m *MultiTerminalLoginCheckReq) XXX_DiscardUnknown() { + xxx_messageInfo_MultiTerminalLoginCheckReq.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiTerminalLoginCheckReq proto.InternalMessageInfo + +func (m *MultiTerminalLoginCheckReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *MultiTerminalLoginCheckReq) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *MultiTerminalLoginCheckReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *MultiTerminalLoginCheckReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type MultiTerminalLoginCheckResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MultiTerminalLoginCheckResp) Reset() { *m = MultiTerminalLoginCheckResp{} } +func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) } +func (*MultiTerminalLoginCheckResp) ProtoMessage() {} +func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_e9fd8824fb6cabec, []int{11} +} +func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b) +} +func (m *MultiTerminalLoginCheckResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MultiTerminalLoginCheckResp.Marshal(b, m, deterministic) +} +func (dst *MultiTerminalLoginCheckResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiTerminalLoginCheckResp.Merge(dst, src) +} +func (m *MultiTerminalLoginCheckResp) XXX_Size() int { + return xxx_messageInfo_MultiTerminalLoginCheckResp.Size(m) +} +func (m *MultiTerminalLoginCheckResp) XXX_DiscardUnknown() { + xxx_messageInfo_MultiTerminalLoginCheckResp.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiTerminalLoginCheckResp proto.InternalMessageInfo + +func (m *MultiTerminalLoginCheckResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *MultiTerminalLoginCheckResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + func init() { proto.RegisterType((*OnlinePushMsgReq)(nil), "relay.OnlinePushMsgReq") proto.RegisterType((*OnlinePushMsgResp)(nil), "relay.OnlinePushMsgResp") @@ -688,6 +796,8 @@ func init() { proto.RegisterType((*GetUsersOnlineStatusResp_SuccessResult)(nil), "relay.GetUsersOnlineStatusResp.SuccessResult") proto.RegisterType((*KickUserOfflineReq)(nil), "relay.KickUserOfflineReq") proto.RegisterType((*KickUserOfflineResp)(nil), "relay.KickUserOfflineResp") + proto.RegisterType((*MultiTerminalLoginCheckReq)(nil), "relay.MultiTerminalLoginCheckReq") + proto.RegisterType((*MultiTerminalLoginCheckResp)(nil), "relay.MultiTerminalLoginCheckResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -706,6 +816,7 @@ type RelayClient interface { OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) + MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error) } type relayClient struct { @@ -761,6 +872,15 @@ func (c *relayClient) KickUserOffline(ctx context.Context, in *KickUserOfflineRe return out, nil } +func (c *relayClient) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error) { + out := new(MultiTerminalLoginCheckResp) + err := grpc.Invoke(ctx, "/relay.relay/MultiTerminalLoginCheck", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Relay service type RelayServer interface { @@ -769,6 +889,7 @@ type RelayServer interface { OnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error) + MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error) } func RegisterRelayServer(s *grpc.Server, srv RelayServer) { @@ -865,6 +986,24 @@ func _Relay_KickUserOffline_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Relay_MultiTerminalLoginCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MultiTerminalLoginCheckReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RelayServer).MultiTerminalLoginCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.relay/MultiTerminalLoginCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RelayServer).MultiTerminalLoginCheck(ctx, req.(*MultiTerminalLoginCheckReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Relay_serviceDesc = grpc.ServiceDesc{ ServiceName: "relay.relay", HandlerType: (*RelayServer)(nil), @@ -889,60 +1028,68 @@ var _Relay_serviceDesc = grpc.ServiceDesc{ MethodName: "KickUserOffline", Handler: _Relay_KickUserOffline_Handler, }, + { + MethodName: "MultiTerminalLoginCheck", + Handler: _Relay_MultiTerminalLoginCheck_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_9ac412c3c8c99f28) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_e9fd8824fb6cabec) } -var fileDescriptor_relay_9ac412c3c8c99f28 = []byte{ - // 737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0xdb, 0x5a, - 0x10, 0x96, 0x31, 0xe1, 0x67, 0x80, 0x0b, 0x9c, 0x0b, 0x17, 0xe3, 0x45, 0xc8, 0xf5, 0xe2, 0x2a, - 0xba, 0x6a, 0x13, 0x29, 0xed, 0xae, 0x3b, 0x88, 0xa0, 0x51, 0x89, 0x82, 0x4e, 0x5a, 0xb5, 0x62, - 0x13, 0x99, 0xe4, 0x24, 0x58, 0x71, 0xe2, 0xc3, 0x19, 0x1b, 0xc4, 0xa6, 0xdb, 0xee, 0xfa, 0x08, - 0x5d, 0xf4, 0x09, 0xba, 0xeb, 0xeb, 0x55, 0xe7, 0x27, 0xae, 0x9d, 0x1f, 0x28, 0x0b, 0x36, 0x90, - 0x99, 0x33, 0xe7, 0x9b, 0xf9, 0xbe, 0x19, 0x8f, 0x0d, 0xbb, 0x82, 0x85, 0xfe, 0x7d, 0x55, 0xfd, - 0xad, 0x70, 0x11, 0xc5, 0x11, 0x29, 0x28, 0xc3, 0xfd, 0xb7, 0xc5, 0xd9, 0xb8, 0xd3, 0x68, 0x56, - 0xf9, 0x70, 0x50, 0x55, 0x27, 0x55, 0xec, 0x0d, 0x3b, 0x77, 0x58, 0xbd, 0x43, 0x1d, 0xe9, 0x7d, - 0xb5, 0x60, 0xa7, 0x35, 0x0e, 0x83, 0x31, 0xbb, 0x48, 0xf0, 0xba, 0x89, 0x03, 0xca, 0x6e, 0x48, - 0x09, 0x36, 0x5a, 0x9c, 0x09, 0x3f, 0x0e, 0xa2, 0x71, 0xa3, 0xee, 0x58, 0x25, 0xab, 0xbc, 0x4e, - 0xb3, 0x2e, 0xf2, 0x1a, 0x56, 0x47, 0x38, 0xa8, 0xfb, 0xb1, 0xef, 0x2c, 0x95, 0xac, 0xf2, 0x46, - 0xcd, 0xad, 0x20, 0x13, 0xb7, 0x4c, 0x74, 0x7c, 0x1e, 0x74, 0xb8, 0x2f, 0xfc, 0x11, 0x56, 0x9a, - 0x3a, 0x82, 0x4e, 0x42, 0x89, 0x07, 0x9b, 0x3c, 0xc1, 0xeb, 0xf7, 0xd1, 0x07, 0x64, 0xa2, 0x51, - 0x77, 0x6c, 0x05, 0x9c, 0xf3, 0x79, 0x67, 0xb0, 0x3b, 0x55, 0x0f, 0x72, 0x52, 0x83, 0x65, 0xc1, - 0x90, 0x3b, 0x56, 0xc9, 0x2e, 0x6f, 0xd4, 0x8a, 0x15, 0xcd, 0xb5, 0x1d, 0x8c, 0x07, 0x21, 0x6b, - 0xe2, 0x40, 0x5f, 0xbe, 0x08, 0xfd, 0xb8, 0x1f, 0x89, 0x11, 0x55, 0xb1, 0xde, 0x17, 0x0b, 0x0e, - 0x65, 0x04, 0x0b, 0xd3, 0x08, 0xca, 0x30, 0x09, 0xe3, 0xf3, 0x00, 0x63, 0xf2, 0x0f, 0xac, 0x24, - 0xba, 0x08, 0xcd, 0xce, 0x58, 0x69, 0xa6, 0xa5, 0x3f, 0xcf, 0x44, 0x8a, 0x00, 0x51, 0x5a, 0xb2, - 0x22, 0xb5, 0x46, 0x33, 0x1e, 0xef, 0x9b, 0x05, 0x8e, 0xe6, 0x74, 0xec, 0xc7, 0xdd, 0x6b, 0xe9, - 0x6b, 0x8d, 0xd9, 0x33, 0x6b, 0xfd, 0x3f, 0xec, 0x64, 0x75, 0x95, 0xa4, 0x1d, 0xbb, 0x64, 0x97, - 0xd7, 0xe9, 0x8c, 0xdf, 0x0b, 0xe0, 0x70, 0x41, 0x7d, 0xc8, 0xc9, 0x39, 0xec, 0xa0, 0xa2, 0x2f, - 0xfd, 0x5a, 0x41, 0xd3, 0x87, 0x52, 0x46, 0x9d, 0xb9, 0x2a, 0xd3, 0x99, 0x9b, 0xde, 0x3d, 0x1c, - 0x2c, 0x10, 0x53, 0xca, 0xa8, 0x83, 0x4e, 0xa2, 0x1e, 0x53, 0x42, 0xd8, 0x34, 0xe3, 0x91, 0x2d, - 0xa3, 0xac, 0x7b, 0xdb, 0xa8, 0x2b, 0x19, 0xd6, 0xa9, 0xb1, 0xc8, 0x7f, 0xf0, 0x97, 0xfc, 0x25, - 0x71, 0x4e, 0x23, 0x31, 0x32, 0x73, 0x55, 0xa0, 0x53, 0x5e, 0xef, 0x0e, 0x0e, 0xce, 0x58, 0x2c, - 0x53, 0xa2, 0x66, 0xdb, 0x8e, 0xfd, 0x38, 0x41, 0xd9, 0x84, 0x22, 0x40, 0xf2, 0x5b, 0x26, 0x4b, - 0xc9, 0x94, 0xf1, 0xc8, 0x26, 0x45, 0x99, 0x26, 0xe9, 0xfc, 0x59, 0x17, 0x71, 0x61, 0x2d, 0xe2, - 0xb9, 0xb1, 0x4e, 0x6d, 0xef, 0xe7, 0x32, 0x38, 0xf3, 0x33, 0x23, 0x27, 0x0e, 0xac, 0x32, 0x21, - 0x52, 0xca, 0x05, 0x3a, 0x31, 0x25, 0x5f, 0x26, 0x44, 0x13, 0x07, 0x13, 0xbe, 0xda, 0x22, 0x6d, - 0xd8, 0xc2, 0xa4, 0xdb, 0x65, 0x88, 0xa6, 0x1b, 0xb6, 0xea, 0xc6, 0x4b, 0xd3, 0x8d, 0x45, 0x99, - 0x2a, 0xed, 0xec, 0x25, 0x9a, 0xc7, 0x20, 0x17, 0xb0, 0xd9, 0xf7, 0x83, 0x90, 0xf5, 0x0c, 0xe6, - 0xb2, 0xc2, 0x7c, 0xf1, 0x18, 0xe6, 0xa9, 0xba, 0x53, 0x67, 0xb1, 0x1f, 0x84, 0x34, 0x87, 0xe0, - 0x9e, 0xc0, 0x96, 0xc9, 0xa8, 0x8f, 0xa5, 0x44, 0xdc, 0xf4, 0xda, 0x8c, 0x79, 0x6a, 0x4b, 0xae, - 0xa8, 0x50, 0x27, 0x5c, 0xb5, 0xe5, 0x7e, 0x82, 0xcd, 0x6c, 0x8a, 0xcc, 0x63, 0x6b, 0xe7, 0x1e, - 0xdb, 0x27, 0xab, 0xe8, 0x7e, 0xb7, 0xd2, 0xfa, 0x8c, 0x04, 0x8b, 0x56, 0xc2, 0x82, 0xda, 0x88, - 0x0f, 0x7b, 0x3d, 0x55, 0xd5, 0x64, 0x82, 0xb5, 0x2e, 0x4f, 0x6c, 0x87, 0xd1, 0x6e, 0x2e, 0x94, - 0xf7, 0x19, 0xc8, 0xbb, 0xa0, 0x3b, 0x94, 0x00, 0xad, 0x7e, 0x5f, 0x02, 0x98, 0x95, 0x11, 0xcd, - 0xae, 0x8c, 0xec, 0x34, 0x16, 0x01, 0x26, 0xd2, 0x9a, 0x71, 0x2d, 0xd0, 0x8c, 0x47, 0x3e, 0x32, - 0x43, 0x83, 0x9b, 0x5b, 0x0d, 0x53, 0x5e, 0x6f, 0x1f, 0xfe, 0x9e, 0xc9, 0x8f, 0xbc, 0xf6, 0xc3, - 0x06, 0xfd, 0x86, 0x21, 0xc7, 0xb0, 0x95, 0xdb, 0xd6, 0xe4, 0xc0, 0xd0, 0x9e, 0x7e, 0xa7, 0xb8, - 0xce, 0xfc, 0x03, 0xe4, 0xe4, 0x23, 0xec, 0xcd, 0x13, 0x89, 0x14, 0x1f, 0x54, 0xf0, 0xc6, 0x3d, - 0x7a, 0x44, 0x61, 0x72, 0x09, 0xfb, 0x73, 0xd7, 0x1a, 0x39, 0xca, 0xd5, 0x32, 0xbb, 0x94, 0xdd, - 0xd2, 0xc3, 0x01, 0xc8, 0x49, 0x0f, 0x8e, 0xda, 0x09, 0x67, 0xe2, 0x4c, 0x44, 0x09, 0x7f, 0xb6, - 0x2c, 0x6f, 0x61, 0x7b, 0x4a, 0x7f, 0x72, 0x68, 0x2e, 0xcd, 0xce, 0x85, 0xeb, 0x2e, 0x3a, 0x42, - 0x7e, 0xbc, 0x7b, 0xb9, 0x5d, 0xd1, 0x9f, 0x08, 0x6f, 0xf8, 0x15, 0x95, 0xff, 0xaf, 0x56, 0xd4, - 0x17, 0xc0, 0xab, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0x9a, 0x1f, 0x1c, 0x40, 0x08, 0x00, - 0x00, +var fileDescriptor_relay_e9fd8824fb6cabec = []byte{ + // 809 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x4f, 0xdb, 0x4c, + 0x10, 0x96, 0x49, 0xc2, 0xc7, 0x00, 0x2f, 0xb0, 0x2f, 0x34, 0xc6, 0x95, 0x42, 0xf0, 0xa1, 0x8a, + 0xaa, 0x36, 0x91, 0xd2, 0xde, 0x7a, 0x83, 0x08, 0x1a, 0x95, 0x28, 0x68, 0x43, 0xd5, 0x8a, 0x4b, + 0x6a, 0x92, 0x4d, 0x62, 0xc5, 0xb1, 0x97, 0x5d, 0x1b, 0xc4, 0xa5, 0xd7, 0x5e, 0xaa, 0x1e, 0xfa, + 0x03, 0x7a, 0xe8, 0x9f, 0xe8, 0xdf, 0xab, 0xf6, 0x23, 0xa9, 0x9d, 0xc4, 0xa4, 0x54, 0xe2, 0x02, + 0x99, 0xd9, 0xd9, 0x99, 0x79, 0x9e, 0x79, 0x76, 0xd7, 0xb0, 0xc3, 0x88, 0xe7, 0xdc, 0x55, 0xe4, + 0xdf, 0x32, 0x65, 0x41, 0x18, 0xa0, 0x9c, 0x34, 0xac, 0xc3, 0x26, 0x25, 0x7e, 0xbb, 0xde, 0xa8, + 0xd0, 0x61, 0xbf, 0x22, 0x57, 0x2a, 0xbc, 0x3b, 0x6c, 0xdf, 0xf2, 0xca, 0x2d, 0x57, 0x91, 0xf6, + 0x37, 0x03, 0xb6, 0x9b, 0xbe, 0xe7, 0xfa, 0xe4, 0x3c, 0xe2, 0x83, 0x06, 0xef, 0x63, 0x72, 0x8d, + 0x8a, 0xb0, 0xde, 0xa4, 0x84, 0x39, 0xa1, 0x1b, 0xf8, 0xf5, 0x9a, 0x69, 0x14, 0x8d, 0xd2, 0x1a, + 0x8e, 0xbb, 0xd0, 0x6b, 0x58, 0x19, 0xf1, 0x7e, 0xcd, 0x09, 0x1d, 0x73, 0xa9, 0x68, 0x94, 0xd6, + 0xab, 0x56, 0x99, 0x13, 0x76, 0x43, 0x58, 0xdb, 0xa1, 0x6e, 0x9b, 0x3a, 0xcc, 0x19, 0xf1, 0x72, + 0x43, 0x45, 0xe0, 0x71, 0x28, 0xb2, 0x61, 0x83, 0x46, 0x7c, 0x70, 0x11, 0xbc, 0xe7, 0x84, 0xd5, + 0x6b, 0x66, 0x46, 0x26, 0x4e, 0xf8, 0xec, 0x53, 0xd8, 0x99, 0xea, 0x87, 0x53, 0x54, 0x85, 0x2c, + 0x23, 0x9c, 0x9a, 0x46, 0x31, 0x53, 0x5a, 0xaf, 0x16, 0xca, 0x0a, 0x6b, 0xcb, 0xf5, 0xfb, 0x1e, + 0x69, 0xf0, 0xbe, 0xda, 0x7c, 0xee, 0x39, 0x61, 0x2f, 0x60, 0x23, 0x2c, 0x63, 0xed, 0x2f, 0x06, + 0xec, 0x8b, 0x08, 0xe2, 0x4d, 0x22, 0x30, 0xe1, 0x91, 0x17, 0x9e, 0xb9, 0x3c, 0x44, 0x4f, 0x60, + 0x39, 0x52, 0x4d, 0x28, 0x74, 0xda, 0x9a, 0x54, 0x5a, 0xfa, 0xfb, 0x4a, 0xa8, 0x00, 0x10, 0x4c, + 0x5a, 0x96, 0xa0, 0x56, 0x71, 0xcc, 0x63, 0xff, 0x30, 0xc0, 0x54, 0x98, 0x8e, 0x9c, 0xb0, 0x33, + 0x10, 0xbe, 0xa6, 0x4f, 0x1e, 0x99, 0xeb, 0xe7, 0xb0, 0x1d, 0xe7, 0x55, 0x80, 0x36, 0x33, 0xc5, + 0x4c, 0x69, 0x0d, 0xcf, 0xf8, 0x6d, 0x17, 0xf6, 0x53, 0xfa, 0xe3, 0x14, 0x9d, 0xc1, 0x36, 0x97, + 0xf0, 0x85, 0x5f, 0x31, 0xa8, 0xe7, 0x50, 0x8c, 0xb1, 0x33, 0x97, 0x65, 0x3c, 0xb3, 0xd3, 0xbe, + 0x83, 0x7c, 0x0a, 0x99, 0x82, 0x46, 0x15, 0x74, 0x1c, 0x74, 0x89, 0x24, 0x22, 0x83, 0x63, 0x1e, + 0x31, 0x32, 0x4c, 0x3a, 0x37, 0xf5, 0x9a, 0xa4, 0x61, 0x0d, 0x6b, 0x0b, 0x3d, 0x83, 0xff, 0xc4, + 0x2f, 0x91, 0xe7, 0x24, 0x60, 0x23, 0xad, 0xab, 0x1c, 0x9e, 0xf2, 0xda, 0xb7, 0x90, 0x3f, 0x25, + 0xa1, 0x28, 0xc9, 0x15, 0xda, 0x56, 0xe8, 0x84, 0x11, 0x17, 0x43, 0x28, 0x00, 0x44, 0x7f, 0x68, + 0x32, 0x24, 0x4d, 0x31, 0x8f, 0x18, 0x52, 0x10, 0x1b, 0x92, 0xaa, 0x1f, 0x77, 0x21, 0x0b, 0x56, + 0x03, 0x9a, 0x90, 0xf5, 0xc4, 0xb6, 0x7f, 0x65, 0xc1, 0x9c, 0x5f, 0x99, 0x53, 0x64, 0xc2, 0x0a, + 0x61, 0x6c, 0x02, 0x39, 0x87, 0xc7, 0xa6, 0xc0, 0x4b, 0x18, 0x6b, 0xf0, 0xfe, 0x18, 0xaf, 0xb2, + 0x50, 0x0b, 0x36, 0x79, 0xd4, 0xe9, 0x10, 0xce, 0xf5, 0x34, 0x32, 0x72, 0x1a, 0x2f, 0xf5, 0x34, + 0xd2, 0x2a, 0x95, 0x5b, 0xf1, 0x4d, 0x38, 0x99, 0x03, 0x9d, 0xc3, 0x46, 0xcf, 0x71, 0x3d, 0xd2, + 0xd5, 0x39, 0xb3, 0x32, 0xe7, 0x8b, 0x45, 0x39, 0x4f, 0xe4, 0x9e, 0x1a, 0x09, 0x1d, 0xd7, 0xc3, + 0x89, 0x0c, 0xd6, 0x31, 0x6c, 0xea, 0x8a, 0x6a, 0x59, 0x50, 0x44, 0xf5, 0xac, 0xb5, 0xcc, 0x27, + 0xb6, 0xc0, 0xca, 0x65, 0xd6, 0x31, 0x56, 0x65, 0x59, 0x1f, 0x61, 0x23, 0x5e, 0x22, 0x76, 0x6c, + 0x33, 0x89, 0x63, 0xfb, 0x60, 0x16, 0xad, 0x9f, 0xc6, 0xa4, 0x3f, 0x4d, 0x41, 0xda, 0x95, 0x90, + 0xd2, 0x1b, 0x72, 0x60, 0xb7, 0x2b, 0xbb, 0x1a, 0x2b, 0x58, 0xf1, 0xf2, 0xc0, 0x71, 0x68, 0xee, + 0xe6, 0xa6, 0xb2, 0x3f, 0x03, 0x7a, 0xe7, 0x76, 0x86, 0x22, 0x41, 0xb3, 0xd7, 0x13, 0x09, 0xf4, + 0x95, 0x11, 0xcc, 0x5e, 0x19, 0x71, 0x35, 0x16, 0x00, 0xc6, 0xd4, 0x6a, 0xb9, 0xe6, 0x70, 0xcc, + 0x23, 0x8e, 0xcc, 0x50, 0xe7, 0x4d, 0x5c, 0x0d, 0x53, 0x5e, 0x7b, 0x0f, 0xfe, 0x9f, 0xa9, 0xcf, + 0xa9, 0xfd, 0xd5, 0x00, 0xab, 0x11, 0x79, 0xa1, 0x7b, 0x41, 0xd8, 0xc8, 0xf5, 0x1d, 0xef, 0x2c, + 0xe8, 0xbb, 0xfe, 0xf1, 0x80, 0x74, 0x86, 0xa2, 0xbf, 0x34, 0x22, 0x17, 0x75, 0xb5, 0x0b, 0xb9, + 0x30, 0x18, 0x12, 0x5f, 0xcf, 0x56, 0x19, 0xd3, 0x68, 0xb3, 0x33, 0x68, 0xed, 0x26, 0x3c, 0x4d, + 0xed, 0xe6, 0x5f, 0x4e, 0x58, 0xf5, 0x7b, 0x16, 0xd4, 0x0b, 0x8a, 0x8e, 0x60, 0x33, 0xf1, 0x1a, + 0xa1, 0xbc, 0x1e, 0xeb, 0xf4, 0x9b, 0x69, 0x99, 0xf3, 0x17, 0x38, 0x45, 0x1f, 0x60, 0x77, 0x9e, + 0x08, 0x50, 0xe1, 0x5e, 0x85, 0x5c, 0x5b, 0x07, 0x0b, 0x14, 0x84, 0x2e, 0x61, 0x6f, 0xee, 0xb5, + 0x8d, 0x0e, 0x12, 0xbd, 0xcc, 0x3e, 0x3a, 0x56, 0xf1, 0xfe, 0x00, 0x4e, 0x51, 0x17, 0x0e, 0x5a, + 0x11, 0x25, 0xec, 0x94, 0x05, 0x11, 0x7d, 0xb4, 0x2a, 0x6f, 0x61, 0x6b, 0x4a, 0x5f, 0x68, 0x5f, + 0x6f, 0x9a, 0xd5, 0xbd, 0x65, 0xa5, 0x2d, 0x71, 0x8a, 0x3e, 0x41, 0x3e, 0x45, 0x03, 0xe8, 0x50, + 0x6f, 0x4b, 0x57, 0xac, 0x65, 0x2f, 0x0a, 0xe1, 0xf4, 0x68, 0xe7, 0x72, 0xab, 0xac, 0x3e, 0xb2, + 0xde, 0xd0, 0x2b, 0x2c, 0xfe, 0x5f, 0x2d, 0xcb, 0x6f, 0xa8, 0x57, 0xbf, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x8e, 0xbc, 0x1c, 0xdc, 0x82, 0x09, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 91ff335e4..556cd9686 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -70,18 +70,32 @@ message GetUsersOnlineStatusResp{ } message KickUserOfflineReq{ string operationID = 1; -int32 platformID = 2; + int32 platformID = 2; repeated string kickUserIDList = 3; } message KickUserOfflineResp{ } + + +message MultiTerminalLoginCheckReq{ + string userID = 1; + int32 platformID = 2; + string token = 3; + string operationID = 4; +} +message MultiTerminalLoginCheckResp{ + int32 errCode = 1; + string errMsg = 2; +} + + service relay { rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp); - rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq)returns(GetUsersOnlineStatusResp); + rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq) returns(GetUsersOnlineStatusResp); rpc OnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp); -// rpc SendMsgByWS(SendMsgByWSReq) returns(MsgToUserResp); + rpc MultiTerminalLoginCheck(MultiTerminalLoginCheckReq) returns(MultiTerminalLoginCheckResp); } From 6def5bd3cfdfbe940950d4c6e2ec7feb807f5500 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 15:49:13 +0800 Subject: [PATCH 35/53] add test file --- pkg/common/db/redisModel_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index 2f14b7fc2..602c51a16 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -126,6 +126,13 @@ func Test_SetFcmToken(t *testing.T) { err := DB.SetFcmToken(uid, platformID, token, 0) assert.Nil(t, err) } +func Test_GetFcmToken(t *testing.T) { + uid := "test_uid" + platformID := 2 + token, err := DB.GetFcmToken(uid, platformID) + assert.Nil(t, err) + fmt.Println("token is :", token) +} //func Test_GetGroupMemberList(t *testing.T) { // groupID := "3791742301" From e1af587040ce3856b84436dc44bb4215d9d46269 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 15:56:16 +0800 Subject: [PATCH 36/53] mongodb superGroup --- internal/push/logic/callback.go | 52 ++++++++++++++++++++------- internal/push/logic/push_to_client.go | 3 +- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index 5b95e9102..9cd5158ba 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -11,11 +11,15 @@ import ( http2 "net/http" ) -func callbackBeforePush(operationID string, userIDList []string, msg *commonPb.MsgData, command string, callbackResp cbApi.CommonCallbackResp, timeOut int) cbApi.CommonCallbackResp { +func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} + if !config.Config.Callback.CallbackOfflinePush.Enable { + return callbackResp + } req := cbApi.CallbackBeforePushReq{ UserStatusBatchCallbackReq: cbApi.UserStatusBatchCallbackReq{ UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ - CallbackCommand: command, + CallbackCommand: constant.CallbackOfflinePushCommand, OperationID: operationID, PlatformID: msg.SenderPlatformID, Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), @@ -31,7 +35,7 @@ func callbackBeforePush(operationID string, userIDList []string, msg *commonPb.M Content: string(msg.Content), } resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp} - if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, timeOut); err != nil { + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil { callbackResp.ErrCode = http2.StatusInternalServerError callbackResp.ErrMsg = err.Error() if !config.Config.Callback.CallbackOfflinePush.CallbackFailedContinue { @@ -45,20 +49,42 @@ func callbackBeforePush(operationID string, userIDList []string, msg *commonPb.M return callbackResp } -func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { - callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} - if !config.Config.Callback.CallbackOfflinePush.Enable { - return callbackResp - } - return callbackBeforePush(operationID, userIDList, msg, constant.CallbackOfflinePushCommand, callbackResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut) -} - func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackOnlinePush.Enable { return callbackResp } - return callbackBeforePush(operationID, userIDList, msg, constant.CallbackOnlinePushCommand, callbackResp, config.Config.Callback.CallbackOnlinePush.CallbackTimeOut) + req := cbApi.CallbackBeforePushReq{ + UserStatusBatchCallbackReq: cbApi.UserStatusBatchCallbackReq{ + UserStatusBaseCallback: cbApi.UserStatusBaseCallback{ + CallbackCommand: constant.CallbackOnlinePushCommand, + OperationID: operationID, + PlatformID: msg.SenderPlatformID, + Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), + }, + UserIDList: userIDList, + }, + OfflinePushInfo: msg.OfflinePushInfo, + SendID: msg.SendID, + GroupID: msg.GroupID, + ContentType: msg.ContentType, + SessionType: msg.SessionType, + AtUserIDList: msg.AtUserIDList, + Content: string(msg.Content), + } + resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp} + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackOnlinePush.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + if !config.Config.Callback.CallbackOnlinePush.CallbackFailedContinue { + callbackResp.ActionCode = constant.ActionForbidden + return callbackResp + } else { + callbackResp.ActionCode = constant.ActionAllow + return callbackResp + } + } + return callbackResp } func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg *commonPb.MsgData, pushToUserList *[]string) cbApi.CommonCallbackResp { @@ -85,7 +111,7 @@ func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.CallbackTimeOut); err != nil { callbackResp.ErrCode = http2.StatusInternalServerError callbackResp.ErrMsg = err.Error() - if !config.Config.Callback.CallbackOfflinePush.CallbackFailedContinue { + if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.CallbackFailedContinue { callbackResp.ActionCode = constant.ActionForbidden return callbackResp } else { diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 16087026b..11f304433 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -169,7 +169,8 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { return } log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "callback userIDList Resp", pushToUserIDList) - } else { + } + if len(pushToUserIDList) == 0 { getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, pushMsg.OperationID) if etcdConn == nil { From 9121063ebcf1102503a8f438991a0fd3f982c415 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 15:59:49 +0800 Subject: [PATCH 37/53] add test file --- internal/push/fcm/push.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index ac485a708..33ef97332 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -66,6 +66,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, Fail := 0 for i := 0; i < pages; i++ { Msg := new(messaging.MulticastMessage) + Msg.Notification = &messaging.Notification{} Msg.Notification.Body = detailContent Msg.Notification.Title = alert ctx := context.Background() From 92cdff30431cbfe4243c3ef72fd2cc66634b5217 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 16:01:08 +0800 Subject: [PATCH 38/53] Adjust error code --- internal/api/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 60bf1d8a5..733d9206b 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -150,7 +150,7 @@ func ParseToken(c *gin.Context) { if err := c.BindJSON(¶ms); err != nil { errMsg := " BindJSON failed " + err.Error() log.NewError("0", errMsg) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 200, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } @@ -161,7 +161,7 @@ func ParseToken(c *gin.Context) { if !ok { errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(params.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 200, "errMsg": errMsg}) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } From ee79728f9d8f390b00defe7d79551b447cf9c7ad Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 16:07:05 +0800 Subject: [PATCH 39/53] add test file --- internal/push/fcm/push.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 33ef97332..80449907b 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -13,6 +13,8 @@ import ( "strconv" ) +const SinglePushCountLimit = 400 + type Fcm struct { FcmMsgCli *messaging.Client } @@ -60,21 +62,21 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, } tokenlen := len(Tokens) // 500组为一个推送,我们用400好了 - limit := 400 - pages := int((tokenlen-1)/limit + 1) + pages := int((tokenlen-1)/SinglePushCountLimit + 1) Success := 0 Fail := 0 + log.Info(operationID, "fmc args", tokenlen, pages) for i := 0; i < pages; i++ { Msg := new(messaging.MulticastMessage) Msg.Notification = &messaging.Notification{} Msg.Notification.Body = detailContent Msg.Notification.Title = alert ctx := context.Background() - max := (i+1)*limit - 1 + max := (i+1)*SinglePushCountLimit - 1 if max >= tokenlen { max = tokenlen - 1 } - Msg.Tokens = Tokens[i*limit : max] + Msg.Tokens = Tokens[i*SinglePushCountLimit : max] //SendMulticast sends the given multicast message to all the FCM registration tokens specified. //The tokens array in MulticastMessage may contain up to 500 tokens. //SendMulticast uses the `SendAll()` function to send the given message to all the target recipients. From cd3778a6209c922cf047283556747683a77e7528 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 16:09:53 +0800 Subject: [PATCH 40/53] add test file --- internal/push/fcm/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 80449907b..a7a928978 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -8,6 +8,7 @@ import ( "context" firebase "firebase.google.com/go" "firebase.google.com/go/messaging" + "fmt" "google.golang.org/api/option" "path/filepath" "strconv" @@ -65,7 +66,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, pages := int((tokenlen-1)/SinglePushCountLimit + 1) Success := 0 Fail := 0 - log.Info(operationID, "fmc args", tokenlen, pages) + fmt.Println(operationID, "fcm args", tokenlen, pages) for i := 0; i < pages; i++ { Msg := new(messaging.MulticastMessage) Msg.Notification = &messaging.Notification{} From ba4988bb9b7b36510db72785b486b0154bd1e419 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 16:14:17 +0800 Subject: [PATCH 41/53] Adjust error code --- internal/msg_gateway/gate/logic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 0d18e0653..b9d132cd1 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -54,7 +54,7 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { ws.pullMsgBySeqListReq(conn, &m) case constant.WsLogoutMsg: log.NewInfo(m.OperationID, "conn.Close()", m.SendID, m.MsgIncr, m.ReqIdentifier) - conn.Close() + // conn.Close() default: log.Error(m.OperationID, "ReqIdentifier failed ", m.SendID, m.MsgIncr, m.ReqIdentifier) } From 08119990814bf7dad20e71146f949e4d9ede4cd4 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 16:28:50 +0800 Subject: [PATCH 42/53] Adjust error code --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index ff68124a4..53942155f 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -268,7 +268,7 @@ func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) } - go ws.MultiTerminalLoginRemoteChecker(uid, int32(platformID), token, operationID) + //go ws.MultiTerminalLoginRemoteChecker(uid, int32(platformID), token, operationID) ws.MultiTerminalLoginChecker(uid, platformID, conn, token, operationID) if oldConnMap, ok := ws.wsUserToConn[uid]; ok { oldConnMap[platformID] = conn From 34588f9da366046d5cd91bd6f8cf2b0dd0697e3d Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 16:55:54 +0800 Subject: [PATCH 43/53] Adjust error code --- internal/api/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 733d9206b..60bf1d8a5 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -150,7 +150,7 @@ func ParseToken(c *gin.Context) { if err := c.BindJSON(¶ms); err != nil { errMsg := " BindJSON failed " + err.Error() log.NewError("0", errMsg) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 200, "errMsg": errMsg}) return } @@ -161,7 +161,7 @@ func ParseToken(c *gin.Context) { if !ok { errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(params.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 200, "errMsg": errMsg}) return } From 1b927747788c46fae53b895c656c720998158b81 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 17:03:26 +0800 Subject: [PATCH 44/53] add test file --- internal/push/fcm/push.go | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index a7a928978..7c1f55d00 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -5,10 +5,10 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" + "Open_IM/pkg/tools" "context" firebase "firebase.google.com/go" "firebase.google.com/go/messaging" - "fmt" "google.golang.org/api/option" "path/filepath" "strconv" @@ -47,7 +47,6 @@ func newFcmClient() *Fcm { } func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) { - //需要一个客户端的Token // accounts->registrationToken Tokens := make([]string, 0) for _, account := range accounts { @@ -61,23 +60,16 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, Tokens = append(Tokens, AndroidfcmToken) } } - tokenlen := len(Tokens) - // 500组为一个推送,我们用400好了 - pages := int((tokenlen-1)/SinglePushCountLimit + 1) Success := 0 Fail := 0 - fmt.Println(operationID, "fcm args", tokenlen, pages) - for i := 0; i < pages; i++ { - Msg := new(messaging.MulticastMessage) - Msg.Notification = &messaging.Notification{} - Msg.Notification.Body = detailContent - Msg.Notification.Title = alert - ctx := context.Background() - max := (i+1)*SinglePushCountLimit - 1 - if max >= tokenlen { - max = tokenlen - 1 - } - Msg.Tokens = Tokens[i*SinglePushCountLimit : max] + result := tools.NewSplitter(SinglePushCountLimit, Tokens).GetSplitResult() + Msg := new(messaging.MulticastMessage) + Msg.Notification = &messaging.Notification{} + Msg.Notification.Body = detailContent + Msg.Notification.Title = alert + ctx := context.Background() + for _, v := range result { + Msg.Tokens = v.Item //SendMulticast sends the given multicast message to all the FCM registration tokens specified. //The tokens array in MulticastMessage may contain up to 500 tokens. //SendMulticast uses the `SendAll()` function to send the given message to all the target recipients. @@ -87,7 +79,9 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, //Partial failures are indicated by a `BatchResponse` return value. response, err := f.FcmMsgCli.SendMulticast(ctx, Msg) if err != nil { - return "", err + Fail = Fail + len(v.Item) + log.Info(operationID, "some token push err", err.Error(), len(v.Item)) + continue } Success = Success + response.SuccessCount Fail = Fail + response.FailureCount From b75353643742d1b74629f4c8244a7daf22cd860e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 17:05:39 +0800 Subject: [PATCH 45/53] add test file --- pkg/tools/tools.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkg/tools/tools.go diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go new file mode 100644 index 000000000..a3baa5f3e --- /dev/null +++ b/pkg/tools/tools.go @@ -0,0 +1,28 @@ +package tools + +type SplitResult struct { + Item []string +} +type Splitter struct { + splitCount int + data []string +} + +func NewSplitter(splitCount int, data []string) *Splitter { + return &Splitter{splitCount: splitCount, data: data} +} +func (s *Splitter) GetSplitResult() (result []*SplitResult) { + remain := len(s.data) % s.splitCount + integer := len(s.data) / s.splitCount + for i := 0; i < integer; i++ { + r := new(SplitResult) + r.Item = s.data[i*s.splitCount : (i+1)*s.splitCount] + result = append(result, r) + } + if remain > 0 { + r := new(SplitResult) + r.Item = s.data[integer*s.splitCount:] + result = append(result, r) + } + return result +} From 1c8542448815a12d7df205e9137700c43a8448f8 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 17:09:21 +0800 Subject: [PATCH 46/53] mongodb superGroup --- internal/push/logic/callback.go | 6 +++++- internal/push/logic/push_to_client.go | 13 ++++++++++--- pkg/call_back_struct/push.go | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index 9cd5158ba..cc897322d 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -11,7 +11,7 @@ import ( http2 "net/http" ) -func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { +func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData, offlinePushUserIDList *[]string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackOfflinePush.Enable { return callbackResp @@ -46,6 +46,10 @@ func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb. return callbackResp } } + if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow && len(resp.UserIDList) != 0 { + *offlinePushUserIDList = resp.UserIDList + } + log.NewDebug(operationID, utils.GetSelfFuncName(), offlinePushUserIDList, resp.UserIDList) return callbackResp } diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 11f304433..1ab1ee989 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -127,7 +127,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { } } - callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList, pushMsg.MsgData) + callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList, pushMsg.MsgData, &[]string{}) log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") if callbackResp.ErrCode != 0 { log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) @@ -261,7 +261,9 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { } } if len(onlineFailedUserIDList) > 0 { - callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList, pushMsg.MsgData) + var offlinePushUserIDList []string + var needOfflinePushUserIDList []string + callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList, pushMsg.MsgData, &offlinePushUserIDList) log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") if callbackResp.ErrCode != 0 { log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) @@ -270,6 +272,11 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") return } + if len(offlinePushUserIDList) > 0 { + needOfflinePushUserIDList = offlinePushUserIDList + } else { + needOfflinePushUserIDList = onlineFailedUserIDList + } if offlinePusher == nil { return } @@ -278,7 +285,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) } log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), onlineFailedUserIDList, content, jsonCustomContent, "opts:", opts) - pushResult, err := offlinePusher.Push(onlineFailedUserIDList, content, jsonCustomContent, pushMsg.OperationID, opts) + pushResult, err := offlinePusher.Push(needOfflinePushUserIDList, content, jsonCustomContent, pushMsg.OperationID, opts) if err != nil { log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) } else { diff --git a/pkg/call_back_struct/push.go b/pkg/call_back_struct/push.go index e0b46bd0c..e3803a0e2 100644 --- a/pkg/call_back_struct/push.go +++ b/pkg/call_back_struct/push.go @@ -15,6 +15,7 @@ type CallbackBeforePushReq struct { type CallbackBeforePushResp struct { *CommonCallbackResp + UserIDList []string `json:"userIDList"` } type CallbackBeforeSuperGroupOnlinePushReq struct { From e09d8fc5f5020afb905ea71b9907a0be9963fedd Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 17:45:55 +0800 Subject: [PATCH 47/53] remove fcm json file --- ...nim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json diff --git a/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json b/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json deleted file mode 100644 index e6870bbc1..000000000 --- a/config/openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "openim-5c6c0", - "private_key_id": "8765884a7875fd3c0a73bbc1718bdaeca39fd609", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC90b1YDn14JsY8\nu5a0RIx7yAWmsn8JuoceVPvFzAv45iuU3MfsD51TKY+gjmydFAMpUuEQKYF2hXie\nJt5+EaBf/RWch2zmHK+husQVJpRvKmTNPjT/fT2FqneozriQZ7QedRiKhkv2lb9A\n3QFO3kmeAI7W4DR+22wadNKBX/REv+nZECz6uaPZ9cRvUYb8GCYkcteau62P0z4E\n3sOHe52Pix0OV06vI47PTNmbhZOozF0wdVfxOe5eE5kQ8VZq2oQ+6SHZwNhl+7py\nHAN8Cgq4JXGrjNdafku9UNuLpYLv3a7DejNe1R5tkITE2P01Us43T7HRuZ8W8mV0\nCl9DU+HfAgMBAAECggEAVxu4M3+6znekw1wmpaVLfsZk6YHCULmbpizDuZqQ5/Dg\nkRjcWhU0UmShN8IET/VOGhmhlOQnODe6CYG22s3F9ibTUxjGvbbuVl65+ybQOU+Q\nIKvqcFCN+hgnf30WL5aXjt6Xm4JTu94ufVqubf4OdIa3Bh6vmIOjUWTI8XwSQbWx\n8llfOL4ElMdmtxg0N5iDmkSXfTgZWfty861s76bqazD1cQhMOYPXPnGP78DKyOjH\nN6XchHDXm5I0eEIa+jACW0p6DMArdwREhVgfQotxzRfExXLUR5XxJnMNuA1IwnWF\nJRAg9cEUeIQoJY/kDuNQlxsS2Manb+3exNk52BlFAQKBgQDjo+tENZ3Ozt/JPtev\nOHolhkGCJNWMJPV6SVuBta1/u0/T8HKxkXdNOrooM+dsK5xk+V6Dp8wwrQiUSy/f\n6RVXUcTKTahlTNhwrxmRisJbeyEoX8tJGDVjwJba4sKdkfsWeh4IduyvwQnRCNn8\nmx9Pfp5EyCnWkpyJLvM7OykqXwKBgQDVd5qD88UOvV73xZUPzPlnNQHzBS+TgPlI\n3CLesi8i5I3zBHYS8ynCi0eNyaLqmtatVL6XhnUAWI/U9NKNmP3AH2pigBVIAjM8\nMmSO8iaYYQA3/TOlIsNE6yFjd3t54yFkQ7J6yLPRQWWKwE+3hQ3VZ5WmyM5jOh/s\nD+g5lOd4gQKBgQCH4qSg7eSKvCEID5ROi0cWuULHfldfNfy3B60xC5NK6TRozmKY\nrr3pgwH216zwfEP6XoVVz8dq0w+I/izQ22Ea47u2C49XEP0unseDgrIsS57qa+x8\ncJAGQMOMW8pSpv6cVz8wTFVTQMcsWb1ONgcFvA6b/mRDKvd4SGd3VwRmvwKBgD48\nP5VG5eXVOjHcrgfMR85aOvZCRcuoZ4VhgN0ScAGpRuVaIJ6HvF4Ww0bISbJCcGJa\nebKtpcDzEQQSWKyltR1lS1vqYcn7sjpTqtOuL6hvZ2Prczoq92lJcBOSyzIPETYt\nMoTvrNVOTq90QAmORik4qP3WP63YTWRCgv7+tbmBAoGALVYhJB3KDuOfn4gowiBL\neCCsW93VdLBmrR4PIZlaLLNZSUu3hmM+XNhKCLzMHMoTtptHKq5aQusDlefxhioS\nuWuUXqFyZRdjP81lLBMZQmh6j7kPLC/fWZdN5iBlZX2JTANaOQZHDy8KEHMYq6zf\nYzLbTvrNYxxKyb5q6IXrErk=\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-ppwol@openim-5c6c0.iam.gserviceaccount.com", - "client_id": "117878683878601533433", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ppwol%40openim-5c6c0.iam.gserviceaccount.com" -} From 04e826ff09fa831014286d1af73ed3865434a1c0 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 17:49:15 +0800 Subject: [PATCH 48/53] Adjust error code --- internal/api/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 60bf1d8a5..8a94d73f2 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -150,7 +150,7 @@ func ParseToken(c *gin.Context) { if err := c.BindJSON(¶ms); err != nil { errMsg := " BindJSON failed " + err.Error() log.NewError("0", errMsg) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 200, "errMsg": errMsg}) + c.JSON(http.StatusOK, gin.H{"errCode": 1001, "errMsg": errMsg}) return } @@ -161,7 +161,7 @@ func ParseToken(c *gin.Context) { if !ok { errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") log.NewError(params.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 200, "errMsg": errMsg}) + c.JSON(http.StatusOK, gin.H{"errCode": 1001, "errMsg": errMsg}) return } From 151fec445e51d21b7a27ac19d17329170a6473da Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 17:50:00 +0800 Subject: [PATCH 49/53] fix bug --- internal/rpc/group/super_group.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/rpc/group/super_group.go b/internal/rpc/group/super_group.go index d08a38742..9b50c7955 100644 --- a/internal/rpc/group/super_group.go +++ b/internal/rpc/group/super_group.go @@ -9,6 +9,7 @@ import ( commonPb "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "github.com/go-redis/redis/v8" ) func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { @@ -17,6 +18,10 @@ func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup. //userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) groupIDList, err := rocksCache.GetJoinedSuperGroupListFromCache(req.UserID) if err != nil { + if err == redis.Nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID nil ", err.Error(), req.UserID) + return resp, nil + } log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID) resp.CommonResp.ErrCode = constant.ErrDB.ErrCode resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg From 147e8d5f9e3a5bad799e58ceba383960e8b25c46 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 17:54:50 +0800 Subject: [PATCH 50/53] remove fcm json file --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 19ea87728..7b2067be9 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -211,7 +211,7 @@ push: masterSecret: 02204efe3f3832947a236ee5 pushUrl: "https://api.jpush.cn/v3/push" pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" - enable: false + enable: true getui: #个推推送 pushUrl: "https://restapi.getui.com/v2/$appId" masterSecret: "" @@ -220,7 +220,7 @@ push: enable: false fcm: #firebase cloud message 消息推送 serviceAccount: "openim-5c6c0-firebase-adminsdk-ppwol-8765884a78.json" #帐号文件,此处需要改修配置,并且这个文件放在 config目录下 - enable: true + enable: false From 4701300ed8cfa5eb59f52614d1c51a7938b77fdf Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 29 Jul 2022 17:58:51 +0800 Subject: [PATCH 51/53] Adjust error code --- internal/api/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 8a94d73f2..9d713410b 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -159,7 +159,7 @@ func ParseToken(c *gin.Context) { var expireTime int64 ok, _, errInfo, expireTime = token_verify.GetUserIDFromTokenExpireTime(c.Request.Header.Get("token"), params.OperationID) if !ok { - errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") + errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo log.NewError(params.OperationID, errMsg) c.JSON(http.StatusOK, gin.H{"errCode": 1001, "errMsg": errMsg}) return From ab6b1f0fcaa0ed5d701599587eb10051a5bb5bda Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 19:08:56 +0800 Subject: [PATCH 52/53] fix bug --- internal/push/logic/push_handler.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 0bb51b09d..ccc00b480 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -8,6 +8,7 @@ package logic import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" kfk "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/msg" @@ -37,8 +38,19 @@ func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { log.Error("", "push Unmarshal msg err", "msg", string(msg), "err", err.Error()) return } + pbData := &pbPush.PushMsgReq{ + OperationID: msgFromMQ.OperationID, + MsgData: msgFromMQ.MsgData, + PushToUserID: msgFromMQ.PushToUserID, + } + switch msgFromMQ.MsgData.SessionType { + case constant.SuperGroupChatType: + MsgToSuperGroupUser(pbData) + default: + MsgToUser(pbData) + } //Call push module to send message to the user - MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) + //MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) } func (PushConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } func (PushConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } From dca2f9323bee16fdb42487adf80e2d87148dae05 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 29 Jul 2022 20:23:07 +0800 Subject: [PATCH 53/53] update server version --- config/config.yaml | 2 +- docker-compose.yaml | 2 +- internal/push/fcm/push_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 7b2067be9..680747d01 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -2,7 +2,7 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 2.3.0-rc1 +serverversion: 2.3.0-rc2 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openim #默认即可 diff --git a/docker-compose.yaml b/docker-compose.yaml index 1f880502f..70e5cd6a8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -126,7 +126,7 @@ services: # STORE_PORT: 3306 open_im_server: - image: openim/open_im_server:v2.3.0-rc1 + image: openim/open_im_server:v2.3.0-rc2 container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs diff --git a/internal/push/fcm/push_test.go b/internal/push/fcm/push_test.go index caf09d947..5e31058fd 100644 --- a/internal/push/fcm/push_test.go +++ b/internal/push/fcm/push_test.go @@ -9,7 +9,7 @@ import ( func Test_Push(t *testing.T) { offlinePusher := NewFcm() - resp, err := offlinePusher.Push([]string{"test_uid"}, "哈哈", "嘿嘿", "12321", push.PushOpts{}) + resp, err := offlinePusher.Push([]string{"test_uid"}, "test", "test", "12321", push.PushOpts{}) assert.Nil(t, err) fmt.Println(resp) }