diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..605efd510 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin +logs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..be3279250 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ + +[submodule "cmd/Open-IM-SDK-Core"] + path = cmd/Open-IM-SDK-Core + url = https://github.com/OpenIMSDK/Open-IM-SDK-Core.git diff --git a/README.md b/README.md index 2e0ff1891..86938f001 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ By deployment of the Open-IM-Server on the customer's server, developers can int 2. Clone the Open-IM project to your server. ``` - git clone https://github.com/OpenIMSDK/Open-IM-Server.git + git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive ``` 3. Build and start Service. @@ -86,7 +86,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server 3. Clone the Open-IM project to your server. ``` - git clone https://github.com/OpenIMSDK/Open-IM-Server.git + git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive ``` 4. Start docker-compose with one click(Docker automatically pulls all images) diff --git a/src/api/Makefile b/cmd/open_im_api/Makefile similarity index 69% rename from src/api/Makefile rename to cmd/open_im_api/Makefile index 5ea7e5742..d8fe26099 100644 --- a/src/api/Makefile +++ b/cmd/open_im_api/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_api BIN_DIR=../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build run: @go run ./ diff --git a/src/api/open_im_api.go b/cmd/open_im_api/main.go similarity index 92% rename from src/api/open_im_api.go rename to cmd/open_im_api/main.go index eac0a1fa5..f410b0ec2 100644 --- a/src/api/open_im_api.go +++ b/cmd/open_im_api/main.go @@ -1,14 +1,15 @@ package main import ( - apiAuth "Open_IM/src/api/auth" - apiChat "Open_IM/src/api/chat" - "Open_IM/src/api/friend" - "Open_IM/src/api/group" - "Open_IM/src/api/manage" - apiThird "Open_IM/src/api/third" - "Open_IM/src/api/user" - "Open_IM/src/utils" + apiAuth "Open_IM/internal/api/auth" + apiChat "Open_IM/internal/api/chat" + "Open_IM/internal/api/friend" + "Open_IM/internal/api/group" + "Open_IM/internal/api/manage" + apiThird "Open_IM/internal/api/third" + "Open_IM/internal/api/user" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "flag" "github.com/gin-gonic/gin" "strconv" @@ -93,7 +94,7 @@ func main() { managementGroup.POST("/send_msg", manage.ManagementSendMsg) managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) } - + log.NewPrivateLog("api") ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() r.Run(utils.ServerIP + ":" + strconv.Itoa(*ginPort)) diff --git a/src/msg_gateway/Makefile b/cmd/open_im_msg_gateway/Makefile similarity index 81% rename from src/msg_gateway/Makefile rename to cmd/open_im_msg_gateway/Makefile index 1b6e67e9c..566d8d9c2 100644 --- a/src/msg_gateway/Makefile +++ b/cmd/open_im_msg_gateway/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_msg_gateway BIN_DIR=../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/src/msg_gateway/open_im_msg_gateway.go b/cmd/open_im_msg_gateway/main.go similarity index 88% rename from src/msg_gateway/open_im_msg_gateway.go rename to cmd/open_im_msg_gateway/main.go index 364a7568d..8a022b0d8 100644 --- a/src/msg_gateway/open_im_msg_gateway.go +++ b/cmd/open_im_msg_gateway/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/msg_gateway/gate" + "Open_IM/internal/msg_gateway/gate" "flag" "sync" ) diff --git a/src/msg_transfer/Makefile b/cmd/open_im_msg_transfer/Makefile similarity index 81% rename from src/msg_transfer/Makefile rename to cmd/open_im_msg_transfer/Makefile index 1813594d5..fb4946585 100644 --- a/src/msg_transfer/Makefile +++ b/cmd/open_im_msg_transfer/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_msg_transfer BIN_DIR=../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/src/msg_transfer/open_im_msg_transfer.go b/cmd/open_im_msg_transfer/main.go similarity index 75% rename from src/msg_transfer/open_im_msg_transfer.go rename to cmd/open_im_msg_transfer/main.go index 0a3775113..c5487de26 100644 --- a/src/msg_transfer/open_im_msg_transfer.go +++ b/cmd/open_im_msg_transfer/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/msg_transfer/logic" + "Open_IM/internal/msg_transfer/logic" "sync" ) diff --git a/src/push/Makefile b/cmd/open_im_push/Makefile similarity index 81% rename from src/push/Makefile rename to cmd/open_im_push/Makefile index 73f1fdd35..df7b9e88a 100644 --- a/src/push/Makefile +++ b/cmd/open_im_push/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_push BIN_DIR=../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/src/push/open_im_push.go b/cmd/open_im_push/main.go similarity index 86% rename from src/push/open_im_push.go rename to cmd/open_im_push/main.go index 159ecc6cb..a57a56ba0 100644 --- a/src/push/open_im_push.go +++ b/cmd/open_im_push/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/push/logic" + "Open_IM/internal/push/logic" "flag" "sync" ) diff --git a/src/timed_task/open_im_timed_task.go b/cmd/open_im_timed_task/main.go similarity index 94% rename from src/timed_task/open_im_timed_task.go rename to cmd/open_im_timed_task/main.go index f6cd87a67..1119ce577 100644 --- a/src/timed_task/open_im_timed_task.go +++ b/cmd/open_im_timed_task/main.go @@ -1,8 +1,8 @@ package main import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" "fmt" "time" ) diff --git a/src/rpc/auth/Makefile b/cmd/rpc/open_im_auth/Makefile similarity index 69% rename from src/rpc/auth/Makefile rename to cmd/rpc/open_im_auth/Makefile index 12c10351d..845503757 100644 --- a/src/rpc/auth/Makefile +++ b/cmd/rpc/open_im_auth/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_auth BIN_DIR=../../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build run: @go run ./ diff --git a/src/rpc/auth/open_im_auth.go b/cmd/rpc/open_im_auth/main.go similarity index 84% rename from src/rpc/auth/open_im_auth.go rename to cmd/rpc/open_im_auth/main.go index 765d83264..ed4656d35 100644 --- a/src/rpc/auth/open_im_auth.go +++ b/cmd/rpc/open_im_auth/main.go @@ -1,7 +1,7 @@ package main import ( - rpcAuth "Open_IM/src/rpc/auth/auth" + rpcAuth "Open_IM/internal/rpc/auth" "flag" ) diff --git a/src/rpc/friend/Makefile b/cmd/rpc/open_im_friend/Makefile similarity index 69% rename from src/rpc/friend/Makefile rename to cmd/rpc/open_im_friend/Makefile index c1291dc82..8720ed80f 100644 --- a/src/rpc/friend/Makefile +++ b/cmd/rpc/open_im_friend/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_friend BIN_DIR=../../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build run: @go run ./ diff --git a/src/rpc/friend/open_im_friend.go b/cmd/rpc/open_im_friend/main.go similarity index 86% rename from src/rpc/friend/open_im_friend.go rename to cmd/rpc/open_im_friend/main.go index 088f5a7f4..0847699c5 100644 --- a/src/rpc/friend/open_im_friend.go +++ b/cmd/rpc/open_im_friend/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/friend/friend" + "Open_IM/internal/rpc/friend" "flag" ) diff --git a/src/rpc/group/Makefile b/cmd/rpc/open_im_group/Makefile similarity index 69% rename from src/rpc/group/Makefile rename to cmd/rpc/open_im_group/Makefile index 2ada2e2a6..6cd93dfd4 100644 --- a/src/rpc/group/Makefile +++ b/cmd/rpc/open_im_group/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_group BIN_DIR=../../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build run: @go run ./ diff --git a/src/rpc/group/open_im_group.go b/cmd/rpc/open_im_group/main.go similarity index 87% rename from src/rpc/group/open_im_group.go rename to cmd/rpc/open_im_group/main.go index e5f1df690..8a3f886cb 100644 --- a/src/rpc/group/open_im_group.go +++ b/cmd/rpc/open_im_group/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/group/group" + "Open_IM/internal/rpc/group" "flag" ) diff --git a/src/rpc/chat/Makefile b/cmd/rpc/open_im_msg/Makefile similarity index 81% rename from src/rpc/chat/Makefile rename to cmd/rpc/open_im_msg/Makefile index 2a2d08918..7214d3fe1 100644 --- a/src/rpc/chat/Makefile +++ b/cmd/rpc/open_im_msg/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_msg BIN_DIR=../../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/src/rpc/chat/open_im_msg.go b/cmd/rpc/open_im_msg/main.go similarity index 78% rename from src/rpc/chat/open_im_msg.go rename to cmd/rpc/open_im_msg/main.go index e1a0a11a4..68f5c8931 100644 --- a/src/rpc/chat/open_im_msg.go +++ b/cmd/rpc/open_im_msg/main.go @@ -1,8 +1,8 @@ package main import ( - rpcChat "Open_IM/src/rpc/chat/chat" - "Open_IM/src/utils" + rpcChat "Open_IM/internal/rpc/chat" + "Open_IM/pkg/utils" "flag" ) diff --git a/src/rpc/user/Makefile b/cmd/rpc/open_im_user/Makefile similarity index 69% rename from src/rpc/user/Makefile rename to cmd/rpc/open_im_user/Makefile index d3f837791..4e124cc3a 100644 --- a/src/rpc/user/Makefile +++ b/cmd/rpc/open_im_user/Makefile @@ -2,13 +2,11 @@ BINARY_NAME=open_im_user BIN_DIR=../../../bin/ -LAN_FILE=.go -GO_FILE:=${BINARY_NAME}${LAN_FILE} all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE} + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build run: @go run ./ diff --git a/src/rpc/user/open_im_user.go b/cmd/rpc/open_im_user/main.go similarity index 86% rename from src/rpc/user/open_im_user.go rename to cmd/rpc/open_im_user/main.go index 0625b11ee..91b6e55b5 100644 --- a/src/rpc/user/open_im_user.go +++ b/cmd/rpc/open_im_user/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/user/user" + "Open_IM/internal/rpc/user" "flag" ) diff --git a/config/config.yaml b/config/config.yaml index 5a9573456..37f7c4af1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -5,12 +5,12 @@ #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openIM - etcdAddr: [ 127.0.0.1:2379 ] + etcdAddr: [ 81.68.126.69:2379 ] mysql: - dbMysqlAddress: [ 127.0.0.1:3306 ] - dbMysqlUserName: root - dbMysqlPassword: openIM + dbMysqlAddress: [ 81.68.126.69:13306 ] + dbMysqlUserName: openIM + dbMysqlPassword: 12345 dbMysqlDatabaseName: openIM dbTableName: eMsg dbMsgTableNum: 1 @@ -19,18 +19,18 @@ mysql: dbMaxLifeTime: 120 mongo: - dbAddress: [ 127.0.0.1:27017 ] + dbAddress: [ 81.68.126.69:27017 ] dbDirect: false dbTimeout: 10 dbDatabase: openIM - dbSource: admin - dbUserName: - dbPassword: + dbSource: openIM + dbUserName: openIM + dbPassword: 12345 dbMaxPoolSize: 20 dbRetainChatRecords: 7 redis: - dbAddress: 127.0.0.1:6379 + dbAddress: 81.68.126.69:16379 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 @@ -38,10 +38,10 @@ redis: kafka: ws2mschat: - addr: [ 127.0.0.1:9092 ] + addr: [ 81.68.126.69:9092 ] topic: "ws2ms_chat" ms2pschat: - addr: [ 127.0.0.1:9092 ] + addr: [ 81.68.126.69:9092 ] topic: "ms2ps_chat" consumergroupid: msgToMongo: mongo @@ -59,6 +59,8 @@ serverip: api: openImApiPort: [ 10000 ] +sdk: + openImSdkWsPort: [ 30000 ] credential: tencent: @@ -86,12 +88,13 @@ rpcregistername: openImPushName: Push openImOnlineMessageRelayName: OnlineMessageRelay openImGroupName: Group - rpcGetTokenName: Auth + openImAuthName: Auth log: storageLocation: ../logs/ - rotationTime: 12 - remainRotationCount: 10 + rotationTime: 24 + remainRotationCount: 5 + remainLogLevel: 6 elasticSearchSwitch: false elasticSearchAddr: [ 127.0.0.1:9201 ] elasticSearchUser: "" @@ -103,7 +106,7 @@ modulename: pushName: push longconnsvr: - websocketPort: [ 17778 ] + openImWsPort: [ 17778 ] websocketMaxConnNum: 10000 websocketMaxMsgLen: 4096 websocketTimeOut: 10 diff --git a/deploy.Dockerfile b/deploy.Dockerfile index 3db00340f..1738bda80 100644 --- a/deploy.Dockerfile +++ b/deploy.Dockerfile @@ -28,7 +28,7 @@ RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure #set directory to map logs,config file,script file. -VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"] +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] #Copy scripts files and binary files to the blank image COPY --from=build /Open-IM-Server/script /Open-IM-Server/script @@ -36,4 +36,4 @@ COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin WORKDIR /Open-IM-Server/script -CMD ["./docker_start_all.sh"] \ No newline at end of file +CMD ["./docker_start_all.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 755667982..a9fa9a1c9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -84,25 +84,28 @@ services: #fixme-----build from dockerfile--------- - # open-im-server: - # image: open_im_server - # ports: - # - 10000:10000 - # - 17778:17778 - # container_name: open-im-server - # volumes: - # - ./logs:/Open-IM-Server/logs - # - ./config/config.yaml:/Open-IM-Server/config/config.yaml - # restart: always - # build: - # context: . - # dockerfile: deploy.Dockerfile - # depends_on: - # - mysql - # - mongodb - # - redis - # - kafka - # - etcd + # open-im-server: + # image: open_im_server + # container_name: open-im-server + # volumes: + # - ./logs:/Open-IM-Server/logs + # - ./config/config.yaml:/Open-IM-Server/config/config.yaml + # restart: always + # build: + # context: . + # dockerfile: deploy.Dockerfile + # depends_on: + # - mysql + # - mongodb + # - redis + # - kafka + # - etcd + # network_mode: "host" + # logging: + # driver: json-file + # options: + # max-size: "1g" + # max-file: "2" #fixme----build from docker hub------ open-im-server: diff --git a/src/api/auth/user_register.go b/internal/api/auth/user_register.go similarity index 95% rename from src/api/auth/user_register.go rename to internal/api/auth/user_register.go index 72c567df9..3f840d1a6 100644 --- a/src/api/auth/user_register.go +++ b/internal/api/auth/user_register.go @@ -1,10 +1,10 @@ package apiAuth import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/src/proto/auth" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" @@ -40,7 +40,7 @@ func newUserRegisterReq(params *paramsUserRegister) *pbAuth.UserRegisterReq { func UserRegister(c *gin.Context) { log.Info("", "", "api user_register init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.RpcGetTokenName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) client := pbAuth.NewAuthClient(etcdConn) //defer etcdConn.Close() diff --git a/src/api/auth/user_token.go b/internal/api/auth/user_token.go similarity index 89% rename from src/api/auth/user_token.go rename to internal/api/auth/user_token.go index 5400d8e69..83c923d21 100644 --- a/src/api/auth/user_token.go +++ b/internal/api/auth/user_token.go @@ -1,10 +1,10 @@ package apiAuth import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/src/proto/auth" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" @@ -13,7 +13,7 @@ import ( type paramsUserToken struct { Secret string `json:"secret" binding:"required,max=32"` - Platform int32 `json:"platform" binding:"required,min=1,max=7"` + Platform int32 `json:"platform" binding:"required,min=1,max=8"` UID string `json:"uid" binding:"required,min=1,max=64"` } @@ -27,7 +27,7 @@ func newUserTokenReq(params *paramsUserToken) *pbAuth.UserTokenReq { func UserToken(c *gin.Context) { log.Info("", "", "api user_token init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.RpcGetTokenName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) client := pbAuth.NewAuthClient(etcdConn) //defer etcdConn.Close() diff --git a/src/api/chat/newest_seq.go b/internal/api/chat/newest_seq.go similarity index 91% rename from src/api/chat/newest_seq.go rename to internal/api/chat/newest_seq.go index 9fa7e1836..06dad284e 100644 --- a/src/api/chat/newest_seq.go +++ b/internal/api/chat/newest_seq.go @@ -1,11 +1,11 @@ package apiChat import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbMsg "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go similarity index 94% rename from src/api/chat/pull_msg.go rename to internal/api/chat/pull_msg.go index 7e62d4f7d..b8224064d 100644 --- a/src/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -1,11 +1,11 @@ package apiChat import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/chat/send_msg.go b/internal/api/chat/send_msg.go similarity index 95% rename from src/api/chat/send_msg.go rename to internal/api/chat/send_msg.go index ede81abdd..e2975e759 100644 --- a/src/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -1,13 +1,13 @@ package apiChat import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "context" - "Open_IM/src/grpc-etcdv3/getcdv3" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "github.com/gin-gonic/gin" "net/http" "strings" diff --git a/src/api/friend/add_blacklist.go b/internal/api/friend/add_blacklist.go similarity index 92% rename from src/api/friend/add_blacklist.go rename to internal/api/friend/add_blacklist.go index 1e03b53ec..e0969faf3 100644 --- a/src/api/friend/add_blacklist.go +++ b/internal/api/friend/add_blacklist.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/friend/add_friend.go b/internal/api/friend/add_friend.go similarity index 95% rename from src/api/friend/add_friend.go rename to internal/api/friend/add_friend.go index 40fee7dac..63f8be35b 100644 --- a/src/api/friend/add_friend.go +++ b/internal/api/friend/add_friend.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/friend/add_friend_response.go b/internal/api/friend/add_friend_response.go similarity index 93% rename from src/api/friend/add_friend_response.go rename to internal/api/friend/add_friend_response.go index 762daa798..37e801b3e 100644 --- a/src/api/friend/add_friend_response.go +++ b/internal/api/friend/add_friend_response.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/friend/delete_friend.go b/internal/api/friend/delete_friend.go similarity index 92% rename from src/api/friend/delete_friend.go rename to internal/api/friend/delete_friend.go index 47700f423..4bdbedeee 100644 --- a/src/api/friend/delete_friend.go +++ b/internal/api/friend/delete_friend.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/friend/get_blcaklist.go b/internal/api/friend/get_blcaklist.go similarity index 94% rename from src/api/friend/get_blcaklist.go rename to internal/api/friend/get_blcaklist.go index b1eb995dd..5e875a5e8 100644 --- a/src/api/friend/get_blcaklist.go +++ b/internal/api/friend/get_blcaklist.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/friend/get_friend_apply_list.go b/internal/api/friend/get_friend_apply_list.go similarity index 97% rename from src/api/friend/get_friend_apply_list.go rename to internal/api/friend/get_friend_apply_list.go index 4fb55cf50..d7ca192e4 100644 --- a/src/api/friend/get_friend_apply_list.go +++ b/internal/api/friend/get_friend_apply_list.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/friend/get_friend_list.go b/internal/api/friend/get_friend_list.go similarity index 95% rename from src/api/friend/get_friend_list.go rename to internal/api/friend/get_friend_list.go index f7813cd6c..db1361572 100644 --- a/src/api/friend/get_friend_list.go +++ b/internal/api/friend/get_friend_list.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/friend/get_friends_info.go b/internal/api/friend/get_friends_info.go similarity index 94% rename from src/api/friend/get_friends_info.go rename to internal/api/friend/get_friends_info.go index 21266d032..47ee88a10 100644 --- a/src/api/friend/get_friends_info.go +++ b/internal/api/friend/get_friends_info.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/friend/is_friend.go b/internal/api/friend/is_friend.go similarity index 92% rename from src/api/friend/is_friend.go rename to internal/api/friend/is_friend.go index f3a7544e2..e10c969f3 100644 --- a/src/api/friend/is_friend.go +++ b/internal/api/friend/is_friend.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/friend/remove_blacklist.go b/internal/api/friend/remove_blacklist.go similarity index 92% rename from src/api/friend/remove_blacklist.go rename to internal/api/friend/remove_blacklist.go index c5fe87132..57a018513 100644 --- a/src/api/friend/remove_blacklist.go +++ b/internal/api/friend/remove_blacklist.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/friend/set_friend_comment.go b/internal/api/friend/set_friend_comment.go similarity index 92% rename from src/api/friend/set_friend_comment.go rename to internal/api/friend/set_friend_comment.go index 70816ddd4..e16f7e598 100644 --- a/src/api/friend/set_friend_comment.go +++ b/internal/api/friend/set_friend_comment.go @@ -1,10 +1,10 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/create_group.go b/internal/api/group/create_group.go similarity index 93% rename from src/api/group/create_group.go rename to internal/api/group/create_group.go index 9c1a34713..fd9cc14f7 100644 --- a/src/api/group/create_group.go +++ b/internal/api/group/create_group.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" @@ -40,7 +40,7 @@ func CreateGroup(c *gin.Context) { Notification: params.Notification, FaceUrl: params.FaceUrl, OperationID: params.OperationID, - Ex: params.Ex, + Ex: params.Ex, Token: c.Request.Header.Get("token"), } log.Info(req.Token, req.OperationID, "api create group is server,params=%s", req.String()) diff --git a/src/api/group/get_group_applicationList.go b/internal/api/group/get_group_applicationList.go similarity index 96% rename from src/api/group/get_group_applicationList.go rename to internal/api/group/get_group_applicationList.go index 5995004cf..faceb921e 100644 --- a/src/api/group/get_group_applicationList.go +++ b/internal/api/group/get_group_applicationList.go @@ -1,11 +1,11 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/get_groups_info.go b/internal/api/group/get_groups_info.go similarity index 94% rename from src/api/group/get_groups_info.go rename to internal/api/group/get_groups_info.go index 8cf9d0fee..b2825485a 100644 --- a/src/api/group/get_groups_info.go +++ b/internal/api/group/get_groups_info.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/group.go b/internal/api/group/group.go similarity index 98% rename from src/api/group/group.go rename to internal/api/group/group.go index 1ccecfe06..e26d235b2 100644 --- a/src/api/group/group.go +++ b/internal/api/group/group.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "fmt" "github.com/gin-gonic/gin" diff --git a/src/api/group/group_application_response.go b/internal/api/group/group_application_response.go similarity index 95% rename from src/api/group/group_application_response.go rename to internal/api/group/group_application_response.go index 76c6b6802..70dd966eb 100644 --- a/src/api/group/group_application_response.go +++ b/internal/api/group/group_application_response.go @@ -1,11 +1,11 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/join_group.go b/internal/api/group/join_group.go similarity index 92% rename from src/api/group/join_group.go rename to internal/api/group/join_group.go index 08c58f0df..5e85e288e 100644 --- a/src/api/group/join_group.go +++ b/internal/api/group/join_group.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/quit_group.go b/internal/api/group/quit_group.go similarity index 92% rename from src/api/group/quit_group.go rename to internal/api/group/quit_group.go index 06ec78686..1caea9d0a 100644 --- a/src/api/group/quit_group.go +++ b/internal/api/group/quit_group.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/set_group_info.go b/internal/api/group/set_group_info.go similarity index 93% rename from src/api/group/set_group_info.go rename to internal/api/group/set_group_info.go index dde4fc6e1..03a3f8c43 100644 --- a/src/api/group/set_group_info.go +++ b/internal/api/group/set_group_info.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pb "Open_IM/src/proto/group" + pb "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/group/transfer_group_owner.go b/internal/api/group/transfer_group_owner.go similarity index 93% rename from src/api/group/transfer_group_owner.go rename to internal/api/group/transfer_group_owner.go index d01429ada..f7baaba3f 100644 --- a/src/api/group/transfer_group_owner.go +++ b/internal/api/group/transfer_group_owner.go @@ -1,11 +1,11 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/manage/management_chat.go b/internal/api/manage/management_chat.go similarity index 97% rename from src/api/manage/management_chat.go rename to internal/api/manage/management_chat.go index fd9c89b27..8430c7470 100644 --- a/src/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -7,12 +7,12 @@ package manage import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" diff --git a/src/api/manage/management_user.go b/internal/api/manage/management_user.go similarity index 95% rename from src/api/manage/management_user.go rename to internal/api/manage/management_user.go index 578788c8d..cd43fd59b 100644 --- a/src/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -7,10 +7,10 @@ package manage import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbUser "Open_IM/src/proto/user" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/third/tencent_cloud_storage_credential.go b/internal/api/third/tencent_cloud_storage_credential.go similarity index 97% rename from src/api/third/tencent_cloud_storage_credential.go rename to internal/api/third/tencent_cloud_storage_credential.go index 5c6628d02..af68d8fd8 100644 --- a/src/api/third/tencent_cloud_storage_credential.go +++ b/internal/api/third/tencent_cloud_storage_credential.go @@ -1,8 +1,8 @@ package apiThird import ( - "Open_IM/src/common/config" - log2 "Open_IM/src/common/log" + "Open_IM/pkg/common/config" + log2 "Open_IM/pkg/common/log" "github.com/gin-gonic/gin" sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" "net/http" diff --git a/src/api/user/get_user_info.go b/internal/api/user/get_user_info.go similarity index 94% rename from src/api/user/get_user_info.go rename to internal/api/user/get_user_info.go index 79e79e26c..4e93787b5 100644 --- a/src/api/user/get_user_info.go +++ b/internal/api/user/get_user_info.go @@ -1,10 +1,10 @@ package user import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbUser "Open_IM/src/proto/user" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/api/user/update_user_info.go b/internal/api/user/update_user_info.go similarity index 94% rename from src/api/user/update_user_info.go rename to internal/api/user/update_user_info.go index 0e296452e..1bcc32117 100644 --- a/src/api/user/update_user_info.go +++ b/internal/api/user/update_user_info.go @@ -1,10 +1,10 @@ package user import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbUser "Open_IM/src/proto/user" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "github.com/gin-gonic/gin" "net/http" diff --git a/src/msg_gateway/gate/init.go b/internal/msg_gateway/gate/init.go similarity index 88% rename from src/msg_gateway/gate/init.go rename to internal/msg_gateway/gate/init.go index 510cdaefc..03f82f3ad 100644 --- a/src/msg_gateway/gate/init.go +++ b/internal/msg_gateway/gate/init.go @@ -1,8 +1,8 @@ package gate import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" "github.com/go-playground/validator/v10" "sync" ) diff --git a/src/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go similarity index 97% rename from src/msg_gateway/gate/logic.go rename to internal/msg_gateway/gate/logic.go index a79fd25c6..ab20158cd 100644 --- a/src/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -1,12 +1,12 @@ package gate import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "context" "encoding/json" "github.com/gorilla/websocket" diff --git a/src/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go similarity index 96% rename from src/msg_gateway/gate/rpc_server.go rename to internal/msg_gateway/gate/rpc_server.go index e9aa28033..fc43493e3 100644 --- a/src/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -1,12 +1,12 @@ package gate import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbRelay "Open_IM/src/proto/relay" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/utils" "context" "encoding/json" "fmt" diff --git a/src/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go similarity index 97% rename from src/msg_gateway/gate/validate.go rename to internal/msg_gateway/gate/validate.go index a7a75f8e8..8c701576e 100644 --- a/src/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -7,8 +7,8 @@ package gate import ( - "Open_IM/src/common/constant" - "Open_IM/src/common/log" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" "github.com/mitchellh/mapstructure" ) diff --git a/src/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go similarity index 98% rename from src/msg_gateway/gate/ws_server.go rename to internal/msg_gateway/gate/ws_server.go index ffc14680d..1a0f5a1a2 100644 --- a/src/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -1,9 +1,9 @@ package gate import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "github.com/gorilla/websocket" "net/http" "time" diff --git a/src/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go similarity index 76% rename from src/msg_transfer/logic/db.go rename to internal/msg_transfer/logic/db.go index 93dccfc2b..d88d6d452 100644 --- a/src/msg_transfer/logic/db.go +++ b/internal/msg_transfer/logic/db.go @@ -1,9 +1,9 @@ package logic import ( - "Open_IM/src/common/db" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - pbMsg "Open_IM/src/proto/chat" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" ) func saveUserChat(uid string, pbMsg *pbMsg.MsgSvrToPushSvrChatMsg) error { diff --git a/src/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go similarity index 96% rename from src/msg_transfer/logic/history_msg_handler.go rename to internal/msg_transfer/logic/history_msg_handler.go index bea5c20b4..9833bf05b 100644 --- a/src/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -1,14 +1,14 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - kfk "Open_IM/src/common/kafka" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbMsg "Open_IM/src/proto/chat" - pbPush "Open_IM/src/proto/push" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMsg "Open_IM/pkg/proto/chat" + pbPush "Open_IM/pkg/proto/push" + "Open_IM/pkg/utils" "context" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" diff --git a/src/msg_transfer/logic/init.go b/internal/msg_transfer/logic/init.go similarity index 87% rename from src/msg_transfer/logic/init.go rename to internal/msg_transfer/logic/init.go index 03a7d2c33..cce434d99 100644 --- a/src/msg_transfer/logic/init.go +++ b/internal/msg_transfer/logic/init.go @@ -1,9 +1,9 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/kafka" - "Open_IM/src/common/log" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" ) var ( diff --git a/src/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go similarity index 92% rename from src/msg_transfer/logic/persistent_msg_handler.go rename to internal/msg_transfer/logic/persistent_msg_handler.go index 2c7df4b7c..88039041c 100644 --- a/src/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -7,13 +7,13 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_msg_model" - kfk "Open_IM/src/common/kafka" - "Open_IM/src/common/log" - pbMsg "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_msg_model" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" "strings" diff --git a/src/push/content_struct/content.go b/internal/push/content_struct/content.go similarity index 100% rename from src/push/content_struct/content.go rename to internal/push/content_struct/content.go diff --git a/src/push/logic/init.go b/internal/push/logic/init.go similarity index 86% rename from src/push/logic/init.go rename to internal/push/logic/init.go index a7be054b8..be36469b2 100644 --- a/src/push/logic/init.go +++ b/internal/push/logic/init.go @@ -7,10 +7,10 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/kafka" - "Open_IM/src/common/log" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" ) var ( diff --git a/src/push/logic/push_handler.go b/internal/push/logic/push_handler.go similarity index 93% rename from src/push/logic/push_handler.go rename to internal/push/logic/push_handler.go index 01a6115f4..22382a5b9 100644 --- a/src/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -7,11 +7,11 @@ package logic import ( - "Open_IM/src/common/config" - kfk "Open_IM/src/common/kafka" - "Open_IM/src/common/log" - pbChat "Open_IM/src/proto/chat" - pbRelay "Open_IM/src/proto/relay" + "Open_IM/pkg/common/config" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbRelay "Open_IM/pkg/proto/relay" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) diff --git a/src/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go similarity index 92% rename from src/push/logic/push_rpc_server.go rename to internal/push/logic/push_rpc_server.go index ed128790c..ca0e93880 100644 --- a/src/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -1,12 +1,12 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - "Open_IM/src/proto/push" - pbRelay "Open_IM/src/proto/relay" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/push" + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/utils" "context" "google.golang.org/grpc" "net" diff --git a/src/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go similarity index 93% rename from src/push/logic/push_to_client.go rename to internal/push/logic/push_to_client.go index c52ff0a61..17ac47076 100644 --- a/src/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -7,17 +7,17 @@ package logic import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - pbGroup "Open_IM/src/proto/group" - pbRelay "Open_IM/src/proto/relay" - pbGetInfo "Open_IM/src/proto/user" - rpcChat "Open_IM/src/rpc/chat/chat" - "Open_IM/src/rpc/user/internal_service" - "Open_IM/src/utils" + rpcChat "Open_IM/internal/rpc/chat" + "Open_IM/internal/rpc/user/internal_service" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbGroup "Open_IM/pkg/proto/group" + pbRelay "Open_IM/pkg/proto/relay" + pbGetInfo "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "encoding/json" "fmt" diff --git a/src/push/logic/tpns.go b/internal/push/logic/tpns.go similarity index 75% rename from src/push/logic/tpns.go rename to internal/push/logic/tpns.go index 616c9c099..3d737f4a7 100644 --- a/src/push/logic/tpns.go +++ b/internal/push/logic/tpns.go @@ -1,11 +1,11 @@ package logic import ( - "Open_IM/src/common/config" - tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go" - "Open_IM/src/push/sdk/tpns-server-sdk-go/go/auth" - "Open_IM/src/push/sdk/tpns-server-sdk-go/go/common" - "Open_IM/src/push/sdk/tpns-server-sdk-go/go/req" + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/auth" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/common" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/req" + "Open_IM/pkg/common/config" ) var badgeType = -2 diff --git a/src/push/sdk/tpns-server-sdk-go/go/auth/auth.go b/internal/push/sdk/tpns-server-sdk-go/go/auth/auth.go similarity index 100% rename from src/push/sdk/tpns-server-sdk-go/go/auth/auth.go rename to internal/push/sdk/tpns-server-sdk-go/go/auth/auth.go diff --git a/src/push/sdk/tpns-server-sdk-go/go/client/client.go b/internal/push/sdk/tpns-server-sdk-go/go/client/client.go similarity index 100% rename from src/push/sdk/tpns-server-sdk-go/go/client/client.go rename to internal/push/sdk/tpns-server-sdk-go/go/client/client.go diff --git a/src/push/sdk/tpns-server-sdk-go/go/common/http_helper.go b/internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go similarity index 95% rename from src/push/sdk/tpns-server-sdk-go/go/common/http_helper.go rename to internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go index 31ef387ff..6c010c4f4 100644 --- a/src/push/sdk/tpns-server-sdk-go/go/common/http_helper.go +++ b/internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go @@ -1,7 +1,7 @@ package common import ( - tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go" + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" "encoding/json" "fmt" "io/ioutil" diff --git a/src/push/sdk/tpns-server-sdk-go/go/common/json_helper.go b/internal/push/sdk/tpns-server-sdk-go/go/common/json_helper.go similarity index 100% rename from src/push/sdk/tpns-server-sdk-go/go/common/json_helper.go rename to internal/push/sdk/tpns-server-sdk-go/go/common/json_helper.go diff --git a/src/push/sdk/tpns-server-sdk-go/go/def.go b/internal/push/sdk/tpns-server-sdk-go/go/def.go similarity index 100% rename from src/push/sdk/tpns-server-sdk-go/go/def.go rename to internal/push/sdk/tpns-server-sdk-go/go/def.go diff --git a/src/push/sdk/tpns-server-sdk-go/go/req/req.go b/internal/push/sdk/tpns-server-sdk-go/go/req/req.go similarity index 99% rename from src/push/sdk/tpns-server-sdk-go/go/req/req.go rename to internal/push/sdk/tpns-server-sdk-go/go/req/req.go index cc4195ec7..7afc07004 100644 --- a/src/push/sdk/tpns-server-sdk-go/go/req/req.go +++ b/internal/push/sdk/tpns-server-sdk-go/go/req/req.go @@ -1,7 +1,7 @@ package req import ( - tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go" + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" "bytes" "encoding/json" "io" diff --git a/src/rpc/auth/auth/rpcAuth.go b/internal/rpc/auth/rpcAuth.go similarity index 58% rename from src/rpc/auth/auth/rpcAuth.go rename to internal/rpc/auth/rpcAuth.go index 237fc9bab..162f04fd5 100644 --- a/src/rpc/auth/auth/rpcAuth.go +++ b/internal/rpc/auth/rpcAuth.go @@ -1,11 +1,11 @@ -package rpcAuth +package auth import ( - "Open_IM/src/common/config" - log2 "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/src/proto/auth" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/utils" "google.golang.org/grpc" "net" "strconv" @@ -20,24 +20,25 @@ type rpcAuth struct { } func NewRpcAuthServer(port int) *rpcAuth { + log.NewPrivateLog("auth") return &rpcAuth{ rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.RpcGetTokenName, + rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName, etcdSchema: config.Config.Etcd.EtcdSchema, etcdAddr: config.Config.Etcd.EtcdAddr, } } func (rpc *rpcAuth) Run() { - log2.Info("", "", "rpc get_token init...") + log.Info("", "", "rpc get_token init...") address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) listener, err := net.Listen("tcp", address) if err != nil { - log2.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) + log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) return } - log2.Info("", "", "listen network success, address = %s", address) + log.Info("", "", "listen network success, address = %s", address) //grpc server srv := grpc.NewServer() @@ -48,14 +49,14 @@ func (rpc *rpcAuth) Run() { pbAuth.RegisterAuthServer(srv, rpc) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { - log2.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) + log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) return } err = srv.Serve(listener) if err != nil { - log2.Info("", "", "rpc get_token fail, err = %s", err.Error()) + log.Info("", "", "rpc get_token fail, err = %s", err.Error()) return } - log2.Info("", "", "rpc get_token init success") + log.Info("", "", "rpc get_token init success") } diff --git a/src/rpc/auth/auth/user_register.go b/internal/rpc/auth/user_register.go similarity index 80% rename from src/rpc/auth/auth/user_register.go rename to internal/rpc/auth/user_register.go index aa2bc40f3..3f5de7032 100644 --- a/src/rpc/auth/auth/user_register.go +++ b/internal/rpc/auth/user_register.go @@ -1,9 +1,9 @@ -package rpcAuth +package auth import ( - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbAuth "Open_IM/src/proto/auth" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbAuth "Open_IM/pkg/proto/auth" "context" ) diff --git a/src/rpc/auth/auth/user_token.go b/internal/rpc/auth/user_token.go similarity index 87% rename from src/rpc/auth/auth/user_token.go rename to internal/rpc/auth/user_token.go index 59e91c33b..73b544d64 100644 --- a/src/rpc/auth/auth/user_token.go +++ b/internal/rpc/auth/user_token.go @@ -1,10 +1,10 @@ -package rpcAuth +package auth import ( - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbAuth "Open_IM/src/proto/auth" - "Open_IM/src/utils" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/chat/chat/pull_message.go b/internal/rpc/chat/pull_message.go similarity index 97% rename from src/rpc/chat/chat/pull_message.go rename to internal/rpc/chat/pull_message.go index 744ae1a36..941c3a9b1 100644 --- a/src/rpc/chat/chat/pull_message.go +++ b/internal/rpc/chat/pull_message.go @@ -1,16 +1,16 @@ -package rpcChat +package chat import ( "context" "github.com/garyburd/redigo/redis" - commonDB "Open_IM/src/common/db" - "Open_IM/src/common/log" + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" "sort" "strings" - pbMsg "Open_IM/src/proto/chat" + pbMsg "Open_IM/pkg/proto/chat" ) func (rpc *rpcChat) GetNewSeq(_ context.Context, in *pbMsg.GetNewSeqReq) (*pbMsg.GetNewSeqResp, error) { diff --git a/src/rpc/chat/chat/rpcChat.go b/internal/rpc/chat/rpcChat.go similarity index 64% rename from src/rpc/chat/chat/rpcChat.go rename to internal/rpc/chat/rpcChat.go index ca5aeefa0..e3d2460dd 100644 --- a/src/rpc/chat/chat/rpcChat.go +++ b/internal/rpc/chat/rpcChat.go @@ -1,12 +1,12 @@ -package rpcChat +package chat import ( - "Open_IM/src/common/config" - "Open_IM/src/common/kafka" - log2 "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "google.golang.org/grpc" "net" "strconv" @@ -22,6 +22,7 @@ type rpcChat struct { } func NewRpcChatServer(port int) *rpcChat { + log.NewPrivateLog("msg") rc := rpcChat{ rpcPort: port, rpcRegisterName: config.Config.RpcRegisterName.OpenImOfflineMessageName, @@ -33,15 +34,15 @@ func NewRpcChatServer(port int) *rpcChat { } func (rpc *rpcChat) Run() { - log2.Info("", "", "rpc get_token init...") + log.Info("", "", "rpc get_token init...") address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) listener, err := net.Listen("tcp", address) if err != nil { - log2.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) + log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) return } - log2.Info("", "", "listen network success, address = %s", address) + log.Info("", "", "listen network success, address = %s", address) //grpc server srv := grpc.NewServer() @@ -52,14 +53,14 @@ func (rpc *rpcChat) Run() { pbChat.RegisterChatServer(srv, rpc) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { - log2.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) + log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) return } err = srv.Serve(listener) if err != nil { - log2.Info("", "", "rpc get_token fail, err = %s", err.Error()) + log.Info("", "", "rpc get_token fail, err = %s", err.Error()) return } - log2.Info("", "", "rpc get_token init success") + log.Info("", "", "rpc get_token init success") } diff --git a/src/rpc/chat/chat/send_msg.go b/internal/rpc/chat/send_msg.go similarity index 95% rename from src/rpc/chat/chat/send_msg.go rename to internal/rpc/chat/send_msg.go index 21a1a7be8..87f363a8f 100644 --- a/src/rpc/chat/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -1,16 +1,16 @@ -package rpcChat +package chat import ( - "Open_IM/src/api/group" - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - http2 "Open_IM/src/common/http" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/push/content_struct" - "Open_IM/src/utils" + "Open_IM/internal/api/group" + "Open_IM/internal/push/content_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + http2 "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "encoding/json" "math/rand" diff --git a/src/rpc/friend/friend/add_blacklist.go b/internal/rpc/friend/add_blacklist.go similarity index 90% rename from src/rpc/friend/friend/add_blacklist.go rename to internal/rpc/friend/add_blacklist.go index 7efe4e226..f490a2934 100644 --- a/src/rpc/friend/friend/add_blacklist.go +++ b/internal/rpc/friend/add_blacklist.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/add_friend.go b/internal/rpc/friend/add_friend.go similarity index 91% rename from src/rpc/friend/friend/add_friend.go rename to internal/rpc/friend/add_friend.go index 6fd9f4b27..f43c7b8f7 100644 --- a/src/rpc/friend/friend/add_friend.go +++ b/internal/rpc/friend/add_friend.go @@ -1,15 +1,15 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbChat "Open_IM/src/proto/chat" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" - "Open_IM/src/utils" + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) @@ -110,6 +110,10 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri SessionType: constant.SingleChatType, OperationID: req.OperationID, }) + } else { + resp.CommonResp.ErrorMsg = "some uid establish failed" + resp.CommonResp.ErrorCode = 408 + resp.FailedUidList = append(resp.FailedUidList, v) } } } diff --git a/src/rpc/friend/friend/add_friend_response.go b/internal/rpc/friend/add_friend_response.go similarity index 92% rename from src/rpc/friend/friend/add_friend_response.go rename to internal/rpc/friend/add_friend_response.go index f372f03a6..048110a23 100644 --- a/src/rpc/friend/friend/add_friend_response.go +++ b/internal/rpc/friend/add_friend_response.go @@ -1,15 +1,15 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbChat "Open_IM/src/proto/chat" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" - "Open_IM/src/utils" + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/delete_friend.go b/internal/rpc/friend/delete_friend.go similarity index 85% rename from src/rpc/friend/friend/delete_friend.go rename to internal/rpc/friend/delete_friend.go index fba59d212..2b11988b8 100644 --- a/src/rpc/friend/friend/delete_friend.go +++ b/internal/rpc/friend/delete_friend.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/get_blacklist.go b/internal/rpc/friend/get_blacklist.go similarity index 91% rename from src/rpc/friend/friend/get_blacklist.go rename to internal/rpc/friend/get_blacklist.go index 421081b1a..99d57fb25 100644 --- a/src/rpc/friend/friend/get_blacklist.go +++ b/internal/rpc/friend/get_blacklist.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/get_firends_info.go b/internal/rpc/friend/get_firends_info.go similarity index 92% rename from src/rpc/friend/friend/get_firends_info.go rename to internal/rpc/friend/get_firends_info.go index 1da6ebaaf..1aa34a43b 100644 --- a/src/rpc/friend/friend/get_firends_info.go +++ b/internal/rpc/friend/get_firends_info.go @@ -1,13 +1,13 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" "fmt" "google.golang.org/grpc" @@ -24,6 +24,7 @@ type friendServer struct { } func NewFriendServer(port int) *friendServer { + log.NewPrivateLog("friend") return &friendServer{ rpcPort: port, rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName, diff --git a/src/rpc/friend/friend/get_friend_apply_list.go b/internal/rpc/friend/get_friend_apply_list.go similarity index 95% rename from src/rpc/friend/friend/get_friend_apply_list.go rename to internal/rpc/friend/get_friend_apply_list.go index 5e8e15a0f..556576f71 100644 --- a/src/rpc/friend/friend/get_friend_apply_list.go +++ b/internal/rpc/friend/get_friend_apply_list.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" "fmt" "strconv" diff --git a/src/rpc/friend/friend/get_friend_list.go b/internal/rpc/friend/get_friend_list.go similarity index 90% rename from src/rpc/friend/friend/get_friend_list.go rename to internal/rpc/friend/get_friend_list.go index 92809ad7f..0674cdc53 100644 --- a/src/rpc/friend/friend/get_friend_list.go +++ b/internal/rpc/friend/get_friend_list.go @@ -1,12 +1,12 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/is_friend.go b/internal/rpc/friend/is_friend.go similarity index 80% rename from src/rpc/friend/friend/is_friend.go rename to internal/rpc/friend/is_friend.go index f64f3f00f..3690423e7 100644 --- a/src/rpc/friend/friend/is_friend.go +++ b/internal/rpc/friend/is_friend.go @@ -1,12 +1,12 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" "fmt" ) diff --git a/src/rpc/friend/friend/is_in_blacklist.go b/internal/rpc/friend/is_in_blacklist.go similarity index 82% rename from src/rpc/friend/friend/is_in_blacklist.go rename to internal/rpc/friend/is_in_blacklist.go index 3e3e8caa2..6275f5300 100644 --- a/src/rpc/friend/friend/is_in_blacklist.go +++ b/internal/rpc/friend/is_in_blacklist.go @@ -1,9 +1,9 @@ package friend import ( - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" ) diff --git a/src/rpc/friend/friend/remove_blacklist.go b/internal/rpc/friend/remove_blacklist.go similarity index 85% rename from src/rpc/friend/friend/remove_blacklist.go rename to internal/rpc/friend/remove_blacklist.go index 7d13d8a2f..af163e86d 100644 --- a/src/rpc/friend/friend/remove_blacklist.go +++ b/internal/rpc/friend/remove_blacklist.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/friend/friend/set_friend_comment.go b/internal/rpc/friend/set_friend_comment.go similarity index 85% rename from src/rpc/friend/friend/set_friend_comment.go rename to internal/rpc/friend/set_friend_comment.go index 66c974f47..8b7331935 100644 --- a/src/rpc/friend/friend/set_friend_comment.go +++ b/internal/rpc/friend/set_friend_comment.go @@ -1,11 +1,11 @@ package friend import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbFriend "Open_IM/pkg/proto/friend" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/group/group/create_group.go b/internal/rpc/group/create_group.go similarity index 93% rename from src/rpc/group/group/create_group.go rename to internal/rpc/group/create_group.go index 4aeb073d7..b95394efd 100644 --- a/src/rpc/group/group/create_group.go +++ b/internal/rpc/group/create_group.go @@ -1,17 +1,17 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" - "Open_IM/src/utils" + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "google.golang.org/grpc" "net" @@ -28,6 +28,7 @@ type groupServer struct { } func NewGroupServer(port int) *groupServer { + log.NewPrivateLog("group") return &groupServer{ rpcPort: port, rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName, diff --git a/src/rpc/group/group/get_group_applicationList.go b/internal/rpc/group/get_group_applicationList.go similarity index 87% rename from src/rpc/group/group/get_group_applicationList.go rename to internal/rpc/group/get_group_applicationList.go index 72cb6e750..a08b32f8e 100644 --- a/src/rpc/group/group/get_group_applicationList.go +++ b/internal/rpc/group/get_group_applicationList.go @@ -1,9 +1,9 @@ package group import ( - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/proto/group" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/group" "context" ) diff --git a/src/rpc/group/group/get_groups_info.go b/internal/rpc/group/get_groups_info.go similarity index 90% rename from src/rpc/group/group/get_groups_info.go rename to internal/rpc/group/get_groups_info.go index a7fecc773..667e3c84f 100644 --- a/src/rpc/group/group/get_groups_info.go +++ b/internal/rpc/group/get_groups_info.go @@ -1,11 +1,11 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/group/group/group.go b/internal/rpc/group/group.go similarity index 95% rename from src/rpc/group/group/group.go rename to internal/rpc/group/group.go index e1e1426b1..63c25c69c 100644 --- a/src/rpc/group/group/group.go +++ b/internal/rpc/group/group.go @@ -1,18 +1,18 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + pbChat "Open_IM/pkg/proto/chat" "encoding/json" - imdb "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/utils" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" "fmt" @@ -81,7 +81,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite log.Error(claims.UID, req.OperationID, "FindUserByUID failed, err: ", err.Error()) return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil }*/ - + var nicknameList string for _, v := range req.UidList { var resultNode pbGroup.Id2Result resultNode.UId = v @@ -113,7 +113,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite if err != nil { log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) } - + nicknameList = nicknameList + toUserInfo.Name + " " resp.Id2Result = append(resp.Id2Result, &resultNode) } resp.ErrorCode = 0 @@ -121,12 +121,13 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite //if claims.UID == config.Config.AppManagerUid if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { + m, _ := imdb.FindUserByUID(claims.UID) var iu inviteUserToGroupReq iu.GroupID = req.GroupID iu.OperationID = req.OperationID iu.Reason = req.Reason iu.UidList = req.UidList - n := content_struct.NotificationContent{1, req.GroupID, iu.ContentToString()} + n := content_struct.NotificationContent{1, nicknameList + " invited into the group chat by " + m.Name, iu.ContentToString()} logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ SendID: claims.UID, RecvID: req.GroupID, diff --git a/src/rpc/group/group/group_application_response.go b/internal/rpc/group/group_application_response.go similarity index 90% rename from src/rpc/group/group/group_application_response.go rename to internal/rpc/group/group_application_response.go index fc0da6306..4282de51b 100644 --- a/src/rpc/group/group/group_application_response.go +++ b/internal/rpc/group/group_application_response.go @@ -1,10 +1,10 @@ package group import ( - "Open_IM/src/common/db" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/proto/group" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/group" "context" ) diff --git a/src/rpc/group/group/join_group.go b/internal/rpc/group/join_group.go similarity index 93% rename from src/rpc/group/group/join_group.go rename to internal/rpc/group/join_group.go index a3993f67d..4b1c88c89 100644 --- a/src/rpc/group/group/join_group.go +++ b/internal/rpc/group/join_group.go @@ -1,11 +1,11 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/group/group/quit_group.go b/internal/rpc/group/quit_group.go similarity index 92% rename from src/rpc/group/group/quit_group.go rename to internal/rpc/group/quit_group.go index 9d3a35448..5906832a2 100644 --- a/src/rpc/group/group/quit_group.go +++ b/internal/rpc/group/quit_group.go @@ -1,12 +1,12 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/group/group/set_group_info.go b/internal/rpc/group/set_group_info.go similarity index 90% rename from src/rpc/group/group/set_group_info.go rename to internal/rpc/group/set_group_info.go index cecec8445..046f8bc4f 100644 --- a/src/rpc/group/group/set_group_info.go +++ b/internal/rpc/group/set_group_info.go @@ -1,12 +1,12 @@ package group import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbGroup "Open_IM/src/proto/group" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbGroup "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/group/group/transfer_group_owner.go b/internal/rpc/group/transfer_group_owner.go similarity index 84% rename from src/rpc/group/group/transfer_group_owner.go rename to internal/rpc/group/transfer_group_owner.go index 088241a46..4595fa1f1 100644 --- a/src/rpc/group/group/transfer_group_owner.go +++ b/internal/rpc/group/transfer_group_owner.go @@ -1,9 +1,9 @@ package group import ( - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/proto/group" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/group" "context" ) diff --git a/src/rpc/user/user/get_user_info.go b/internal/rpc/user/get_user_info.go similarity index 91% rename from src/rpc/user/user/get_user_info.go rename to internal/rpc/user/get_user_info.go index 74ee468c4..3f9cec00f 100644 --- a/src/rpc/user/user/get_user_info.go +++ b/internal/rpc/user/get_user_info.go @@ -1,12 +1,12 @@ package user import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbUser "Open_IM/src/proto/user" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" "context" "google.golang.org/grpc" "net" @@ -22,6 +22,7 @@ type userServer struct { } func NewUserServer(port int) *userServer { + log.NewPrivateLog("user") return &userServer{ rpcPort: port, rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName, diff --git a/src/rpc/user/internal_service/get_user_info_to_client.go b/internal/rpc/user/internal_service/get_user_info_to_client.go similarity index 81% rename from src/rpc/user/internal_service/get_user_info_to_client.go rename to internal/rpc/user/internal_service/get_user_info_to_client.go index 8c0b93511..4cd0d0d2d 100644 --- a/src/rpc/user/internal_service/get_user_info_to_client.go +++ b/internal/rpc/user/internal_service/get_user_info_to_client.go @@ -1,9 +1,9 @@ package internal_service import ( - "Open_IM/src/common/config" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbUser "Open_IM/src/proto/user" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/common/config" + "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "strings" ) diff --git a/src/rpc/user/user/management_user.go b/internal/rpc/user/management_user.go similarity index 93% rename from src/rpc/user/user/management_user.go rename to internal/rpc/user/management_user.go index 7f5e10e03..f9d5b75a1 100644 --- a/src/rpc/user/user/management_user.go +++ b/internal/rpc/user/management_user.go @@ -7,11 +7,11 @@ package user import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - pbUser "Open_IM/src/proto/user" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" "context" ) diff --git a/src/rpc/user/user/update_user_info.go b/internal/rpc/user/update_user_info.go similarity index 85% rename from src/rpc/user/user/update_user_info.go rename to internal/rpc/user/update_user_info.go index 368c08837..14fe9f0db 100644 --- a/src/rpc/user/user/update_user_info.go +++ b/internal/rpc/user/update_user_info.go @@ -1,16 +1,16 @@ package user import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db/mysql_model/im_mysql_model" - "Open_IM/src/common/log" - "Open_IM/src/grpc-etcdv3/getcdv3" - pbChat "Open_IM/src/proto/chat" - pbFriend "Open_IM/src/proto/friend" - pbUser "Open_IM/src/proto/user" - "Open_IM/src/push/logic" - "Open_IM/src/utils" + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + pbFriend "Open_IM/pkg/proto/friend" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" "context" "strings" ) @@ -45,16 +45,17 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI RpcResp, err := client.GetFriendList(context.Background(), newReq) if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get friend list rpc server failed", err) log.ErrorByKv("get friend list rpc server failed", req.OperationID, "err", err.Error(), "req", req.String()) + return &pbUser.CommonResp{}, nil } if RpcResp.ErrorCode != 0 { log.ErrorByKv("get friend list rpc server failed", req.OperationID, "err", err.Error(), "req", req.String()) - + return &pbUser.CommonResp{}, nil } self, err := im_mysql_model.FindUserByUID(ownerUid) if err != nil { log.ErrorByKv("get self info failed", req.OperationID, "err", err.Error(), "req", req.String()) + return &pbUser.CommonResp{}, nil } var name, faceUrl string if self != nil { diff --git a/src/timed_task/timed_task/init.go b/internal/timed_task/init.go similarity index 100% rename from src/timed_task/timed_task/init.go rename to internal/timed_task/init.go diff --git a/src/timed_task/timed_task/timed_task.go b/internal/timed_task/timed_task.go similarity index 95% rename from src/timed_task/timed_task/timed_task.go rename to internal/timed_task/timed_task.go index a2626dd6e..bda907ea7 100644 --- a/src/timed_task/timed_task/timed_task.go +++ b/internal/timed_task/timed_task.go @@ -1,7 +1,7 @@ package timed_task import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" "time" ) diff --git a/src/common/config/config.go b/pkg/common/config/config.go similarity index 94% rename from src/common/config/config.go rename to pkg/common/config/config.go index 0a3c1ccf6..d296e5f98 100644 --- a/src/common/config/config.go +++ b/pkg/common/config/config.go @@ -13,7 +13,9 @@ type config struct { Api struct { GinPort []int `yaml:"openImApiPort"` } - + Sdk struct { + WsPort []int `yaml:"openImSdkWsPort"` + } Credential struct { Tencent struct { AppID string `yaml:"appID"` @@ -69,7 +71,7 @@ type config struct { OpenImPushName string `yaml:"openImPushName"` OpenImOnlineMessageRelayName string `yaml:"openImOnlineMessageRelayName"` OpenImGroupName string `yaml:"openImGroupName"` - RpcGetTokenName string `yaml:"rpcGetTokenName"` + OpenImAuthName string `yaml:"openImAuthName"` } Etcd struct { EtcdSchema string `yaml:"etcdSchema"` @@ -79,6 +81,7 @@ type config struct { StorageLocation string `yaml:"storageLocation"` RotationTime int `yaml:"rotationTime"` RemainRotationCount uint `yaml:"remainRotationCount"` + RemainLogLevel uint `yaml:"remainLogLevel"` ElasticSearchSwitch bool `yaml:"elasticSearchSwitch"` ElasticSearchAddr []string `yaml:"elasticSearchAddr"` ElasticSearchUser string `yaml:"elasticSearchUser"` @@ -90,7 +93,7 @@ type config struct { PushName string `yaml:"pushName"` } LongConnSvr struct { - WebsocketPort []int `yaml:"websocketPort"` + WebsocketPort []int `yaml:"openImWsPort"` WebsocketMaxConnNum int `yaml:"websocketMaxConnNum"` WebsocketMaxMsgLen int `yaml:"websocketMaxMsgLen"` WebsocketTimeOut int `yaml:"websocketTimeOut"` @@ -144,7 +147,7 @@ type config struct { } func init() { - bytes, err := ioutil.ReadFile("../config/config.yaml") + bytes, err := ioutil.ReadFile("config/config.yaml") if err != nil { panic(err) return diff --git a/src/common/config/error.go b/pkg/common/config/error.go similarity index 100% rename from src/common/config/error.go rename to pkg/common/config/error.go diff --git a/src/common/constant/constant.go b/pkg/common/constant/constant.go similarity index 100% rename from src/common/constant/constant.go rename to pkg/common/constant/constant.go diff --git a/src/common/db/model.go b/pkg/common/db/model.go similarity index 98% rename from src/common/db/model.go rename to pkg/common/db/model.go index f34b4c305..a8a790576 100644 --- a/src/common/db/model.go +++ b/pkg/common/db/model.go @@ -1,7 +1,7 @@ package db import ( - "Open_IM/src/common/config" + "Open_IM/pkg/common/config" "github.com/garyburd/redigo/redis" "gopkg.in/mgo.v2" "time" diff --git a/src/common/db/mongoModel.go b/pkg/common/db/mongoModel.go similarity index 98% rename from src/common/db/mongoModel.go rename to pkg/common/db/mongoModel.go index 3d0a7b4aa..f75843a4c 100644 --- a/src/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -1,9 +1,9 @@ package db import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - pbMsg "Open_IM/src/proto/chat" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "errors" "github.com/golang/protobuf/proto" "gopkg.in/mgo.v2/bson" diff --git a/src/common/db/mysql.go b/pkg/common/db/mysql.go similarity index 99% rename from src/common/db/mysql.go rename to pkg/common/db/mysql.go index a7a163686..05006ffab 100644 --- a/src/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -1,8 +1,8 @@ package db import ( - "Open_IM/src/common/config" - "Open_IM/src/common/log" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" "fmt" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" diff --git a/src/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go similarity index 98% rename from src/common/db/mysql_model/im_mysql_model/friend_model.go rename to pkg/common/db/mysql_model/im_mysql_model/friend_model.go index 5a1378465..ce029a0bb 100644 --- a/src/common/db/mysql_model/im_mysql_model/friend_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -1,7 +1,7 @@ package im_mysql_model import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" _ "github.com/jinzhu/gorm/dialects/mysql" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/friend_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go similarity index 98% rename from src/common/db/mysql_model/im_mysql_model/friend_request_model.go rename to pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go index 5125b62bd..1a7308cb9 100644 --- a/src/common/db/mysql_model/im_mysql_model/friend_request_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go @@ -1,7 +1,7 @@ package im_mysql_model import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/group_member_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go similarity index 99% rename from src/common/db/mysql_model/im_mysql_model/group_member_model.go rename to pkg/common/db/mysql_model/im_mysql_model/group_member_model.go index 19a3cd2c4..60ad86e85 100644 --- a/src/common/db/mysql_model/im_mysql_model/group_member_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go @@ -1,7 +1,7 @@ package im_mysql_model import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/group_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_model.go similarity index 99% rename from src/common/db/mysql_model/im_mysql_model/group_model.go rename to pkg/common/db/mysql_model/im_mysql_model/group_model.go index 85eab55f2..436260f68 100644 --- a/src/common/db/mysql_model/im_mysql_model/group_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model.go @@ -1,9 +1,9 @@ package im_mysql_model import ( - "Open_IM/src/common/db" - "Open_IM/src/common/log" - "Open_IM/src/proto/group" + "Open_IM/pkg/proto/group" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" "errors" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/group_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go similarity index 98% rename from src/common/db/mysql_model/im_mysql_model/group_request_model.go rename to pkg/common/db/mysql_model/im_mysql_model/group_request_model.go index 6451ed863..da793d331 100644 --- a/src/common/db/mysql_model/im_mysql_model/group_request_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go @@ -1,7 +1,7 @@ package im_mysql_model import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/model_struct.go b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go similarity index 100% rename from src/common/db/mysql_model/im_mysql_model/model_struct.go rename to pkg/common/db/mysql_model/im_mysql_model/model_struct.go diff --git a/src/common/db/mysql_model/im_mysql_model/user_black_list_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go similarity index 98% rename from src/common/db/mysql_model/im_mysql_model/user_black_list_model.go rename to pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go index 9d2e54f9d..907b0f223 100644 --- a/src/common/db/mysql_model/im_mysql_model/user_black_list_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go @@ -1,7 +1,7 @@ package im_mysql_model import ( - "Open_IM/src/common/db" + "Open_IM/pkg/common/db" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go similarity index 96% rename from src/common/db/mysql_model/im_mysql_model/user_model.go rename to pkg/common/db/mysql_model/im_mysql_model/user_model.go index 641eb99bc..ad0430c3a 100644 --- a/src/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -1,10 +1,10 @@ package im_mysql_model import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db" - pbAuth "Open_IM/src/proto/auth" - "Open_IM/src/utils" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/utils" _ "github.com/jinzhu/gorm/dialects/mysql" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go similarity index 95% rename from src/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go rename to pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go index 58a02e751..73defd89d 100644 --- a/src/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go @@ -7,9 +7,9 @@ package im_mysql_msg_model import ( - "Open_IM/src/common/db" - pbMsg "Open_IM/src/proto/chat" - "Open_IM/src/utils" + "Open_IM/pkg/common/db" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" "database/sql" "time" ) diff --git a/src/common/db/mysql_model/im_mysql_msg_model/hash_code.go b/pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go similarity index 94% rename from src/common/db/mysql_model/im_mysql_msg_model/hash_code.go rename to pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go index b349e7787..a631462ce 100644 --- a/src/common/db/mysql_model/im_mysql_msg_model/hash_code.go +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go @@ -1,8 +1,8 @@ package im_mysql_msg_model import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" "hash/crc32" "strconv" ) diff --git a/src/common/db/mysql_model/im_mysql_msg_model/receive_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/receive_model.go similarity index 100% rename from src/common/db/mysql_model/im_mysql_msg_model/receive_model.go rename to pkg/common/db/mysql_model/im_mysql_msg_model/receive_model.go diff --git a/src/common/db/redisModel.go b/pkg/common/db/redisModel.go similarity index 98% rename from src/common/db/redisModel.go rename to pkg/common/db/redisModel.go index f86dbb638..7e7028b39 100644 --- a/src/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -1,7 +1,7 @@ package db import ( - log2 "Open_IM/src/common/log" + log2 "Open_IM/pkg/common/log" "github.com/garyburd/redigo/redis" ) diff --git a/src/common/http/http_client.go b/pkg/common/http/http_client.go similarity index 100% rename from src/common/http/http_client.go rename to pkg/common/http/http_client.go diff --git a/src/common/kafka/consumer.go b/pkg/common/kafka/consumer.go similarity index 100% rename from src/common/kafka/consumer.go rename to pkg/common/kafka/consumer.go diff --git a/src/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go similarity index 100% rename from src/common/kafka/consumer_group.go rename to pkg/common/kafka/consumer_group.go diff --git a/src/common/kafka/producer.go b/pkg/common/kafka/producer.go similarity index 97% rename from src/common/kafka/producer.go rename to pkg/common/kafka/producer.go index 2d9299b60..c82df975f 100644 --- a/src/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -1,7 +1,7 @@ package kafka import ( - log2 "Open_IM/src/common/log" + log2 "Open_IM/pkg/common/log" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) diff --git a/src/common/multi_terminal_login/multi_terminal_login.go b/pkg/common/multi_terminal_login/multi_terminal_login.go similarity index 91% rename from src/common/multi_terminal_login/multi_terminal_login.go rename to pkg/common/multi_terminal_login/multi_terminal_login.go index 8da527274..e65e473d4 100644 --- a/src/common/multi_terminal_login/multi_terminal_login.go +++ b/pkg/common/multi_terminal_login/multi_terminal_login.go @@ -1,13 +1,13 @@ package multi_terminal_login import ( - "Open_IM/src/common/config" - "Open_IM/src/common/constant" - "Open_IM/src/common/db" - pbChat "Open_IM/src/proto/chat" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" - "Open_IM/src/utils" + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common" ) func MultiTerminalLoginChecker(uid, token string, platformID int32) error { diff --git a/src/grpc-etcdv3/getcdv3/pool.go b/pkg/grpc-etcdv3/getcdv3/pool.go similarity index 100% rename from src/grpc-etcdv3/getcdv3/pool.go rename to pkg/grpc-etcdv3/getcdv3/pool.go diff --git a/src/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go similarity index 100% rename from src/grpc-etcdv3/getcdv3/register.go rename to pkg/grpc-etcdv3/getcdv3/register.go diff --git a/src/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go similarity index 100% rename from src/grpc-etcdv3/getcdv3/resolver.go rename to pkg/grpc-etcdv3/getcdv3/resolver.go diff --git a/src/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go similarity index 79% rename from src/proto/auth/auth.pb.go rename to pkg/proto/auth/auth.pb.go index e13921095..8d1f4ea6e 100644 --- a/src/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: auth/auth.proto -package pbAuth +package pbAuth // import "auth" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,17 +21,17 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type UserRegisterReq struct { - UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=Icon,proto3" json:"Icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=Gender,proto3" json:"Gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=Mobile,proto3" json:"Mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=Birth,proto3" json:"Birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=Email,proto3" json:"Email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=Ex,proto3" json:"Ex,omitempty"` + UID string `protobuf:"bytes,1,opt,name=UID" json:"UID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=Icon" json:"Icon,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=Mobile" json:"Mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -42,17 +41,16 @@ func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} } func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } func (*UserRegisterReq) ProtoMessage() {} func (*UserRegisterReq) Descriptor() ([]byte, []int) { - return fileDescriptor_712ec48c1eaf43a2, []int{0} + return fileDescriptor_auth_ef7bd0d2906761f0, []int{0} } - func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) } func (m *UserRegisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserRegisterReq.Marshal(b, m, deterministic) } -func (m *UserRegisterReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserRegisterReq.Merge(m, src) +func (dst *UserRegisterReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterReq.Merge(dst, src) } func (m *UserRegisterReq) XXX_Size() int { return xxx_messageInfo_UserRegisterReq.Size(m) @@ -120,7 +118,7 @@ func (m *UserRegisterReq) GetEx() string { } type UserRegisterResp struct { - Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"` + Success bool `protobuf:"varint,1,opt,name=Success" json:"Success,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -130,17 +128,16 @@ func (m *UserRegisterResp) Reset() { *m = UserRegisterResp{} } func (m *UserRegisterResp) String() string { return proto.CompactTextString(m) } func (*UserRegisterResp) ProtoMessage() {} func (*UserRegisterResp) Descriptor() ([]byte, []int) { - return fileDescriptor_712ec48c1eaf43a2, []int{1} + return fileDescriptor_auth_ef7bd0d2906761f0, []int{1} } - func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) } func (m *UserRegisterResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserRegisterResp.Marshal(b, m, deterministic) } -func (m *UserRegisterResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserRegisterResp.Merge(m, src) +func (dst *UserRegisterResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterResp.Merge(dst, src) } func (m *UserRegisterResp) XXX_Size() int { return xxx_messageInfo_UserRegisterResp.Size(m) @@ -159,8 +156,8 @@ func (m *UserRegisterResp) GetSuccess() bool { } type UserTokenReq struct { - Platform int32 `protobuf:"varint,1,opt,name=Platform,proto3" json:"Platform,omitempty"` - UID string `protobuf:"bytes,2,opt,name=UID,proto3" json:"UID,omitempty"` + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` + UID string `protobuf:"bytes,2,opt,name=UID" json:"UID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -170,17 +167,16 @@ func (m *UserTokenReq) Reset() { *m = UserTokenReq{} } func (m *UserTokenReq) String() string { return proto.CompactTextString(m) } func (*UserTokenReq) ProtoMessage() {} func (*UserTokenReq) Descriptor() ([]byte, []int) { - return fileDescriptor_712ec48c1eaf43a2, []int{2} + return fileDescriptor_auth_ef7bd0d2906761f0, []int{2} } - func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) } func (m *UserTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserTokenReq.Marshal(b, m, deterministic) } -func (m *UserTokenReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserTokenReq.Merge(m, src) +func (dst *UserTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenReq.Merge(dst, src) } func (m *UserTokenReq) XXX_Size() int { return xxx_messageInfo_UserTokenReq.Size(m) @@ -206,10 +202,10 @@ func (m *UserTokenReq) GetUID() string { } type UserTokenResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` - ExpiredTime int64 `protobuf:"varint,4,opt,name=ExpiredTime,proto3" json:"ExpiredTime,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + ExpiredTime int64 `protobuf:"varint,4,opt,name=ExpiredTime" json:"ExpiredTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -219,17 +215,16 @@ func (m *UserTokenResp) Reset() { *m = UserTokenResp{} } func (m *UserTokenResp) String() string { return proto.CompactTextString(m) } func (*UserTokenResp) ProtoMessage() {} func (*UserTokenResp) Descriptor() ([]byte, []int) { - return fileDescriptor_712ec48c1eaf43a2, []int{3} + return fileDescriptor_auth_ef7bd0d2906761f0, []int{3} } - func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) } func (m *UserTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserTokenResp.Marshal(b, m, deterministic) } -func (m *UserTokenResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserTokenResp.Merge(m, src) +func (dst *UserTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenResp.Merge(dst, src) } func (m *UserTokenResp) XXX_Size() int { return xxx_messageInfo_UserTokenResp.Size(m) @@ -275,63 +270,32 @@ func init() { proto.RegisterType((*UserTokenResp)(nil), "pbAuth.UserTokenResp") } -func init() { - proto.RegisterFile("auth/auth.proto", fileDescriptor_712ec48c1eaf43a2) -} - -var fileDescriptor_712ec48c1eaf43a2 = []byte{ - // 346 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x4e, 0xc2, 0x40, - 0x10, 0x86, 0xd3, 0x42, 0x0b, 0x0c, 0x22, 0x64, 0x82, 0xba, 0xe1, 0x44, 0x7a, 0xe2, 0x60, 0x30, - 0xd1, 0x8b, 0x89, 0x5e, 0x40, 0x1b, 0xc3, 0x01, 0x63, 0x2a, 0x5c, 0xbc, 0x15, 0x58, 0xa1, 0x91, - 0xb2, 0x75, 0xb7, 0x24, 0x78, 0xf6, 0xa1, 0x7c, 0x3d, 0x33, 0xbb, 0x5b, 0x82, 0x86, 0x4b, 0x3b, - 0xff, 0xb7, 0x33, 0xd9, 0xfd, 0x67, 0x06, 0x9a, 0xf1, 0x36, 0x5f, 0x5d, 0xd1, 0xa7, 0x9f, 0x49, - 0x91, 0x0b, 0xf4, 0xb3, 0xd9, 0x60, 0x9b, 0xaf, 0x82, 0x1f, 0x07, 0x9a, 0x53, 0xc5, 0x65, 0xc4, - 0x97, 0x89, 0xca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a, 0xdb, 0x81, 0x32, 0x4d, 0x0a, 0x07, 0xc6, - 0x41, 0xe1, 0x17, 0x2f, 0xfa, 0x66, 0x84, 0xfd, 0x7f, 0xe3, 0xeb, 0xb0, 0xe3, 0x07, 0x2a, 0xc3, - 0x5b, 0xa8, 0xed, 0x6d, 0x60, 0xfb, 0x30, 0xad, 0xe8, 0x4b, 0xe7, 0xec, 0x08, 0x55, 0xd9, 0xb0, - 0xf1, 0x56, 0xa7, 0xe5, 0xb9, 0x33, 0x87, 0x33, 0x5f, 0x2f, 0xd1, 0xcd, 0x6f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x03, 0x0f, 0xb1, 0xb3, 0x57, 0x02, 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Auth service -// AuthClient is the client API for Auth service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type AuthClient interface { UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) } type authClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { +func NewAuthClient(cc *grpc.ClientConn) AuthClient { return &authClient{cc} } func (c *authClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) { out := new(UserRegisterResp) - err := c.cc.Invoke(ctx, "/pbAuth.Auth/UserRegister", in, out, opts...) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserRegister", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -340,30 +304,20 @@ func (c *authClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) { out := new(UserTokenResp) - err := c.cc.Invoke(ctx, "/pbAuth.Auth/UserToken", in, out, opts...) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserToken", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// AuthServer is the server API for Auth service. +// Server API for Auth service + type AuthServer interface { UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) } -// UnimplementedAuthServer can be embedded to have forward compatible implementations. -type UnimplementedAuthServer struct { -} - -func (*UnimplementedAuthServer) UserRegister(ctx context.Context, req *UserRegisterReq) (*UserRegisterResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserRegister not implemented") -} -func (*UnimplementedAuthServer) UserToken(ctx context.Context, req *UserTokenReq) (*UserTokenResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserToken not implemented") -} - func RegisterAuthServer(s *grpc.Server, srv AuthServer) { s.RegisterService(&_Auth_serviceDesc, srv) } @@ -420,3 +374,31 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "auth/auth.proto", } + +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_ef7bd0d2906761f0) } + +var fileDescriptor_auth_ef7bd0d2906761f0 = []byte{ + // 346 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x4e, 0xc2, 0x40, + 0x10, 0x86, 0xd3, 0x42, 0x0b, 0x0c, 0x22, 0x64, 0x82, 0xba, 0xe1, 0x44, 0x7a, 0xe2, 0x60, 0x30, + 0xd1, 0x8b, 0x89, 0x5e, 0x40, 0x1b, 0xc3, 0x01, 0x63, 0x2a, 0x5c, 0xbc, 0x15, 0x58, 0xa1, 0x91, + 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, 0xdd, 0xbd, 0xff, 0xe0, 0x0b, 0x1a, 0x07, 0xd5, 0xe6, 0xa2, + 0x50, 0xca, 0x07, 0xb1, 0xe0, 0xb6, 0xba, 0x90, 0x64, 0x35, 0x94, 0x72, 0xac, 0x96, 0xb6, 0xde, + 0x2a, 0x32, 0xa5, 0xcb, 0x6d, 0xbf, 0x8c, 0xc0, 0x2e, 0xd4, 0xc3, 0x5d, 0x96, 0x48, 0xbe, 0x98, + 0x24, 0x29, 0xd7, 0x5d, 0x2b, 0x45, 0x87, 0xe8, 0xfa, 0xdb, 0x81, 0x32, 0x4d, 0x0a, 0x07, 0xc6, + 0x41, 0xe1, 0x17, 0x2f, 0xfa, 0x66, 0x84, 0xfd, 0x7f, 0xe3, 0xeb, 0xb0, 0xe3, 0x07, 0x2a, 0xc3, + 0x5b, 0xa8, 0xed, 0x6d, 0x60, 0xfb, 0x30, 0xad, 0xe8, 0x4b, 0xe7, 0xec, 0x08, 0x55, 0xd9, 0xb0, + 0xf1, 0x56, 0xa7, 0xe5, 0xb9, 0x33, 0x87, 0x33, 0x5f, 0x2f, 0xd1, 0xcd, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x03, 0x0f, 0xb1, 0xb3, 0x57, 0x02, 0x00, 0x00, +} diff --git a/src/proto/auth/auth.proto b/pkg/proto/auth/auth.proto similarity index 100% rename from src/proto/auth/auth.proto rename to pkg/proto/auth/auth.proto diff --git a/src/proto/auto_proto.sh b/pkg/proto/auto_proto.sh similarity index 100% rename from src/proto/auto_proto.sh rename to pkg/proto/auto_proto.sh diff --git a/src/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go similarity index 82% rename from src/proto/chat/chat.pb.go rename to pkg/proto/chat/chat.pb.go index d320ce195..f98855332 100644 --- a/src/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: chat/chat.proto -package pbChat +package pbChat // import "chat" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,26 +21,26 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type WSToMsgSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID,proto3" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` - SendTime int64 `protobuf:"varint,4,opt,name=SendTime,proto3" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom,proto3" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL,proto3" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,8,opt,name=ContentType,proto3" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=SessionType,proto3" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,10,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,11,opt,name=MsgID,proto3" json:"MsgID,omitempty"` - Token string `protobuf:"bytes,12,opt,name=Token,proto3" json:"Token,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo,proto3" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options,proto3" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID,proto3" json:"PlatformID,omitempty"` - ForceList []string `protobuf:"bytes,16,rep,name=ForceList,proto3" json:"ForceList,omitempty"` - ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` + Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` + ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -51,17 +50,16 @@ func (m *WSToMsgSvrChatMsg) Reset() { *m = WSToMsgSvrChatMsg{} } func (m *WSToMsgSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*WSToMsgSvrChatMsg) ProtoMessage() {} func (*WSToMsgSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{0} + return fileDescriptor_chat_34beadf7348900d2, []int{0} } - func (m *WSToMsgSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WSToMsgSvrChatMsg.Unmarshal(m, b) } func (m *WSToMsgSvrChatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_WSToMsgSvrChatMsg.Marshal(b, m, deterministic) } -func (m *WSToMsgSvrChatMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_WSToMsgSvrChatMsg.Merge(m, src) +func (dst *WSToMsgSvrChatMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_WSToMsgSvrChatMsg.Merge(dst, src) } func (m *WSToMsgSvrChatMsg) XXX_Size() int { return xxx_messageInfo_WSToMsgSvrChatMsg.Size(m) @@ -192,22 +190,22 @@ func (m *WSToMsgSvrChatMsg) GetClientMsgID() string { } type MsgSvrToPushSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID,proto3" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq,proto3" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime,proto3" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom,proto3" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL,proto3" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType,proto3" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType,proto3" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,12,opt,name=MsgID,proto3" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo,proto3" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options,proto3" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID,proto3" json:"PlatformID,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -217,17 +215,16 @@ func (m *MsgSvrToPushSvrChatMsg) Reset() { *m = MsgSvrToPushSvrChatMsg{} func (m *MsgSvrToPushSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*MsgSvrToPushSvrChatMsg) ProtoMessage() {} func (*MsgSvrToPushSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{1} + return fileDescriptor_chat_34beadf7348900d2, []int{1} } - func (m *MsgSvrToPushSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Unmarshal(m, b) } func (m *MsgSvrToPushSvrChatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Marshal(b, m, deterministic) } -func (m *MsgSvrToPushSvrChatMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSvrToPushSvrChatMsg.Merge(m, src) +func (dst *MsgSvrToPushSvrChatMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSvrToPushSvrChatMsg.Merge(dst, src) } func (m *MsgSvrToPushSvrChatMsg) XXX_Size() int { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Size(m) @@ -351,10 +348,10 @@ func (m *MsgSvrToPushSvrChatMsg) GetClientMsgID() string { } type PullMessageReq struct { - UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"` - SeqBegin int64 `protobuf:"varint,2,opt,name=SeqBegin,proto3" json:"SeqBegin,omitempty"` - SeqEnd int64 `protobuf:"varint,3,opt,name=SeqEnd,proto3" json:"SeqEnd,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + SeqBegin int64 `protobuf:"varint,2,opt,name=SeqBegin" json:"SeqBegin,omitempty"` + SeqEnd int64 `protobuf:"varint,3,opt,name=SeqEnd" json:"SeqEnd,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -364,17 +361,16 @@ func (m *PullMessageReq) Reset() { *m = PullMessageReq{} } func (m *PullMessageReq) String() string { return proto.CompactTextString(m) } func (*PullMessageReq) ProtoMessage() {} func (*PullMessageReq) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{2} + return fileDescriptor_chat_34beadf7348900d2, []int{2} } - func (m *PullMessageReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageReq.Unmarshal(m, b) } func (m *PullMessageReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PullMessageReq.Marshal(b, m, deterministic) } -func (m *PullMessageReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageReq.Merge(m, src) +func (dst *PullMessageReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageReq.Merge(dst, src) } func (m *PullMessageReq) XXX_Size() int { return xxx_messageInfo_PullMessageReq.Size(m) @@ -414,12 +410,12 @@ func (m *PullMessageReq) GetOperationID() string { } type PullMessageResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` - MaxSeq int64 `protobuf:"varint,3,opt,name=MaxSeq,proto3" json:"MaxSeq,omitempty"` - MinSeq int64 `protobuf:"varint,4,opt,name=MinSeq,proto3" json:"MinSeq,omitempty"` - SingleUserMsg []*GatherFormat `protobuf:"bytes,5,rep,name=SingleUserMsg,proto3" json:"SingleUserMsg,omitempty"` - GroupUserMsg []*GatherFormat `protobuf:"bytes,6,rep,name=GroupUserMsg,proto3" json:"GroupUserMsg,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + MaxSeq int64 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq int64 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` + SingleUserMsg []*GatherFormat `protobuf:"bytes,5,rep,name=SingleUserMsg" json:"SingleUserMsg,omitempty"` + GroupUserMsg []*GatherFormat `protobuf:"bytes,6,rep,name=GroupUserMsg" json:"GroupUserMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -429,17 +425,16 @@ func (m *PullMessageResp) Reset() { *m = PullMessageResp{} } func (m *PullMessageResp) String() string { return proto.CompactTextString(m) } func (*PullMessageResp) ProtoMessage() {} func (*PullMessageResp) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{3} + return fileDescriptor_chat_34beadf7348900d2, []int{3} } - func (m *PullMessageResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageResp.Unmarshal(m, b) } func (m *PullMessageResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PullMessageResp.Marshal(b, m, deterministic) } -func (m *PullMessageResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageResp.Merge(m, src) +func (dst *PullMessageResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageResp.Merge(dst, src) } func (m *PullMessageResp) XXX_Size() int { return xxx_messageInfo_PullMessageResp.Size(m) @@ -493,8 +488,8 @@ func (m *PullMessageResp) GetGroupUserMsg() []*GatherFormat { } type GetNewSeqReq struct { - UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + 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:"-"` @@ -504,17 +499,16 @@ func (m *GetNewSeqReq) Reset() { *m = GetNewSeqReq{} } func (m *GetNewSeqReq) String() string { return proto.CompactTextString(m) } func (*GetNewSeqReq) ProtoMessage() {} func (*GetNewSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{4} + return fileDescriptor_chat_34beadf7348900d2, []int{4} } - func (m *GetNewSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetNewSeqReq.Unmarshal(m, b) } func (m *GetNewSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetNewSeqReq.Marshal(b, m, deterministic) } -func (m *GetNewSeqReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNewSeqReq.Merge(m, src) +func (dst *GetNewSeqReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNewSeqReq.Merge(dst, src) } func (m *GetNewSeqReq) XXX_Size() int { return xxx_messageInfo_GetNewSeqReq.Size(m) @@ -540,9 +534,9 @@ func (m *GetNewSeqReq) GetOperationID() string { } type GetNewSeqResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` - Seq int64 `protobuf:"varint,3,opt,name=Seq,proto3" json:"Seq,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Seq int64 `protobuf:"varint,3,opt,name=Seq" json:"Seq,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -552,17 +546,16 @@ func (m *GetNewSeqResp) Reset() { *m = GetNewSeqResp{} } func (m *GetNewSeqResp) String() string { return proto.CompactTextString(m) } func (*GetNewSeqResp) ProtoMessage() {} func (*GetNewSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{5} + return fileDescriptor_chat_34beadf7348900d2, []int{5} } - func (m *GetNewSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetNewSeqResp.Unmarshal(m, b) } func (m *GetNewSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetNewSeqResp.Marshal(b, m, deterministic) } -func (m *GetNewSeqResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNewSeqResp.Merge(m, src) +func (dst *GetNewSeqResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNewSeqResp.Merge(dst, src) } func (m *GetNewSeqResp) XXX_Size() int { return xxx_messageInfo_GetNewSeqResp.Size(m) @@ -596,9 +589,9 @@ func (m *GetNewSeqResp) GetSeq() int64 { type GatherFormat struct { // @inject_tag: json:"id" - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"id"` + ID string `protobuf:"bytes,1,opt,name=ID" json:"id"` // @inject_tag: json:"list" - List []*MsgFormat `protobuf:"bytes,2,rep,name=List,proto3" json:"list"` + List []*MsgFormat `protobuf:"bytes,2,rep,name=List" json:"list"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -608,17 +601,16 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{6} + return fileDescriptor_chat_34beadf7348900d2, []int{6} } - func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) } func (m *GatherFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GatherFormat.Marshal(b, m, deterministic) } -func (m *GatherFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_GatherFormat.Merge(m, src) +func (dst *GatherFormat) XXX_Merge(src proto.Message) { + xxx_messageInfo_GatherFormat.Merge(dst, src) } func (m *GatherFormat) XXX_Size() int { return xxx_messageInfo_GatherFormat.Size(m) @@ -645,29 +637,29 @@ func (m *GatherFormat) GetList() []*MsgFormat { type MsgFormat struct { // @inject_tag: json:"sendID" - SendID string `protobuf:"bytes,1,opt,name=SendID,proto3" json:"sendID"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"sendID"` // @inject_tag: json:"recvID" - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"recvID"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"recvID"` // @inject_tag: json:"msgFrom" - MsgFrom int32 `protobuf:"varint,3,opt,name=MsgFrom,proto3" json:"msgFrom"` + MsgFrom int32 `protobuf:"varint,3,opt,name=MsgFrom" json:"msgFrom"` // @inject_tag: json:"contentType" - ContentType int32 `protobuf:"varint,4,opt,name=ContentType,proto3" json:"contentType"` + ContentType int32 `protobuf:"varint,4,opt,name=ContentType" json:"contentType"` // @inject_tag: json:"serverMsgID" - ServerMsgID string `protobuf:"bytes,5,opt,name=ServerMsgID,proto3" json:"serverMsgID"` + ServerMsgID string `protobuf:"bytes,5,opt,name=ServerMsgID" json:"serverMsgID"` // @inject_tag: json:"content" - Content string `protobuf:"bytes,6,opt,name=Content,proto3" json:"content"` + Content string `protobuf:"bytes,6,opt,name=Content" json:"content"` // @inject_tag: json:"seq" - Seq int64 `protobuf:"varint,7,opt,name=Seq,proto3" json:"seq"` + Seq int64 `protobuf:"varint,7,opt,name=Seq" json:"seq"` // @inject_tag: json:"sendTime" - SendTime int64 `protobuf:"varint,8,opt,name=SendTime,proto3" json:"sendTime"` + SendTime int64 `protobuf:"varint,8,opt,name=SendTime" json:"sendTime"` // @inject_tag: json:"senderPlatformID" - SenderPlatformID int32 `protobuf:"varint,9,opt,name=SenderPlatformID,proto3" json:"senderPlatformID"` + SenderPlatformID int32 `protobuf:"varint,9,opt,name=SenderPlatformID" json:"senderPlatformID"` // @inject_tag: json:"senderNickName" - SenderNickName string `protobuf:"bytes,10,opt,name=SenderNickName,proto3" json:"senderNickName"` + SenderNickName string `protobuf:"bytes,10,opt,name=SenderNickName" json:"senderNickName"` // @inject_tag: json:"senderFaceUrl" - SenderFaceURL string `protobuf:"bytes,11,opt,name=SenderFaceURL,proto3" json:"senderFaceUrl"` + SenderFaceURL string `protobuf:"bytes,11,opt,name=SenderFaceURL" json:"senderFaceUrl"` // @inject_tag: json:"clientMsgID" - ClientMsgID string `protobuf:"bytes,12,opt,name=ClientMsgID,proto3" json:"clientMsgID"` + ClientMsgID string `protobuf:"bytes,12,opt,name=ClientMsgID" json:"clientMsgID"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -677,17 +669,16 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{7} + return fileDescriptor_chat_34beadf7348900d2, []int{7} } - func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) } func (m *MsgFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MsgFormat.Marshal(b, m, deterministic) } -func (m *MsgFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgFormat.Merge(m, src) +func (dst *MsgFormat) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFormat.Merge(dst, src) } func (m *MsgFormat) XXX_Size() int { return xxx_messageInfo_MsgFormat.Size(m) @@ -783,23 +774,23 @@ func (m *MsgFormat) GetClientMsgID() string { } type UserSendMsgReq struct { - ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier,proto3" json:"ReqIdentifier,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` - SendID string `protobuf:"bytes,3,opt,name=SendID,proto3" json:"SendID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL,proto3" json:"SenderFaceURL,omitempty"` - PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID,proto3" json:"PlatformID,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType,proto3" json:"SessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom,proto3" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,10,opt,name=ContentType,proto3" json:"ContentType,omitempty"` - RecvID string `protobuf:"bytes,11,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - ForceList []string `protobuf:"bytes,12,rep,name=ForceList,proto3" json:"ForceList,omitempty"` - Content string `protobuf:"bytes,13,opt,name=Content,proto3" json:"Content,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options,proto3" json:"Options,omitempty"` - ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` - OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo,proto3" json:"OffLineInfo,omitempty"` - Ex string `protobuf:"bytes,17,opt,name=Ex,proto3" json:"Ex,omitempty"` + ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` + RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` + ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` + Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` + Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -809,17 +800,16 @@ func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{8} + return fileDescriptor_chat_34beadf7348900d2, []int{8} } - func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) } func (m *UserSendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserSendMsgReq.Marshal(b, m, deterministic) } -func (m *UserSendMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSendMsgReq.Merge(m, src) +func (dst *UserSendMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSendMsgReq.Merge(dst, src) } func (m *UserSendMsgReq) XXX_Size() int { return xxx_messageInfo_UserSendMsgReq.Size(m) @@ -950,12 +940,12 @@ func (m *UserSendMsgReq) GetEx() string { } type UserSendMsgResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` - ReqIdentifier int32 `protobuf:"varint,3,opt,name=ReqIdentifier,proto3" json:"ReqIdentifier,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime,proto3" json:"SendTime,omitempty"` - ServerMsgID string `protobuf:"bytes,6,opt,name=ServerMsgID,proto3" json:"ServerMsgID,omitempty"` - ClientMsgID string `protobuf:"bytes,7,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + ReqIdentifier int32 `protobuf:"varint,3,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + ServerMsgID string `protobuf:"bytes,6,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,7,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -965,17 +955,16 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_767a49518b351716, []int{9} + return fileDescriptor_chat_34beadf7348900d2, []int{9} } - func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) } func (m *UserSendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserSendMsgResp.Marshal(b, m, deterministic) } -func (m *UserSendMsgResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSendMsgResp.Merge(m, src) +func (dst *UserSendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSendMsgResp.Merge(dst, src) } func (m *UserSendMsgResp) XXX_Size() int { return xxx_messageInfo_UserSendMsgResp.Size(m) @@ -1041,83 +1030,16 @@ func init() { proto.RegisterType((*UserSendMsgResp)(nil), "pbChat.UserSendMsgResp") } -func init() { - proto.RegisterFile("chat/chat.proto", fileDescriptor_767a49518b351716) -} - -var fileDescriptor_767a49518b351716 = []byte{ - // 919 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5f, 0x6b, 0xe3, 0x46, - 0x10, 0xc7, 0x96, 0x2d, 0x5b, 0xe3, 0xbf, 0x59, 0xae, 0xe9, 0x12, 0x4a, 0x31, 0xe6, 0x5a, 0x4c, - 0x1f, 0x52, 0xb8, 0xbe, 0x1c, 0x2d, 0xf4, 0xe1, 0x62, 0x27, 0x15, 0x44, 0xb9, 0x20, 0xf9, 0x28, - 0xf4, 0x4d, 0xe7, 0xac, 0x15, 0x71, 0xb6, 0x24, 0xef, 0x2a, 0x69, 0xfa, 0xd2, 0xaf, 0xd0, 0x7e, - 0xa4, 0xbe, 0xf6, 0xa3, 0xf4, 0x2b, 0x14, 0x0a, 0x65, 0x77, 0x25, 0x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 0x23, 0x87, 0xf8, 0xe4, 0xce, 0x1e, 0xb2, 0x55, 0x5f, 0x9f, 0x3d, 0x8c, 0xff, 0xae, 0xc1, 0x40, - 0xa3, 0xc4, 0xb3, 0x14, 0xa3, 0xc2, 0x22, 0x63, 0x17, 0x8b, 0xf6, 0xad, 0xf3, 0xd2, 0x80, 0x9a, - 0xd5, 0x01, 0x2d, 0x65, 0xdf, 0xaa, 0x64, 0xff, 0xe6, 0xaf, 0x1a, 0x34, 0xb8, 0xee, 0xa0, 0xb7, - 0x60, 0x6d, 0x35, 0x10, 0x15, 0xf2, 0xab, 0x08, 0xec, 0xc9, 0x67, 0x3b, 0x50, 0x96, 0xa0, 0x1f, - 0xa1, 0xa3, 0xac, 0x1c, 0x74, 0x9c, 0x7b, 0xe9, 0x8b, 0xf0, 0xe4, 0xf3, 0x9d, 0xb8, 0x8c, 0x57, - 0xaa, 0x59, 0xc4, 0xeb, 0x53, 0x57, 0xc4, 0x97, 0x4a, 0xff, 0xae, 0xf7, 0x4b, 0x87, 0xff, 0x30, - 0xff, 0x41, 0x7e, 0xfe, 0x68, 0x8a, 0x1f, 0xe8, 0xdf, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xfe, - 0xa0, 0x14, 0x71, 0xb3, 0x0b, 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Chat service -// ChatClient is the client API for Chat service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ChatClient interface { GetNewSeq(ctx context.Context, in *GetNewSeqReq, opts ...grpc.CallOption) (*GetNewSeqResp, error) PullMessage(ctx context.Context, in *PullMessageReq, opts ...grpc.CallOption) (*PullMessageResp, error) @@ -1125,16 +1047,16 @@ type ChatClient interface { } type chatClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewChatClient(cc grpc.ClientConnInterface) ChatClient { +func NewChatClient(cc *grpc.ClientConn) ChatClient { return &chatClient{cc} } func (c *chatClient) GetNewSeq(ctx context.Context, in *GetNewSeqReq, opts ...grpc.CallOption) (*GetNewSeqResp, error) { out := new(GetNewSeqResp) - err := c.cc.Invoke(ctx, "/pbChat.Chat/GetNewSeq", in, out, opts...) + err := grpc.Invoke(ctx, "/pbChat.Chat/GetNewSeq", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1143,7 +1065,7 @@ func (c *chatClient) GetNewSeq(ctx context.Context, in *GetNewSeqReq, opts ...gr func (c *chatClient) PullMessage(ctx context.Context, in *PullMessageReq, opts ...grpc.CallOption) (*PullMessageResp, error) { out := new(PullMessageResp) - err := c.cc.Invoke(ctx, "/pbChat.Chat/PullMessage", in, out, opts...) + err := grpc.Invoke(ctx, "/pbChat.Chat/PullMessage", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1152,34 +1074,21 @@ func (c *chatClient) PullMessage(ctx context.Context, in *PullMessageReq, opts . func (c *chatClient) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts ...grpc.CallOption) (*UserSendMsgResp, error) { out := new(UserSendMsgResp) - err := c.cc.Invoke(ctx, "/pbChat.Chat/UserSendMsg", in, out, opts...) + err := grpc.Invoke(ctx, "/pbChat.Chat/UserSendMsg", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// ChatServer is the server API for Chat service. +// Server API for Chat service + type ChatServer interface { GetNewSeq(context.Context, *GetNewSeqReq) (*GetNewSeqResp, error) PullMessage(context.Context, *PullMessageReq) (*PullMessageResp, error) UserSendMsg(context.Context, *UserSendMsgReq) (*UserSendMsgResp, error) } -// UnimplementedChatServer can be embedded to have forward compatible implementations. -type UnimplementedChatServer struct { -} - -func (*UnimplementedChatServer) GetNewSeq(ctx context.Context, req *GetNewSeqReq) (*GetNewSeqResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNewSeq not implemented") -} -func (*UnimplementedChatServer) PullMessage(ctx context.Context, req *PullMessageReq) (*PullMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PullMessage not implemented") -} -func (*UnimplementedChatServer) UserSendMsg(ctx context.Context, req *UserSendMsgReq) (*UserSendMsgResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserSendMsg not implemented") -} - func RegisterChatServer(s *grpc.Server, srv ChatServer) { s.RegisterService(&_Chat_serviceDesc, srv) } @@ -1258,3 +1167,67 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "chat/chat.proto", } + +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_34beadf7348900d2) } + +var fileDescriptor_chat_34beadf7348900d2 = []byte{ + // 919 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5f, 0x6b, 0xe3, 0x46, + 0x10, 0xc7, 0x96, 0x2d, 0x5b, 0xe3, 0xbf, 0x59, 0xae, 0xe9, 0x12, 0x4a, 0x31, 0xe6, 0x5a, 0x4c, + 0x1f, 0x52, 0xb8, 0xbe, 0x1c, 0x2d, 0xf4, 0xe1, 0x62, 0x27, 0x15, 0x44, 0xb9, 0x20, 0xf9, 0x28, + 0xf4, 0x4d, 0xe7, 0xac, 0x15, 0x71, 0xb6, 0x24, 0xef, 0x2a, 0x69, 0xfa, 0xd2, 0xaf, 0xd0, 0x7e, + 0xa4, 0xbe, 0xf6, 0xa3, 0xf4, 0x2b, 0x14, 0x0a, 0x65, 0x77, 0x25, 0x6b, 0x57, 0x72, 0x1c, 0x13, + 0xc8, 0x4b, 0xc8, 0xfc, 0x34, 0xb3, 0xbb, 0x33, 0xf3, 0x9b, 0xdf, 0x18, 0x06, 0x8b, 0x5b, 0x3f, + 0xfd, 0x96, 0xff, 0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0x17, 0x8b, 0xf6, 0xad, 0xf3, 0xd2, 0x80, 0x9a, + 0xd5, 0x01, 0x2d, 0x65, 0xdf, 0xaa, 0x64, 0xff, 0xe6, 0xaf, 0x1a, 0x34, 0xb8, 0xee, 0xa0, 0xb7, + 0x60, 0x6d, 0x35, 0x10, 0x15, 0xf2, 0xab, 0x08, 0xec, 0xc9, 0x67, 0x3b, 0x50, 0x96, 0xa0, 0x1f, + 0xa1, 0xa3, 0xac, 0x1c, 0x74, 0x9c, 0x7b, 0xe9, 0x8b, 0xf0, 0xe4, 0xf3, 0x9d, 0xb8, 0x8c, 0x57, + 0xaa, 0x59, 0xc4, 0xeb, 0x53, 0x57, 0xc4, 0x97, 0x4a, 0xff, 0xae, 0xf7, 0x4b, 0x87, 0xff, 0x30, + 0xff, 0x41, 0x7e, 0xfe, 0x68, 0x8a, 0x1f, 0xe8, 0xdf, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xfe, + 0xa0, 0x14, 0x71, 0xb3, 0x0b, 0x00, 0x00, +} diff --git a/src/proto/chat/chat.proto b/pkg/proto/chat/chat.proto similarity index 99% rename from src/proto/chat/chat.proto rename to pkg/proto/chat/chat.proto index 921f14cb1..1273682c7 100644 --- a/src/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -20,7 +20,6 @@ message WSToMsgSvrChatMsg{ int32 PlatformID =15; repeated string ForceList = 16; string ClientMsgID = 17; - } diff --git a/src/proto/friend/friend.pb.go b/pkg/proto/friend/friend.pb.go similarity index 100% rename from src/proto/friend/friend.pb.go rename to pkg/proto/friend/friend.pb.go diff --git a/src/proto/friend/friend.proto b/pkg/proto/friend/friend.proto similarity index 100% rename from src/proto/friend/friend.proto rename to pkg/proto/friend/friend.proto diff --git a/src/proto/group/group.pb.go b/pkg/proto/group/group.pb.go similarity index 98% rename from src/proto/group/group.pb.go rename to pkg/proto/group/group.pb.go index 75be4ad17..8e4bc5720 100644 --- a/src/proto/group/group.pb.go +++ b/pkg/proto/group/group.pb.go @@ -35,7 +35,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{0} + return fileDescriptor_group_9fd4d73937974f0d, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -87,7 +87,7 @@ func (m *CreateGroupReq) Reset() { *m = CreateGroupReq{} } func (m *CreateGroupReq) String() string { return proto.CompactTextString(m) } func (*CreateGroupReq) ProtoMessage() {} func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{1} + return fileDescriptor_group_9fd4d73937974f0d, []int{1} } func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) @@ -175,7 +175,7 @@ func (m *GroupAddMemberInfo) Reset() { *m = GroupAddMemberInfo{} } func (m *GroupAddMemberInfo) String() string { return proto.CompactTextString(m) } func (*GroupAddMemberInfo) ProtoMessage() {} func (*GroupAddMemberInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{2} + return fileDescriptor_group_9fd4d73937974f0d, []int{2} } func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) @@ -222,7 +222,7 @@ func (m *CreateGroupResp) Reset() { *m = CreateGroupResp{} } func (m *CreateGroupResp) String() string { return proto.CompactTextString(m) } func (*CreateGroupResp) ProtoMessage() {} func (*CreateGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{3} + return fileDescriptor_group_9fd4d73937974f0d, []int{3} } func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) @@ -276,7 +276,7 @@ func (m *GetGroupsInfoReq) Reset() { *m = GetGroupsInfoReq{} } func (m *GetGroupsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoReq) ProtoMessage() {} func (*GetGroupsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{4} + return fileDescriptor_group_9fd4d73937974f0d, []int{4} } func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) @@ -330,7 +330,7 @@ func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} } func (m *GetGroupsInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoResp) ProtoMessage() {} func (*GetGroupsInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{5} + return fileDescriptor_group_9fd4d73937974f0d, []int{5} } func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) @@ -388,7 +388,7 @@ func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} } func (m *SetGroupInfoReq) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoReq) ProtoMessage() {} func (*SetGroupInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{6} + return fileDescriptor_group_9fd4d73937974f0d, []int{6} } func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) @@ -469,7 +469,7 @@ func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationL func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListReq) ProtoMessage() {} func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{7} + return fileDescriptor_group_9fd4d73937974f0d, []int{7} } func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) @@ -529,7 +529,7 @@ func (m *GetGroupApplicationList_Data_User) Reset() { *m = GetGroupAppli func (m *GetGroupApplicationList_Data_User) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationList_Data_User) ProtoMessage() {} func (*GetGroupApplicationList_Data_User) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{8} + return fileDescriptor_group_9fd4d73937974f0d, []int{8} } func (m *GetGroupApplicationList_Data_User) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationList_Data_User.Unmarshal(m, b) @@ -673,7 +673,7 @@ func (m *GetGroupApplicationListData) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListData) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListData) ProtoMessage() {} func (*GetGroupApplicationListData) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{9} + return fileDescriptor_group_9fd4d73937974f0d, []int{9} } func (m *GetGroupApplicationListData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListData.Unmarshal(m, b) @@ -720,7 +720,7 @@ func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListResp) ProtoMessage() {} func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{10} + return fileDescriptor_group_9fd4d73937974f0d, []int{10} } func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) @@ -775,7 +775,7 @@ func (m *TransferGroupOwnerReq) Reset() { *m = TransferGroupOwnerReq{} } func (m *TransferGroupOwnerReq) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerReq) ProtoMessage() {} func (*TransferGroupOwnerReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{11} + return fileDescriptor_group_9fd4d73937974f0d, []int{11} } func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) @@ -835,7 +835,7 @@ func (m *TransferGroupOwnerResp) Reset() { *m = TransferGroupOwnerResp{} func (m *TransferGroupOwnerResp) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerResp) ProtoMessage() {} func (*TransferGroupOwnerResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{12} + return fileDescriptor_group_9fd4d73937974f0d, []int{12} } func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) @@ -883,7 +883,7 @@ func (m *JoinGroupReq) Reset() { *m = JoinGroupReq{} } func (m *JoinGroupReq) String() string { return proto.CompactTextString(m) } func (*JoinGroupReq) ProtoMessage() {} func (*JoinGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{13} + return fileDescriptor_group_9fd4d73937974f0d, []int{13} } func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) @@ -956,7 +956,7 @@ func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationRes func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseReq) ProtoMessage() {} func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{14} + return fileDescriptor_group_9fd4d73937974f0d, []int{14} } func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) @@ -1093,7 +1093,7 @@ func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationRe func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseResp) ProtoMessage() {} func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{15} + return fileDescriptor_group_9fd4d73937974f0d, []int{15} } func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) @@ -1141,7 +1141,7 @@ func (m *SetOwnerGroupNickNameReq) Reset() { *m = SetOwnerGroupNickNameR func (m *SetOwnerGroupNickNameReq) String() string { return proto.CompactTextString(m) } func (*SetOwnerGroupNickNameReq) ProtoMessage() {} func (*SetOwnerGroupNickNameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{16} + return fileDescriptor_group_9fd4d73937974f0d, []int{16} } func (m *SetOwnerGroupNickNameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetOwnerGroupNickNameReq.Unmarshal(m, b) @@ -1202,7 +1202,7 @@ func (m *QuitGroupReq) Reset() { *m = QuitGroupReq{} } func (m *QuitGroupReq) String() string { return proto.CompactTextString(m) } func (*QuitGroupReq) ProtoMessage() {} func (*QuitGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{17} + return fileDescriptor_group_9fd4d73937974f0d, []int{17} } func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) @@ -1262,7 +1262,7 @@ func (m *GroupApplicationUserInfo) Reset() { *m = GroupApplicationUserIn func (m *GroupApplicationUserInfo) String() string { return proto.CompactTextString(m) } func (*GroupApplicationUserInfo) ProtoMessage() {} func (*GroupApplicationUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{18} + return fileDescriptor_group_9fd4d73937974f0d, []int{18} } func (m *GroupApplicationUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationUserInfo.Unmarshal(m, b) @@ -1360,7 +1360,7 @@ func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } func (*GroupMemberFullInfo) ProtoMessage() {} func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{19} + return fileDescriptor_group_9fd4d73937974f0d, []int{19} } func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) @@ -1430,7 +1430,7 @@ func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} } func (m *GetGroupMemberListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListReq) ProtoMessage() {} func (*GetGroupMemberListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{20} + return fileDescriptor_group_9fd4d73937974f0d, []int{20} } func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) @@ -1499,7 +1499,7 @@ func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} func (m *GetGroupMemberListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListResp) ProtoMessage() {} func (*GetGroupMemberListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{21} + return fileDescriptor_group_9fd4d73937974f0d, []int{21} } func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) @@ -1561,7 +1561,7 @@ func (m *GetGroupMembersInfoReq) Reset() { *m = GetGroupMembersInfoReq{} func (m *GetGroupMembersInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoReq) ProtoMessage() {} func (*GetGroupMembersInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{22} + return fileDescriptor_group_9fd4d73937974f0d, []int{22} } func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) @@ -1622,7 +1622,7 @@ func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp func (m *GetGroupMembersInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoResp) ProtoMessage() {} func (*GetGroupMembersInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{23} + return fileDescriptor_group_9fd4d73937974f0d, []int{23} } func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) @@ -1678,7 +1678,7 @@ func (m *KickGroupMemberReq) Reset() { *m = KickGroupMemberReq{} } func (m *KickGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberReq) ProtoMessage() {} func (*KickGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{24} + return fileDescriptor_group_9fd4d73937974f0d, []int{24} } func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) @@ -1745,7 +1745,7 @@ func (m *Id2Result) Reset() { *m = Id2Result{} } func (m *Id2Result) String() string { return proto.CompactTextString(m) } func (*Id2Result) ProtoMessage() {} func (*Id2Result) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{25} + return fileDescriptor_group_9fd4d73937974f0d, []int{25} } func (m *Id2Result) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Id2Result.Unmarshal(m, b) @@ -1792,7 +1792,7 @@ func (m *KickGroupMemberResp) Reset() { *m = KickGroupMemberResp{} } func (m *KickGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberResp) ProtoMessage() {} func (*KickGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{26} + return fileDescriptor_group_9fd4d73937974f0d, []int{26} } func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) @@ -1845,7 +1845,7 @@ func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} } func (m *GetJoinedGroupListReq) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListReq) ProtoMessage() {} func (*GetJoinedGroupListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{27} + return fileDescriptor_group_9fd4d73937974f0d, []int{27} } func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) @@ -1897,7 +1897,7 @@ func (m *GroupInfo) Reset() { *m = GroupInfo{} } func (m *GroupInfo) String() string { return proto.CompactTextString(m) } func (*GroupInfo) ProtoMessage() {} func (*GroupInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{28} + return fileDescriptor_group_9fd4d73937974f0d, []int{28} } func (m *GroupInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfo.Unmarshal(m, b) @@ -1986,7 +1986,7 @@ func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} func (m *GetJoinedGroupListResp) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListResp) ProtoMessage() {} func (*GetJoinedGroupListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{29} + return fileDescriptor_group_9fd4d73937974f0d, []int{29} } func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) @@ -2042,7 +2042,7 @@ func (m *InviteUserToGroupReq) Reset() { *m = InviteUserToGroupReq{} } func (m *InviteUserToGroupReq) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupReq) ProtoMessage() {} func (*InviteUserToGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{30} + return fileDescriptor_group_9fd4d73937974f0d, []int{30} } func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) @@ -2110,7 +2110,7 @@ func (m *InviteUserToGroupResp) Reset() { *m = InviteUserToGroupResp{} } func (m *InviteUserToGroupResp) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupResp) ProtoMessage() {} func (*InviteUserToGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{31} + return fileDescriptor_group_9fd4d73937974f0d, []int{31} } func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) @@ -2164,7 +2164,7 @@ func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} } func (m *GetGroupAllMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberReq) ProtoMessage() {} func (*GetGroupAllMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{32} + return fileDescriptor_group_9fd4d73937974f0d, []int{32} } func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) @@ -2218,7 +2218,7 @@ func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} } func (m *GetGroupAllMemberResp) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberResp) ProtoMessage() {} func (*GetGroupAllMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_5136a19dfb954252, []int{33} + return fileDescriptor_group_9fd4d73937974f0d, []int{33} } func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) @@ -2799,9 +2799,9 @@ var _Group_serviceDesc = grpc.ServiceDesc{ Metadata: "group/group.proto", } -func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_5136a19dfb954252) } +func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_9fd4d73937974f0d) } -var fileDescriptor_group_5136a19dfb954252 = []byte{ +var fileDescriptor_group_9fd4d73937974f0d = []byte{ // 1717 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6e, 0xdc, 0x46, 0x12, 0x06, 0x67, 0x38, 0x92, 0xa6, 0xf4, 0xdf, 0xb2, 0x64, 0xee, 0x58, 0x2b, 0xc8, 0xbd, 0xc6, diff --git a/src/proto/group/group.proto b/pkg/proto/group/group.proto similarity index 100% rename from src/proto/group/group.proto rename to pkg/proto/group/group.proto diff --git a/src/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg similarity index 100% rename from src/proto/proto_dir.cfg rename to pkg/proto/proto_dir.cfg diff --git a/src/proto/push/push.pb.go b/pkg/proto/push/push.pb.go similarity index 80% rename from src/proto/push/push.pb.go rename to pkg/proto/push/push.pb.go index 319769870..bc663c33f 100644 --- a/src/proto/push/push.pb.go +++ b/pkg/proto/push/push.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: push/push.proto -package pbPush +package pbPush // import "push" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,25 +21,25 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type PushMsgReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID,proto3" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq,proto3" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime,proto3" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom,proto3" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,7,opt,name=ContentType,proto3" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType,proto3" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,10,opt,name=MsgID,proto3" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo,proto3" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,12,opt,name=Options,proto3" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID,proto3" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL,proto3" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,12,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` + SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -50,17 +49,16 @@ func (m *PushMsgReq) Reset() { *m = PushMsgReq{} } func (m *PushMsgReq) String() string { return proto.CompactTextString(m) } func (*PushMsgReq) ProtoMessage() {} func (*PushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ae0042da44e9a7a7, []int{0} + return fileDescriptor_push_a8d13c8ad86fddce, []int{0} } - func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) } func (m *PushMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PushMsgReq.Marshal(b, m, deterministic) } -func (m *PushMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushMsgReq.Merge(m, src) +func (dst *PushMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgReq.Merge(dst, src) } func (m *PushMsgReq) XXX_Size() int { return xxx_messageInfo_PushMsgReq.Size(m) @@ -184,7 +182,7 @@ func (m *PushMsgReq) GetClientMsgID() string { } type PushMsgResp struct { - ResultCode int32 `protobuf:"varint,1,opt,name=ResultCode,proto3" json:"ResultCode,omitempty"` + ResultCode int32 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -194,17 +192,16 @@ func (m *PushMsgResp) Reset() { *m = PushMsgResp{} } func (m *PushMsgResp) String() string { return proto.CompactTextString(m) } func (*PushMsgResp) ProtoMessage() {} func (*PushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ae0042da44e9a7a7, []int{1} + return fileDescriptor_push_a8d13c8ad86fddce, []int{1} } - func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) } func (m *PushMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PushMsgResp.Marshal(b, m, deterministic) } -func (m *PushMsgResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushMsgResp.Merge(m, src) +func (dst *PushMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgResp.Merge(dst, src) } func (m *PushMsgResp) XXX_Size() int { return xxx_messageInfo_PushMsgResp.Size(m) @@ -227,83 +224,43 @@ func init() { proto.RegisterType((*PushMsgResp)(nil), "push.PushMsgResp") } -func init() { - proto.RegisterFile("push/push.proto", fileDescriptor_ae0042da44e9a7a7) -} - -var fileDescriptor_ae0042da44e9a7a7 = []byte{ - // 377 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, - 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x9c, 0xce, 0x97, 0x85, 0x31, 0x82, 0x17, 0xa3, 0xc8, 0x18, 0xde, - 0xcc, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e,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b, 0x20, 0x9d, 0x7b, 0x23, 0xf5, 0x0c, 0x45, 0x5f, 0xdb, - 0x7b, 0xa8, 0x25, 0x79, 0x0f, 0xb0, 0xcd, 0xe3, 0x2a, 0x15, 0x65, 0x11, 0x06, 0x74, 0x60, 0x42, - 0x35, 0x08, 0xf9, 0x08, 0x43, 0x7d, 0x7a, 0x2c, 0xd7, 0x59, 0xf2, 0x67, 0x1d, 0x17, 0x48, 0x87, - 0x66, 0xc0, 0x13, 0x25, 0x1f, 0x60, 0x60, 0xc9, 0x32, 0x4e, 0xf0, 0x17, 0xfb, 0x49, 0x47, 0xc6, - 0xf6, 0x12, 0x9a, 0x5b, 0xca, 0x33, 0xe4, 0x95, 0x3d, 0xc5, 0xd8, 0x26, 0x6d, 0xa0, 0xe9, 0x27, - 0xf0, 0xee, 0xef, 0xad, 0xa4, 0x8e, 0xc7, 0x50, 0x5d, 0xf2, 0x6a, 0x21, 0x0e, 0x68, 0x1e, 0xdd, - 0x65, 0x0d, 0xf2, 0xe5, 0x3b, 0x0c, 0x6b, 0x7b, 0x84, 0xe5, 0x35, 0x4b, 0x90, 0xcc, 0xa1, 0x5b, - 0x13, 0x32, 0x9e, 0x9b, 0x7d, 0x7a, 0xec, 0xcf, 0xe4, 0xcd, 0x13, 0x51, 0xf2, 0xc7, 0xe0, 0xb7, - 0xa7, 0xd9, 0x37, 0xb9, 0xd7, 0x74, 0xdf, 0x31, 0xdb, 0xf7, 0xf5, 0x7f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x50, 0x88, 0x84, 0xf6, 0x90, 0x02, 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for PushMsgService service -// PushMsgServiceClient is the client API for PushMsgService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type PushMsgServiceClient interface { PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgResp, error) } type pushMsgServiceClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewPushMsgServiceClient(cc grpc.ClientConnInterface) PushMsgServiceClient { +func NewPushMsgServiceClient(cc *grpc.ClientConn) PushMsgServiceClient { return &pushMsgServiceClient{cc} } func (c *pushMsgServiceClient) PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgResp, error) { out := new(PushMsgResp) - err := c.cc.Invoke(ctx, "/push.PushMsgService/PushMsg", in, out, opts...) + err := grpc.Invoke(ctx, "/push.PushMsgService/PushMsg", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// PushMsgServiceServer is the server API for PushMsgService service. +// Server API for PushMsgService service + type PushMsgServiceServer interface { PushMsg(context.Context, *PushMsgReq) (*PushMsgResp, error) } -// UnimplementedPushMsgServiceServer can be embedded to have forward compatible implementations. -type UnimplementedPushMsgServiceServer struct { -} - -func (*UnimplementedPushMsgServiceServer) PushMsg(ctx context.Context, req *PushMsgReq) (*PushMsgResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PushMsg not implemented") -} - func RegisterPushMsgServiceServer(s *grpc.Server, srv PushMsgServiceServer) { s.RegisterService(&_PushMsgService_serviceDesc, srv) } @@ -338,3 +295,33 @@ var _PushMsgService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "push/push.proto", } + +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_a8d13c8ad86fddce) } + +var fileDescriptor_push_a8d13c8ad86fddce = []byte{ + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, + 0x14, 0xc6, 0xe9, 0xb4, 0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 0xbe, 0x49, 0xdc, 0x44, + 0xe4, 0x2d, 0xb8, 0x2b, 0x75, 0x0c, 0x03, 0x0a, 0xa6, 0x66, 0x85, 0xe9, 0x4b, 0xd3, 0x3c, 0xe3, + 0x18, 0xf2, 0x54, 0x50, 0xaf, 0xee, 0x7b, 0x20, 0x9d, 0x7b, 0x23, 0xf5, 0x0c, 0x45, 0x5f, 0xdb, + 0x7b, 0xa8, 0x25, 0x79, 0x0f, 0xb0, 0xcd, 0xe3, 0x2a, 0x15, 0x65, 0x11, 0x06, 0x74, 0x60, 0x42, + 0x35, 0x08, 0xf9, 0x08, 0x43, 0x7d, 0x7a, 0x2c, 0xd7, 0x59, 0xf2, 0x67, 0x1d, 0x17, 0x48, 0x87, + 0x66, 0xc0, 0x13, 0x25, 0x1f, 0x60, 0x60, 0xc9, 0x32, 0x4e, 0xf0, 0x17, 0xfb, 0x49, 0x47, 0xc6, + 0xf6, 0x12, 0x9a, 0x5b, 0xca, 0x33, 0xe4, 0x95, 0x3d, 0xc5, 0xd8, 0x26, 0x6d, 0xa0, 0xe9, 0x27, + 0xf0, 0xee, 0xef, 0xad, 0xa4, 0x8e, 0xc7, 0x50, 0x5d, 0xf2, 0x6a, 0x21, 0x0e, 0x68, 0x1e, 0xdd, + 0x65, 0x0d, 0xf2, 0xe5, 0x3b, 0x0c, 0x6b, 0x7b, 0x84, 0xe5, 0x35, 0x4b, 0x90, 0xcc, 0xa1, 0x5b, + 0x13, 0x32, 0x9e, 0x9b, 0x7d, 0x7a, 0xec, 0xcf, 0xe4, 0xcd, 0x13, 0x51, 0xf2, 0xc7, 0xe0, 0xb7, + 0xa7, 0xd9, 0x37, 0xb9, 0xd7, 0x74, 0xdf, 0x31, 0xdb, 0xf7, 0xf5, 0x7f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x50, 0x88, 0x84, 0xf6, 0x90, 0x02, 0x00, 0x00, +} diff --git a/src/proto/push/push.proto b/pkg/proto/push/push.proto similarity index 100% rename from src/proto/push/push.proto rename to pkg/proto/push/push.proto diff --git a/src/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go similarity index 81% rename from src/proto/relay/relay.pb.go rename to pkg/proto/relay/relay.pb.go index b8e990a90..542f3523a 100644 --- a/src/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: relay/relay.proto -package pbRelay +package pbRelay // import "relay" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,23 +21,23 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type MsgToUserReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID,proto3" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,5,opt,name=Content,proto3" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,6,opt,name=RecvSeq,proto3" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,7,opt,name=SendTime,proto3" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,8,opt,name=MsgFrom,proto3" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType,proto3" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType,proto3" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - ServerMsgID string `protobuf:"bytes,12,opt,name=ServerMsgID,proto3" json:"ServerMsgID,omitempty"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID,proto3" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL,proto3" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID,proto3" json:"ClientMsgID,omitempty"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,5,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,6,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,7,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,8,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` + ServerMsgID string `protobuf:"bytes,12,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` + PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` + SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -48,17 +47,16 @@ func (m *MsgToUserReq) Reset() { *m = MsgToUserReq{} } func (m *MsgToUserReq) String() string { return proto.CompactTextString(m) } func (*MsgToUserReq) ProtoMessage() {} func (*MsgToUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b6da3b5c0d1535b3, []int{0} + return fileDescriptor_relay_1ba173c940428df4, []int{0} } - func (m *MsgToUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgToUserReq.Unmarshal(m, b) } func (m *MsgToUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MsgToUserReq.Marshal(b, m, deterministic) } -func (m *MsgToUserReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToUserReq.Merge(m, src) +func (dst *MsgToUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToUserReq.Merge(dst, src) } func (m *MsgToUserReq) XXX_Size() int { return xxx_messageInfo_MsgToUserReq.Size(m) @@ -168,7 +166,7 @@ func (m *MsgToUserReq) GetClientMsgID() string { } type MsgToUserResp struct { - Resp []*SingleMsgToUser `protobuf:"bytes,1,rep,name=resp,proto3" json:"resp,omitempty"` + Resp []*SingleMsgToUser `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -178,17 +176,16 @@ func (m *MsgToUserResp) Reset() { *m = MsgToUserResp{} } func (m *MsgToUserResp) String() string { return proto.CompactTextString(m) } func (*MsgToUserResp) ProtoMessage() {} func (*MsgToUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_b6da3b5c0d1535b3, []int{1} + return fileDescriptor_relay_1ba173c940428df4, []int{1} } - func (m *MsgToUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgToUserResp.Unmarshal(m, b) } func (m *MsgToUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MsgToUserResp.Marshal(b, m, deterministic) } -func (m *MsgToUserResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToUserResp.Merge(m, src) +func (dst *MsgToUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToUserResp.Merge(dst, src) } func (m *MsgToUserResp) XXX_Size() int { return xxx_messageInfo_MsgToUserResp.Size(m) @@ -206,7 +203,7 @@ func (m *MsgToUserResp) GetResp() []*SingleMsgToUser { return nil } -//message SendMsgByWSReq{ +// message SendMsgByWSReq{ // string SendID = 1; // string RecvID = 2; // string Content = 3; @@ -216,11 +213,11 @@ func (m *MsgToUserResp) GetResp() []*SingleMsgToUser { // int64 SessionType = 7; // string OperationID = 8; // int64 PlatformID = 9; -//} +// } type SingleMsgToUser struct { - ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode,proto3" json:"ResultCode,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID,omitempty"` - RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID,proto3" json:"RecvPlatFormID,omitempty"` + ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID" json:"RecvPlatFormID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -230,17 +227,16 @@ func (m *SingleMsgToUser) Reset() { *m = SingleMsgToUser{} } func (m *SingleMsgToUser) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUser) ProtoMessage() {} func (*SingleMsgToUser) Descriptor() ([]byte, []int) { - return fileDescriptor_b6da3b5c0d1535b3, []int{2} + return fileDescriptor_relay_1ba173c940428df4, []int{2} } - func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) } func (m *SingleMsgToUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SingleMsgToUser.Marshal(b, m, deterministic) } -func (m *SingleMsgToUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleMsgToUser.Merge(m, src) +func (dst *SingleMsgToUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleMsgToUser.Merge(dst, src) } func (m *SingleMsgToUser) XXX_Size() int { return xxx_messageInfo_SingleMsgToUser.Size(m) @@ -278,85 +274,43 @@ func init() { proto.RegisterType((*SingleMsgToUser)(nil), "relay.SingleMsgToUser") } -func init() { - proto.RegisterFile("relay/relay.proto", fileDescriptor_b6da3b5c0d1535b3) -} - -var fileDescriptor_b6da3b5c0d1535b3 = []byte{ - // 412 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30, - 0x14, 0xc6, 0x15, 0x42, 0xbb, 0xf5, 0x75, 0x6d, 0xc1, 0xa0, 0xc9, 0xec, 0x80, 0xa2, 0x0a, 0x4d, - 0x11, 0x87, 0x21, 0x0d, 0x89, 0xcb, 0x6e, 0x2c, 0xaa, 0x14, 0x89, 0x6c, 0xc8, 0xe9, 0x2e, 0xdc, - 0xb2, 0xec, 0x11, 0x59, 0x24, 0x76, 0x6a, 0x87, 0x49, 0xfb, 0xef, 0xf8, 0xd3, 0x90, 0x9f, 0x5b, - 0x6a, 0x8a, 0xb8, 0x44, 0xf9, 0x7e, 0xef, 0xcb, 0xcb, 0xe7, 0xe7, 0x07, 0x2f, 0x0d, 0xb6, 0xd5, - 0xd3, 0x07, 0x7a, 0x5e, 0xf4, 0x46, 0x0f, 0x9a, 0x8d, 0x48, 0x2c, 0x7f, 0xc5, 0x70, 0x52, 0xd8, - 0x66, 0xad, 0xef, 0x2c, 0x1a, 0x81, 0x1b, 0x76, 0x0a, 0xe3, 0x12, 0xd5, 0x43, 0x9e, 0xf1, 0x28, - 0x89, 0xd2, 0x89, 0xd8, 0x2a, 0xc7, 0x05, 0xd6, 0x8f, 0x79, 0xc6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bf, 0xf6, 0x52, 0xaa, 0xa6, 0xc5, 0xbd, 0x93, 0x3c, 0xcb, 0x0d, 0x2c, 0x0e, 0x0a, 0xee, - 0x7c, 0x02, 0xed, 0xcf, 0x76, 0xb8, 0xd6, 0x0f, 0x48, 0x5b, 0x10, 0x8b, 0x80, 0xfc, 0x77, 0x13, - 0xce, 0x61, 0xee, 0xde, 0xdc, 0x24, 0x56, 0x7e, 0x36, 0x31, 0xcd, 0xe6, 0x80, 0x5e, 0x96, 0xf0, - 0xe6, 0x56, 0xb5, 0x52, 0x61, 0x81, 0xd6, 0x56, 0x0d, 0x0a, 0x17, 0xcf, 0x0d, 0x58, 0xd6, 0xc8, - 0x3e, 0xc1, 0x64, 0x9f, 0xe4, 0xd5, 0x36, 0x7a, 0xb8, 0xa0, 0x67, 0xaf, 0xff, 0x85, 0xb6, 0xff, - 0xbc, 0xf8, 0x36, 0x23, 0x7c, 0xd5, 0xdf, 0x53, 0xbf, 0xfb, 0x31, 0xad, 0xf9, 0xc7, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xca, 0xdd, 0x7b, 0x0c, 0xfb, 0x02, 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for OnlineMessageRelayService service -// OnlineMessageRelayServiceClient is the client API for OnlineMessageRelayService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type OnlineMessageRelayServiceClient interface { MsgToUser(ctx context.Context, in *MsgToUserReq, opts ...grpc.CallOption) (*MsgToUserResp, error) } type onlineMessageRelayServiceClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewOnlineMessageRelayServiceClient(cc grpc.ClientConnInterface) OnlineMessageRelayServiceClient { +func NewOnlineMessageRelayServiceClient(cc *grpc.ClientConn) OnlineMessageRelayServiceClient { return &onlineMessageRelayServiceClient{cc} } func (c *onlineMessageRelayServiceClient) MsgToUser(ctx context.Context, in *MsgToUserReq, opts ...grpc.CallOption) (*MsgToUserResp, error) { out := new(MsgToUserResp) - err := c.cc.Invoke(ctx, "/relay.OnlineMessageRelayService/MsgToUser", in, out, opts...) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/MsgToUser", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// OnlineMessageRelayServiceServer is the server API for OnlineMessageRelayService service. +// Server API for OnlineMessageRelayService service + type OnlineMessageRelayServiceServer interface { MsgToUser(context.Context, *MsgToUserReq) (*MsgToUserResp, error) } -// UnimplementedOnlineMessageRelayServiceServer can be embedded to have forward compatible implementations. -type UnimplementedOnlineMessageRelayServiceServer struct { -} - -func (*UnimplementedOnlineMessageRelayServiceServer) MsgToUser(ctx context.Context, req *MsgToUserReq) (*MsgToUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgToUser not implemented") -} - func RegisterOnlineMessageRelayServiceServer(s *grpc.Server, srv OnlineMessageRelayServiceServer) { s.RegisterService(&_OnlineMessageRelayService_serviceDesc, srv) } @@ -391,3 +345,35 @@ var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "relay/relay.proto", } + +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_1ba173c940428df4) } + +var fileDescriptor_relay_1ba173c940428df4 = []byte{ + // 412 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30, + 0x14, 0xc6, 0x15, 0x42, 0xbb, 0xf5, 0x75, 0x6d, 0xc1, 0xa0, 0xc9, 0xec, 0x80, 0xa2, 0x0a, 0x4d, + 0x11, 0x87, 0x21, 0x0d, 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, + 0x00, 0x00, 0xff, 0xff, 0xca, 0xdd, 0x7b, 0x0c, 0xfb, 0x02, 0x00, 0x00, +} diff --git a/src/proto/relay/relay.proto b/pkg/proto/relay/relay.proto similarity index 100% rename from src/proto/relay/relay.proto rename to pkg/proto/relay/relay.proto diff --git a/src/proto/user/user.pb.go b/pkg/proto/user/user.pb.go similarity index 100% rename from src/proto/user/user.pb.go rename to pkg/proto/user/user.pb.go diff --git a/src/proto/user/user.proto b/pkg/proto/user/user.proto similarity index 100% rename from src/proto/user/user.proto rename to pkg/proto/user/user.proto diff --git a/src/utils/cors_middleware.go b/pkg/utils/cors_middleware.go similarity index 100% rename from src/utils/cors_middleware.go rename to pkg/utils/cors_middleware.go diff --git a/src/utils/file.go b/pkg/utils/file.go similarity index 100% rename from src/utils/file.go rename to pkg/utils/file.go diff --git a/src/utils/get_server_ip.go b/pkg/utils/get_server_ip.go similarity index 96% rename from src/utils/get_server_ip.go rename to pkg/utils/get_server_ip.go index 21092ffa1..f5978b79c 100644 --- a/src/utils/get_server_ip.go +++ b/pkg/utils/get_server_ip.go @@ -1,7 +1,7 @@ package utils import ( - "Open_IM/src/common/config" + "Open_IM/pkg/common/config" "net" ) diff --git a/src/utils/image.go b/pkg/utils/image.go similarity index 100% rename from src/utils/image.go rename to pkg/utils/image.go diff --git a/src/utils/jwt_token.go b/pkg/utils/jwt_token.go similarity index 99% rename from src/utils/jwt_token.go rename to pkg/utils/jwt_token.go index 264da2483..604ee2400 100644 --- a/src/utils/jwt_token.go +++ b/pkg/utils/jwt_token.go @@ -1,8 +1,8 @@ package utils import ( - "Open_IM/src/common/config" - "Open_IM/src/common/db" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" "errors" "github.com/dgrijalva/jwt-go" "time" diff --git a/src/utils/map.go b/pkg/utils/map.go similarity index 100% rename from src/utils/map.go rename to pkg/utils/map.go diff --git a/src/utils/md5.go b/pkg/utils/md5.go similarity index 100% rename from src/utils/md5.go rename to pkg/utils/md5.go diff --git a/src/utils/platform_number_id_to_name.go b/pkg/utils/platform_number_id_to_name.go similarity index 100% rename from src/utils/platform_number_id_to_name.go rename to pkg/utils/platform_number_id_to_name.go diff --git a/src/utils/strings.go b/pkg/utils/strings.go similarity index 100% rename from src/utils/strings.go rename to pkg/utils/strings.go diff --git a/src/utils/time_format.go b/pkg/utils/time_format.go similarity index 100% rename from src/utils/time_format.go rename to pkg/utils/time_format.go diff --git a/script/build_all_service.sh b/script/build_all_service.sh index 3245a72f9..07a34bb08 100644 --- a/script/build_all_service.sh +++ b/script/build_all_service.sh @@ -6,6 +6,7 @@ source ./function.sh bin_dir="../bin" logs_dir="../logs" +sdk_db_dir="../db/sdk/" #Automatically created when there is no bin, logs folder if [ ! -d $bin_dir ]; then mkdir -p $bin_dir @@ -13,6 +14,9 @@ fi if [ ! -d $logs_dir ]; then mkdir -p $logs_dir fi +if [ ! -d $sdk_db_dir ]; then + mkdir -p $sdk_db_dir +fi #begin path begin_path=$PWD diff --git a/script/check_all.sh b/script/check_all.sh index 9d7c7d030..dd8042fde 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -4,9 +4,7 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh service_port_name=( - #api port name openImApiPort - #rpc port name openImUserPort openImFriendPort openImOfflineMessagePort @@ -14,20 +12,20 @@ service_port_name=( openImGroupPort openImAuthPort openImPushPort - websocketPort + openImWsPort + openImSdkWsPort ) -for i in ${service_port_name[*]}; do - list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') - list_to_string $list - for j in ${ports_array}; do - port=$(netstat -netulp | grep ./open_im | awk '{print $4}' | grep -w ${j} | awk -F '[:]' '{print $NF}') - if [[ ${port} -ne ${j} ]]; then - echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} - exit 1 - else - echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} - fi + for i in ${service_port_name[*]};do + list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') + list_to_string $list + for j in ${ports_array};do + port=`netstat -netulp |grep ./open_im| awk '{print $4}'|grep -w ${j}|awk -F '[:]' '{print $NF}'` + if [[ ${port} -ne ${j} ]]; then + echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} + exit 1 + else + echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} + fi + done done -done - -echo -e ${YELLOW_PREFIX}"all service launch success"${COLOR_SUFFIX} + echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX} diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 7d5086313..740b88e85 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -8,6 +8,7 @@ need_to_start_server_shell=( msg_gateway_start.sh push_start.sh msg_transfer_start.sh + sdk_svr_start.sh ) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index bcd928c53..197c28743 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -4,7 +4,7 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') -list2=$(cat $config_path | grep websocketPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') list_to_string $list1 rpc_ports=($ports_array) list_to_string $list2 @@ -26,7 +26,7 @@ fi sleep 1 cd ${msg_gateway_binary_root} for ((i = 0; i < ${#ws_ports[@]}; i++)); do - nohup ./${msg_gateway_name} -rpc_port ${rpc_ports[$i]} -ws_port ${ws_ports[$i]} >>../logs/${msg_gateway_name}.log 2>&1 & + nohup ./${msg_gateway_name} -rpc_port ${rpc_ports[$i]} -ws_port ${ws_ports[$i]} >>../logs/openIM.log 2>&1 & done #Check launched service process @@ -39,7 +39,7 @@ if [ $check -ge 1 ]; then ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') allPorts=${allPorts}"$ports " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS"${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/msg_transfer_start.sh b/script/msg_transfer_start.sh index 82dd8a364..30caeb466 100644 --- a/script/msg_transfer_start.sh +++ b/script/msg_transfer_start.sh @@ -16,7 +16,7 @@ fi #Waiting port recycling sleep 1 cd ${msg_transfer_binary_root} - nohup ./${msg_transfer_name} >>../logs/${msg_transfer_name}.log 2>&1 & + nohup ./${msg_transfer_name} >>../logs/openIM.log 2>&1 & #Check launched service process check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l` if [ $check -eq 1 ] @@ -29,7 +29,7 @@ for i in $ports ; do allPorts=${allPorts}"$i " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/path_info.cfg b/script/path_info.cfg index 432a7ee1e..30e5b4491 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -1,21 +1,27 @@ #Don't put the space between "=" msg_gateway_name="open_im_msg_gateway" msg_gateway_binary_root="../bin/" -msg_gateway_source_root="../src/msg_gateway/" +msg_gateway_source_root="../cmd/open_im_msg_gateway/" msg_name="open_im_msg" msg_binary_root="../bin/" -msg_source_root="../src/rpc/chat/" +msg_source_root="../cmd/rpc/open_im_msg/" push_name="open_im_push" push_binary_root="../bin/" -push_source_root="../src/push/" +push_source_root="../cmd/open_im_push/" msg_transfer_name="open_im_msg_transfer" msg_transfer_binary_root="../bin/" -msg_transfer_source_root="../src/msg_transfer/" +msg_transfer_source_root="../cmd/open_im_msg_transfer/" + + +sdk_server_name="open_im_sdk_server" +sdk_server_binary_root="../bin/" +sdk_server_source_root="../cmd/Open-IM-SDK-Core/" + #Global configuration file default dir config_path="../config/config.yaml" @@ -23,16 +29,17 @@ config_path="../config/config.yaml" #servicefile dir path service_source_root=( #api service file - ../src/api/ + ../cmd/open_im_api/ #rpc service file - ../src/rpc/user/ - ../src/rpc/friend/ - ../src/rpc/group/ - ../src/rpc/auth/ + ../cmd/rpc/open_im_user/ + ../cmd/rpc/open_im_friend/ + ../cmd/rpc/open_im_group/ + ../cmd/rpc/open_im_auth/ ${msg_gateway_source_root} ${msg_transfer_source_root} ${msg_source_root} ${push_source_root} + ${sdk_server_source_root} ) #service filename service_names=( @@ -47,6 +54,7 @@ service_names=( ${msg_transfer_name} ${msg_name} ${push_name} + ${sdk_server_name} ) diff --git a/script/push_start.sh b/script/push_start.sh index f294ff6d1..668c0068f 100644 --- a/script/push_start.sh +++ b/script/push_start.sh @@ -22,7 +22,7 @@ sleep 1 cd ${push_binary_root} for ((i = 0; i < ${#rpc_ports[@]}; i++)); do - nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/${push_name}.log 2>&1 & + nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/openIM.log 2>&1 & done sleep 3 @@ -36,7 +36,7 @@ if [ $check -eq 1 ]; then for i in $ports; do allPorts=${allPorts}"$i " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh new file mode 100644 index 000000000..28d764b73 --- /dev/null +++ b/script/sdk_svr_start.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh +list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') +list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') +list_to_string $list1 +api_ports=($ports_array) +list_to_string $list2 +ws_ports=($ports_array) +list_to_string $list3 +sdk_ws_ports=($ports_array) + + + + +#Check if the service exists +#If it is exists,kill this process +check=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + oldPid=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | awk '{print $2}') + kill -9 ${oldPid} +fi +#Waiting port recycling +sleep 1 +cd ${sdk_server_binary_root} + nohup ./${sdk_server_name} -openIM_api_port ${api_ports[0]} -openIM_ws_port ${ws_ports[0]} -sdk_ws_port ${sdk_ws_ports[0]} >>../logs/openIM.log 2>&1 & + +#Check launched service process +sleep 3 +check=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | wc -l) +allPorts="" +if [ $check -ge 1 ]; then + allNewPid=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | awk '{print $2}') + for i in $allNewPid; do + ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') + allPorts=${allPorts}"$ports " + done + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} +else + echo -e ${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX} +fi diff --git a/script/start_all.sh b/script/start_all.sh index 30353c3fa..43a02b34d 100644 --- a/script/start_all.sh +++ b/script/start_all.sh @@ -8,6 +8,7 @@ need_to_start_server_shell=( msg_gateway_start.sh push_start.sh msg_transfer_start.sh + sdk_svr_start.sh ) for i in ${need_to_start_server_shell[*]}; do diff --git a/src/common/log/es_hk.go b/src/common/log/es_hk.go deleted file mode 100644 index c54130968..000000000 --- a/src/common/log/es_hk.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -** description("将日志发送到elasticsearch的hook"). -** copyright('tuoyun,www.tuoyun.net'). -** author("fg,Gordon@tuoyun.net"). -** time(2021/3/26 17:05). - */ -package log - -import ( - "Open_IM/src/common/config" - "context" - "fmt" - elasticV7 "github.com/olivere/elastic/v7" - "github.com/sirupsen/logrus" - "log" - "os" - "strings" - "time" -) - -//esHook 自定义的ES hook -type esHook struct { - moduleName string - client *elasticV7.Client -} - -//newEsHook 初始化 -func newEsHook(moduleName string) *esHook { - //https://github.com/sohlich/elogrus - //client, err := elastic.NewClient(elastic.SetURL("http://localhost:9200")) - //if err != nil { - // log.Panic(err) - //} - //hook, err := elogrus.NewAsyncElasticHook(client, "localhost", logrus.DebugLevel, "mylog") - //if err != nil { - // log.Panic(err) - //} - es, err := elasticV7.NewClient( - elasticV7.SetURL(config.Config.Log.ElasticSearchAddr...), - elasticV7.SetBasicAuth(config.Config.Log.ElasticSearchUser, config.Config.Log.ElasticSearchPassword), - elasticV7.SetSniff(false), - elasticV7.SetHealthcheckInterval(60*time.Second), - elasticV7.SetErrorLog(log.New(os.Stderr, "ES:", log.LstdFlags)), - ) - - if err != nil { - log.Fatal("failed to create Elastic V7 Client: ", err) - } - - //info, code, err := es.Ping(logConfig.ElasticSearch.EsAddr[0]).Do(context.Background()) - //if err != nil { - // panic(err) - //} - //fmt.Printf("Elasticsearch returned with code %d and version %s\n", code, info.Version.Number) - // - //esversion, err := es.ElasticsearchVersion(logConfig.ElasticSearch.EsAddr[0]) - //if err != nil { - // panic(err) - //} - //fmt.Printf("Elasticsearch version %s\n", esversion) - return &esHook{client: es, moduleName: moduleName} -} - -//Fire log hook interface 方法 -func (hook *esHook) Fire(entry *logrus.Entry) error { - doc := newEsLog(entry) - go hook.sendEs(doc) - return nil -} - -//Levels log hook interface 方法,此hook影响的日志 -func (hook *esHook) Levels() []logrus.Level { - return logrus.AllLevels -} - -//sendEs 异步发送日志到es -func (hook *esHook) sendEs(doc appLogDocModel) { - defer func() { - if r := recover(); r != nil { - fmt.Println("send entry to es failed: ", r) - } - }() - _, err := hook.client.Index().Index(hook.moduleName).Type(doc.indexName()).BodyJson(doc).Do(context.Background()) - if err != nil { - log.Println(err) - } - -} - -//appLogDocModel es model -type appLogDocModel map[string]interface{} - -func newEsLog(e *logrus.Entry) appLogDocModel { - ins := make(map[string]interface{}) - ins["level"] = strings.ToUpper(e.Level.String()) - ins["time"] = e.Time.Format("2006-01-02 15:04:05") - for kk, vv := range e.Data { - ins[kk] = vv - } - ins["tipInfo"] = e.Message - - return ins -} - -// indexName es index name 时间分割 -func (m *appLogDocModel) indexName() string { - return time.Now().Format("2006-01-02") -} diff --git a/src/common/log/file_line_hk.go b/src/common/log/file_line_hk.go deleted file mode 100644 index e6b690eb7..000000000 --- a/src/common/log/file_line_hk.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -** description("得到调用文件名字和行号的hook"). -** copyright('tuoyun,www.tuoyun.net'). -** author("fg,Gordon@tuoyun.net"). -** time(2021/3/16 11:26). - */ -package log - -import ( - "fmt" - "github.com/sirupsen/logrus" - "runtime" - "strings" -) - -type fileHook struct{} - -func newFileHook() *fileHook { - return &fileHook{} -} - -func (f *fileHook) Levels() []logrus.Level { - return logrus.AllLevels -} - -func (f *fileHook) Fire(entry *logrus.Entry) error { - entry.Data["FilePath"] = findCaller(5) - return nil -} - -func findCaller(skip int) string { - file := "" - line := 0 - for i := 0; i < 10; i++ { - file, line = getCaller(skip + i) - if !strings.HasPrefix(file, "log") { - break - } - } - return fmt.Sprintf("%s:%d", file, line) -} - -func getCaller(skip int) (string, int) { - _, file, line, ok := runtime.Caller(skip) - if !ok { - return "", 0 - } - - n := 0 - for i := len(file) - 1; i > 0; i-- { - if file[i] == '/' { - n++ - if n >= 2 { - file = file[i+1:] - break - } - } - } - return file, line -} diff --git a/src/common/log/logrus.go b/src/common/log/logrus.go deleted file mode 100644 index 48c781c68..000000000 --- a/src/common/log/logrus.go +++ /dev/null @@ -1,167 +0,0 @@ -package log - -import ( - "Open_IM/src/common/config" - "fmt" - nested "github.com/antonfisher/nested-logrus-formatter" - rotatelogs "github.com/lestrrat-go/file-rotatelogs" - "github.com/rifflock/lfshook" - "github.com/sirupsen/logrus" - "os" - "time" -) - -var logger *Logger - -type Logger struct { - *logrus.Logger - Pid int -} - -func init() { - logger = loggerInit("") - -} -func NewPrivateLog(moduleName string) { - logger = loggerInit(moduleName) -} - -func loggerInit(moduleName string) *Logger { - var logger = logrus.New() - //All logs will be printed - logger.SetLevel(logrus.TraceLevel) - //Log Style Setting - logger.SetFormatter(&nested.Formatter{ - TimestampFormat: "2006-01-02 15:04:05.000", - HideKeys: false, - FieldsOrder: []string{"PID"}, - }) - //File name and line number display hook - logger.AddHook(newFileHook()) - - //Send logs to elasticsearch hook - if config.Config.Log.ElasticSearchSwitch == true { - logger.AddHook(newEsHook(moduleName)) - } - //Log file segmentation hook - hook := NewLfsHook(time.Duration(config.Config.Log.RotationTime)*time.Hour, config.Config.Log.RemainRotationCount, moduleName) - logger.AddHook(hook) - return &Logger{ - logger, - os.Getpid(), - } -} -func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook { - lfsHook := lfshook.NewHook(lfshook.WriterMap{ - logrus.DebugLevel: initRotateLogs(rotationTime, maxRemainNum, "debug", moduleName), - logrus.InfoLevel: initRotateLogs(rotationTime, maxRemainNum, "info", moduleName), - logrus.WarnLevel: initRotateLogs(rotationTime, maxRemainNum, "warn", moduleName), - logrus.ErrorLevel: initRotateLogs(rotationTime, maxRemainNum, "error", moduleName), - }, &nested.Formatter{ - TimestampFormat: "2006-01-02 15:04:05.000", - HideKeys: false, - FieldsOrder: []string{"PID"}, - }) - return lfsHook -} -func initRotateLogs(rotationTime time.Duration, maxRemainNum uint, level string, moduleName string) *rotatelogs.RotateLogs { - writer, err := rotatelogs.New( - config.Config.Log.StorageLocation+moduleName+"/"+level+"."+"%Y-%m-%d_%H-%M-%S", - rotatelogs.WithRotationTime(rotationTime), - rotatelogs.WithRotationCount(maxRemainNum), - ) - if err != nil { - panic(err) - } else { - return writer - } -} - -func Info(token, OperationID, format string, args ...interface{}) { - if token == "" && OperationID == "" { - logger.WithFields(logrus.Fields{}).Infof(format, args...) - } else { - logger.WithFields(logrus.Fields{ - "token": token, - "OperationID": OperationID, - }).Infof(format, args...) - } -} - -func Error(token, OperationID, format string, args ...interface{}) { - if token == "" && OperationID == "" { - logger.WithFields(logrus.Fields{}).Errorf(format, args...) - } else { - logger.WithFields(logrus.Fields{ - "token": token, - "OperationID": OperationID, - }).Errorf(format, args...) - } -} - -func Debug(token, OperationID, format string, args ...interface{}) { - if token == "" && OperationID == "" { - logger.WithFields(logrus.Fields{}).Debugf(format, args...) - } else { - logger.WithFields(logrus.Fields{ - "token": token, - "OperationID": OperationID, - }).Debugf(format, args...) - } -} - -func Warning(token, OperationID, format string, args ...interface{}) { - if token == "" && OperationID == "" { - logger.WithFields(logrus.Fields{}).Warningf(format, args...) - } else { - logger.WithFields(logrus.Fields{ - "token": token, - "OperationID": OperationID, - }).Warningf(format, args...) - } -} - -func InfoByArgs(format string, args ...interface{}) { - logger.WithFields(logrus.Fields{}).Infof(format, args) -} - -func ErrorByArgs(format string, args ...interface{}) { - logger.WithFields(logrus.Fields{}).Errorf(format, args...) -} - -//Print log information in k, v format, -//kv is best to appear in pairs. tipInfo is the log prompt information for printing, -//and kv is the key and value for printing. -func InfoByKv(tipInfo, OperationID string, args ...interface{}) { - fields := make(logrus.Fields) - argsHandle(OperationID, fields, args) - logger.WithFields(fields).Info(tipInfo) -} -func ErrorByKv(tipInfo, OperationID string, args ...interface{}) { - fields := make(logrus.Fields) - argsHandle(OperationID, fields, args) - logger.WithFields(fields).Error(tipInfo) -} -func DebugByKv(tipInfo, OperationID string, args ...interface{}) { - fields := make(logrus.Fields) - argsHandle(OperationID, fields, args) - logger.WithFields(fields).Debug(tipInfo) -} -func WarnByKv(tipInfo, OperationID string, args ...interface{}) { - fields := make(logrus.Fields) - argsHandle(OperationID, fields, args) - logger.WithFields(fields).Warn(tipInfo) -} - -//internal method -func argsHandle(OperationID string, fields logrus.Fields, args []interface{}) { - for i := 0; i < len(args); i += 2 { - if i+1 < len(args) { - fields[fmt.Sprintf("%v", args[i])] = args[i+1] - } else { - fields[fmt.Sprintf("%v", args[i])] = "" - } - } - fields["operationID"] = OperationID - fields["PID"] = logger.Pid -} diff --git a/src/common/log/time_format.go b/src/common/log/time_format.go deleted file mode 100644 index 4ae1c56ef..000000000 --- a/src/common/log/time_format.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -** description(""). -** copyright('tuoyun,www.tuoyun.net'). -** author("fg,Gordon@tuoyun.net"). -** time(2021/2/22 11:52). - */ -package log - -import ( - "strconv" - "time" -) - -const ( - TimeOffset = 8 * 3600 //8个小时的偏移量 - HalfOffset = 12 * 3600 //半天的小时偏移量 -) - -//获取当前的时间戳 -func GetCurrentTimestamp() int64 { - return time.Now().Unix() -} - -//获取当天0点的时间戳 -func GetCurDayZeroTimestamp() int64 { - timeStr := time.Now().Format("2006-01-02") - t, _ := time.Parse("2006-01-02", timeStr) - return t.Unix() - TimeOffset -} - -//获取当天12点的时间戳 -func GetCurDayHalfTimestamp() int64 { - return GetCurDayZeroTimestamp() + HalfOffset - -} - -//获取当天0点格式化时间,格式为"2006-01-02_00-00-00" -func GetCurDayZeroTimeFormat() string { - return time.Unix(GetCurDayZeroTimestamp(), 0).Format("2006-01-02_15-04-05") -} - -//获取当天12点格式化时间,格式为"2006-01-02_12-00-00" -func GetCurDayHalfTimeFormat() string { - return time.Unix(GetCurDayZeroTimestamp()+HalfOffset, 0).Format("2006-01-02_15-04-05") -} -func GetTimeStampByFormat(datetime string) string { - timeLayout := "2006-01-02 15:04:05" //转化所需模板 - loc, _ := time.LoadLocation("Local") //获取时区 - tmp, _ := time.ParseInLocation(timeLayout, datetime, loc) - timestamp := tmp.Unix() //转化为时间戳 类型是int64 - return strconv.FormatInt(timestamp, 10) -} - -func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64 { - tm, _ := time.Parse(timeFormat, timeSrc) - return tm.Unix() -}