Merge pull request #540 from cubxxw/fix/copy

feat: add test file
pull/546/head
Xinwei Xiong 1 year ago committed by GitHub
commit ccf2cdaab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,31 @@
# Ignore files and directories starting with a dot
# Ignore specific files
.dockerignore
# Ignore build artifacts
_output/
logs/
# Ignore non-essential documentation
README.md
README-zh_CN.md
CONTRIBUTING.md
CHANGELOG/
# LICENSE
# Ignore testing and linting configuration
.golangci.yml
# Ignore deployment-related files
docker-compose.yaml
deployments/
# Ignore assets
assets/
# Ignore components
components/
# Ignore tools and scripts
.github/

@ -0,0 +1,36 @@
name: OpenIM Build Docker Images
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
bin:
- ssserver
- sslocal
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/openim-${{ matrix.bin }}
- name: Build and release Docker images
uses: docker/build-push-action@v3
with:
platforms: linux/386,linux/amd64,linux/arm64/v8
target: ${{ matrix.bin }}
tags: ${{ steps.metadata.outputs.tags }}
push: true

@ -83,7 +83,7 @@ jobs:
- name: Build source code for host platform - name: Build source code for host platform
run: | run: |
make multiarch make build
echo "Build source code for host platform successfully" echo "Build source code for host platform successfully"
# - name: Collect Test Coverage File # - name: Collect Test Coverage File
@ -132,22 +132,3 @@ jobs:
# - name: Test docker image # - name: Test docker image
# run: | # run: |
# docker build -t openim:ci-build . # docker build -t openim:ci-build .
# goreleaser-test:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Run GoReleaser
# uses: goreleaser/goreleaser-action@v4
# with:
# version: latest
# args: release --clean --skip-publish --snapshot

1
.gitignore vendored

@ -353,7 +353,6 @@ cscope.po.out
*testsdir *testsdir
*testsfile *testsfile
*testsfiles *testsfiles
*test
*testdir *testdir
*testfile *testfile
*testfiles *testfiles

@ -1,38 +1,31 @@
# Build Stage
FROM golang as build FROM golang as build
# go mod Installation source, container environment variable addition will override the default variable value # Set go mod installation source and proxy
ENV GO111MODULE=on ARG GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct ARG GOPROXY=https://goproxy.cn,direct
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
# Set up the working directory # Set up the working directory
WORKDIR /Open-IM-Server WORKDIR /Open-IM-Server
# add all files to the container
COPY . .
WORKDIR /Open-IM-Server/scripts # Copy all files to the container
RUN chmod +x *.sh ADD . .
RUN /bin/sh -c ./build_all_service.sh
#Blank image Multi-Stage Build RUN /bin/sh -c "make build"
FROM ubuntu
RUN rm -rf /var/lib/apt/lists/* # Production Stage
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ FROM alpine
&&apt-get install net-tools
#Non-interactive operation
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y vim curl tzdata gawk
#Time zone adjusted to East eighth District
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
RUN apk --no-cache add tzdata
#set directory to map logs,config file,scripts file. # Set directory to map logs, config files, scripts, and SDK
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/scripts","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
#Copy scripts files and binary files to the blank image # Copy scripts and binary files to the production image
COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts
COPY --from=build /Open-IM-Server/_output/bin/platforms/linux/amd64 /Open-IM-Server/_output/bin/platforms/linux/amd64 COPY --from=build /Open-IM-Server/_output/bin/platforms/linux/arm64 /Open-IM-Server/_output/bin/platforms/linux/arm64
WORKDIR /Open-IM-Server/scripts WORKDIR /Open-IM-Server/scripts

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main package main
import ( import (

@ -100,7 +100,7 @@ services:
openim_server: openim_server:
image: ghcr.io/openimsdk/openim-server:v3.0.0-alpha.0 image: ghcr.io/openimsdk/openim-server:v3.0.0-alpha.1
container_name: openim-server container_name: openim-server
volumes: volumes:
- ./logs:/Open-IM-Server/logs - ./logs:/Open-IM-Server/logs

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package api package api
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package msgtransfer package msgtransfer
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package push package push
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package conversation package conversation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package group package group
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package group package group
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package msg package msg
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package msg package msg
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package third package third
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package third package third
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package third package third
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package user package user
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package tools package tools
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package tools package tools
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package apiresp package apiresp
type ApiFormat interface { type ApiFormat interface {

@ -47,8 +47,7 @@ type ForceLogoutReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type ForceLogoutResp struct { type ForceLogoutResp struct{}
}
type ParseTokenReq struct { type ParseTokenReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`

@ -68,16 +68,14 @@ type SetConversationReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type SetConversationResp struct { type SetConversationResp struct{}
}
type ModifyConversationFieldReq struct { type ModifyConversationFieldReq struct {
Conversation Conversation
FieldType int32 `json:"fieldType" binding:"required"` FieldType int32 `json:"fieldType" binding:"required"`
UserIDList []string `json:"userIDList" binding:"required"` UserIDList []string `json:"userIDList" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type ModifyConversationFieldResp struct { type ModifyConversationFieldResp struct{}
}
type BatchSetConversationsReq struct { type BatchSetConversationsReq struct {
Conversations []Conversation `json:"conversations" binding:"required"` Conversations []Conversation `json:"conversations" binding:"required"`
@ -130,5 +128,4 @@ type SetRecvMsgOptReq struct {
NotificationType int32 `json:"notificationType"` NotificationType int32 `json:"notificationType"`
} }
type SetRecvMsgOptResp struct { type SetRecvMsgOptResp struct{}
}

@ -185,8 +185,7 @@ type AddBlacklistReq struct {
ToUserID string `json:"toUserID" binding:"required"` ToUserID string `json:"toUserID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
} }
type AddBlacklistResp struct { type AddBlacklistResp struct{}
}
type ImportFriendReq struct { type ImportFriendReq struct {
FriendUserIDList []string `json:"friendUserIDList" binding:"required"` FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
@ -212,15 +211,13 @@ type AddFriendResponseReq struct {
HandleResult int32 `json:"flag" binding:"required,oneof=-1 0 1"` HandleResult int32 `json:"flag" binding:"required,oneof=-1 0 1"`
HandleMsg string `json:"handleMsg"` HandleMsg string `json:"handleMsg"`
} }
type AddFriendResponseResp struct { type AddFriendResponseResp struct{}
}
type DeleteFriendReq struct { type DeleteFriendReq struct {
ToUserID string `json:"toUserID" binding:"required"` ToUserID string `json:"toUserID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
} }
type DeleteFriendResp struct { type DeleteFriendResp struct{}
}
type GetBlackListReq struct { type GetBlackListReq struct {
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
@ -234,15 +231,13 @@ type SetFriendRemarkReq struct {
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
Remark string `json:"remark"` Remark string `json:"remark"`
} }
type SetFriendRemarkResp struct { type SetFriendRemarkResp struct{}
}
type RemoveBlacklistReq struct { type RemoveBlacklistReq struct {
ToUserID string `json:"toUserID" binding:"required"` ToUserID string `json:"toUserID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
} }
type RemoveBlacklistResp struct { type RemoveBlacklistResp struct{}
}
type IsFriendReq struct { type IsFriendReq struct {
ToUserID string `json:"toUserID" binding:"required"` ToUserID string `json:"toUserID" binding:"required"`
@ -266,7 +261,7 @@ type GetFriendListResp struct {
AddSource int32 `json:"addSource"` AddSource int32 `json:"addSource"`
OperatorUserID string `json:"operatorUserID"` OperatorUserID string `json:"operatorUserID"`
Ex string `json:"ex"` Ex string `json:"ex"`
//FriendUser *UserInfo // TODO // FriendUser *UserInfo // TODO
} }
type GetFriendApplyListReq struct { type GetFriendApplyListReq struct {

@ -25,8 +25,7 @@ type KickGroupMemberReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type KickGroupMemberResp struct { type KickGroupMemberResp struct {
// UserIDResultList []*UserIDResult `json:"data"`
//UserIDResultList []*UserIDResult `json:"data"`
} }
type GetGroupMembersInfoReq struct { type GetGroupMembersInfoReq struct {
@ -46,8 +45,7 @@ type InviteUserToGroupReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type InviteUserToGroupResp struct { type InviteUserToGroupResp struct {
// UserIDResultList []*UserIDResult `json:"data"`
//UserIDResultList []*UserIDResult `json:"data"`
} }
type GetJoinedGroupListReq struct { type GetJoinedGroupListReq struct {
@ -114,8 +112,9 @@ type CreateGroupResp struct {
type GetGroupApplicationListReq struct { type GetGroupApplicationListReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请 FromUserID string `json:"fromUserID" binding:"required"` // 作为管理员或群主收到的 进群申请
} }
type GetGroupApplicationListResp struct { type GetGroupApplicationListResp struct {
GroupRequestList []*sdkws.GroupRequest `json:"-"` GroupRequestList []*sdkws.GroupRequest `json:"-"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"` Data []map[string]interface{} `json:"data" swaggerignore:"true"`
@ -163,12 +162,11 @@ type GetGroupInfoResp struct {
type ApplicationGroupResponseReq struct { type ApplicationGroupResponseReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID FromUserID string `json:"fromUserID" binding:"required"` // application from FromUserID
HandledMsg string `json:"handledMsg"` HandledMsg string `json:"handledMsg"`
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"` HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
} }
type ApplicationGroupResponseResp struct { type ApplicationGroupResponseResp struct{}
}
type JoinGroupReq struct { type JoinGroupReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
@ -178,15 +176,13 @@ type JoinGroupReq struct {
InviterUserID string `json:"inviterUserID"` InviterUserID string `json:"inviterUserID"`
} }
type JoinGroupResp struct { type JoinGroupResp struct{}
}
type QuitGroupReq struct { type QuitGroupReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type QuitGroupResp struct { type QuitGroupResp struct{}
}
type SetGroupInfoReq struct { type SetGroupInfoReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
@ -201,8 +197,7 @@ type SetGroupInfoReq struct {
ApplyMemberFriend *int32 `json:"applyMemberFriend"` ApplyMemberFriend *int32 `json:"applyMemberFriend"`
} }
type SetGroupInfoResp struct { type SetGroupInfoResp struct{}
}
type TransferGroupOwnerReq struct { type TransferGroupOwnerReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
@ -210,15 +205,13 @@ type TransferGroupOwnerReq struct {
NewOwnerUserID string `json:"newOwnerUserID" binding:"required"` NewOwnerUserID string `json:"newOwnerUserID" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type TransferGroupOwnerResp struct { type TransferGroupOwnerResp struct{}
}
type DismissGroupReq struct { type DismissGroupReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type DismissGroupResp struct { type DismissGroupResp struct{}
}
type MuteGroupMemberReq struct { type MuteGroupMemberReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
@ -226,30 +219,26 @@ type MuteGroupMemberReq struct {
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
MutedSeconds uint32 `json:"mutedSeconds" binding:"required"` MutedSeconds uint32 `json:"mutedSeconds" binding:"required"`
} }
type MuteGroupMemberResp struct { type MuteGroupMemberResp struct{}
}
type CancelMuteGroupMemberReq struct { type CancelMuteGroupMemberReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
} }
type CancelMuteGroupMemberResp struct { type CancelMuteGroupMemberResp struct{}
}
type MuteGroupReq struct { type MuteGroupReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
} }
type MuteGroupResp struct { type MuteGroupResp struct{}
}
type CancelMuteGroupReq struct { type CancelMuteGroupReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
} }
type CancelMuteGroupResp struct { type CancelMuteGroupResp struct{}
}
type SetGroupMemberNicknameReq struct { type SetGroupMemberNicknameReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
@ -258,8 +247,7 @@ type SetGroupMemberNicknameReq struct {
Nickname string `json:"nickname"` Nickname string `json:"nickname"`
} }
type SetGroupMemberNicknameResp struct { type SetGroupMemberNicknameResp struct{}
}
type SetGroupMemberInfoReq struct { type SetGroupMemberInfoReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
@ -271,8 +259,7 @@ type SetGroupMemberInfoReq struct {
Ex *string `json:"ex"` Ex *string `json:"ex"`
} }
type SetGroupMemberInfoResp struct { type SetGroupMemberInfoResp struct{}
}
type GetGroupAbstractInfoReq struct { type GetGroupAbstractInfoReq struct {
OperationID string `json:"operationID"` OperationID string `json:"operationID"`

@ -36,15 +36,14 @@ type GetUsersOnlineStatusReq struct {
UserIDList []string `json:"userIDList" binding:"required,lte=200"` UserIDList []string `json:"userIDList" binding:"required,lte=200"`
} }
type GetUsersOnlineStatusResp struct { type GetUsersOnlineStatusResp struct {
// SuccessResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult `json:"data"`
//SuccessResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult `json:"data"`
} }
type AccountCheckReq struct { type AccountCheckReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"` CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"`
} }
type AccountCheckResp struct { type AccountCheckResp struct{}
}
type ManagementSendMsg struct { type ManagementSendMsg struct {
SendID string `json:"sendID" binding:"required"` SendID string `json:"sendID" binding:"required"`

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package apistruct package apistruct
type DelMsgReq struct { type DelMsgReq struct {
@ -6,16 +20,14 @@ type DelMsgReq struct {
OperationID string `json:"operationID,omitempty" binding:"required"` OperationID string `json:"operationID,omitempty" binding:"required"`
} }
type DelMsgResp struct { type DelMsgResp struct{}
}
type CleanUpMsgReq struct { type CleanUpMsgReq struct {
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type CleanUpMsgResp struct { type CleanUpMsgResp struct{}
}
type DelSuperGroupMsgReq struct { type DelSuperGroupMsgReq struct {
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
@ -25,8 +37,7 @@ type DelSuperGroupMsgReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type DelSuperGroupMsgResp struct { type DelSuperGroupMsgResp struct{}
}
type MsgDeleteNotificationElem struct { type MsgDeleteNotificationElem struct {
GroupID string `json:"groupID"` GroupID string `json:"groupID"`
@ -41,8 +52,7 @@ type SetMsgMinSeqReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type SetMsgMinSeqResp struct { type SetMsgMinSeqResp struct{}
}
type PictureBaseInfo struct { type PictureBaseInfo struct {
UUID string `mapstructure:"uuid"` UUID string `mapstructure:"uuid"`

@ -58,8 +58,7 @@ type UploadUpdateAppReq struct {
UpdateLog string `form:"updateLog" binding:"required"` UpdateLog string `form:"updateLog" binding:"required"`
} }
type UploadUpdateAppResp struct { type UploadUpdateAppResp struct{}
}
type GetDownloadURLReq struct { type GetDownloadURLReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
@ -111,21 +110,19 @@ type GetRTCInvitationInfoStartAppResp struct {
} }
/** /**
* FCMToken * FCMToken.
*/ */
type FcmUpdateTokenReq struct { type FcmUpdateTokenReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
Platform int `json:"platform" binding:"required,min=1,max=2"` //only for ios + android Platform int `json:"platform" binding:"required,min=1,max=2"` // only for ios + android
FcmToken string `json:"fcmToken" binding:"required"` FcmToken string `json:"fcmToken" binding:"required"`
} }
type FcmUpdateTokenResp struct { type FcmUpdateTokenResp struct{}
}
type SetAppBadgeReq struct { type SetAppBadgeReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"` FromUserID string `json:"fromUserID" binding:"required"`
AppUnreadCount int32 `json:"appUnreadCount"` AppUnreadCount int32 `json:"appUnreadCount"`
} }
type SetAppBadgeResp struct { type SetAppBadgeResp struct{}
}

@ -16,7 +16,7 @@ package callbackstruct
type CallbackUserOnlineReq struct { type CallbackUserOnlineReq struct {
UserStatusCallbackReq UserStatusCallbackReq
//Token string `json:"token"` // Token string `json:"token"`
Seq int64 `json:"seq"` Seq int64 `json:"seq"`
IsAppBackground bool `json:"isAppBackground"` IsAppBackground bool `json:"isAppBackground"`
ConnID string `json:"connID"` ConnID string `json:"connID"`

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cmd package cmd
import ( import (

@ -17,7 +17,7 @@ package constant
const ( const (
///ContentType ///ContentType
//UserRelated //UserRelated.
ContentTypeBegin = 100 ContentTypeBegin = 100
Text = 101 Text = 101
Picture = 102 Picture = 102
@ -45,23 +45,23 @@ const (
SignalMsg = 202 SignalMsg = 202
CustomNotification = 203 CustomNotification = 203
//SysRelated //SysRelated.
NotificationBegin = 1000 NotificationBegin = 1000
FriendApplicationApprovedNotification = 1201 //add_friend_response FriendApplicationApprovedNotification = 1201 // add_friend_response
FriendApplicationRejectedNotification = 1202 //add_friend_response FriendApplicationRejectedNotification = 1202 // add_friend_response
FriendApplicationNotification = 1203 //add_friend FriendApplicationNotification = 1203 // add_friend
FriendAddedNotification = 1204 FriendAddedNotification = 1204
FriendDeletedNotification = 1205 //delete_friend FriendDeletedNotification = 1205 // delete_friend
FriendRemarkSetNotification = 1206 //set_friend_remark? FriendRemarkSetNotification = 1206 // set_friend_remark?
BlackAddedNotification = 1207 //add_black BlackAddedNotification = 1207 // add_black
BlackDeletedNotification = 1208 //remove_black BlackDeletedNotification = 1208 // remove_black
FriendInfoUpdatedNotification = 1209 FriendInfoUpdatedNotification = 1209
ConversationChangeNotification = 1300 // change conversation opt ConversationChangeNotification = 1300 // change conversation opt
UserNotificationBegin = 1301 UserNotificationBegin = 1301
UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 UserInfoUpdatedNotification = 1303 // SetSelfInfoTip = 204
UserNotificationEnd = 1399 UserNotificationEnd = 1399
OANotification = 1400 OANotification = 1400
@ -113,37 +113,37 @@ const (
NotificationEnd = 5000 NotificationEnd = 5000
//status //status.
MsgNormal = 1 MsgNormal = 1
MsgDeleted = 4 MsgDeleted = 4
//MsgFrom //MsgFrom.
UserMsgType = 100 UserMsgType = 100
SysMsgType = 200 SysMsgType = 200
//SessionType //SessionType.
SingleChatType = 1 SingleChatType = 1
GroupChatType = 2 GroupChatType = 2
SuperGroupChatType = 3 SuperGroupChatType = 3
NotificationChatType = 4 NotificationChatType = 4
//token //token.
NormalToken = 0 NormalToken = 0
InValidToken = 1 InValidToken = 1
KickedToken = 2 KickedToken = 2
ExpiredToken = 3 ExpiredToken = 3
//MultiTerminalLogin //MultiTerminalLogin.
DefalutNotKick = 0 DefalutNotKick = 0
//Full-end login, but the same end is mutually exclusive //Full-end login, but the same end is mutually exclusive.
AllLoginButSameTermKick = 1 AllLoginButSameTermKick = 1
//Only one of the endpoints can log in //Only one of the endpoints can log in.
SingleTerminalLogin = 2 SingleTerminalLogin = 2
//The web side can be online at the same time, and the other side can only log in at one end //The web side can be online at the same time, and the other side can only log in at one end.
WebAndOther = 3 WebAndOther = 3
// The PC side is mutually exclusive, and the mobile side is mutually exclusive, but the web side can be online at // The PC side is mutually exclusive, and the mobile side is mutually exclusive, but the web side can be online at
// the same time // the same time.
PcMobileAndWeb = 4 PcMobileAndWeb = 4
//The PC terminal can be online at the same time,but other terminal only one of the endpoints can login //The PC terminal can be online at the same time,but other terminal only one of the endpoints can login.
PCAndOther = 5 PCAndOther = 5
OnlineStatus = "online" OnlineStatus = "online"
@ -151,12 +151,12 @@ const (
Registered = "registered" Registered = "registered"
UnRegistered = "unregistered" UnRegistered = "unregistered"
//MsgReceiveOpt //MsgReceiveOpt.
ReceiveMessage = 0 ReceiveMessage = 0
NotReceiveMessage = 1 NotReceiveMessage = 1
ReceiveNotNotifyMessage = 2 ReceiveNotNotifyMessage = 2
//OptionsKey //OptionsKey.
IsHistory = "history" IsHistory = "history"
IsPersistent = "persistent" IsPersistent = "persistent"
IsOfflinePush = "offlinePush" IsOfflinePush = "offlinePush"
@ -170,13 +170,13 @@ const (
IsNotNotification = "isNotNotification" IsNotNotification = "isNotNotification"
IsSendMsg = "isSendMsg" IsSendMsg = "isSendMsg"
//GroupStatus //GroupStatus.
GroupOk = 0 GroupOk = 0
GroupBanChat = 1 GroupBanChat = 1
GroupStatusDismissed = 2 GroupStatusDismissed = 2
GroupStatusMuted = 3 GroupStatusMuted = 3
//GroupType //GroupType.
NormalGroup = 0 NormalGroup = 0
SuperGroup = 1 SuperGroup = 1
WorkingGroup = 2 WorkingGroup = 2
@ -184,19 +184,19 @@ const (
GroupBaned = 3 GroupBaned = 3
GroupBanPrivateChat = 4 GroupBanPrivateChat = 4
//UserJoinGroupSource //UserJoinGroupSource.
JoinByAdmin = 1 JoinByAdmin = 1
JoinByInvitation = 2 JoinByInvitation = 2
JoinBySearch = 3 JoinBySearch = 3
JoinByQRCode = 4 JoinByQRCode = 4
//Minio //Minio.
MinioDurationTimes = 3600 MinioDurationTimes = 3600
//Aws //Aws.
AwsDurationTimes = 3600 AwsDurationTimes = 3600
//callbackCommand //callbackCommand.
CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand" CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand"
CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand" CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand"
CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand"
@ -217,19 +217,19 @@ const (
CallbackGetMessageListReactionExtensionsCommand = "callbackGetMessageListReactionExtensionsCommand" CallbackGetMessageListReactionExtensionsCommand = "callbackGetMessageListReactionExtensionsCommand"
CallbackAddMessageListReactionExtensionsCommand = "callbackAddMessageListReactionExtensionsCommand" CallbackAddMessageListReactionExtensionsCommand = "callbackAddMessageListReactionExtensionsCommand"
//callback actionCode //callback actionCode.
ActionAllow = 0 ActionAllow = 0
ActionForbidden = 1 ActionForbidden = 1
//callback callbackHandleCode //callback callbackHandleCode.
CallbackHandleSuccess = 0 CallbackHandleSuccess = 0
CallbackHandleFailed = 1 CallbackHandleFailed = 1
// minioUpload // minioUpload.
OtherType = 1 OtherType = 1
VideoType = 2 VideoType = 2
ImageType = 3 ImageType = 3
// sendMsgStaus // sendMsgStaus.
MsgStatusNotExist = 0 MsgStatusNotExist = 0
MsgIsSending = 1 MsgIsSending = 1
MsgSendSuccessed = 2 MsgSendSuccessed = 2
@ -299,25 +299,27 @@ const (
Female = 2 Female = 2
) )
const OperationID = "operationID" const (
const OpUserID = "opUserID" OperationID = "operationID"
const ConnID = "connID" OpUserID = "opUserID"
const OpUserPlatform = "platform" ConnID = "connID"
const Token = "token" OpUserPlatform = "platform"
const RpcCustomHeader = "customHeader" // rpc中间件自定义ctx参数 Token = "token"
const CheckKey = "CheckKey" RpcCustomHeader = "customHeader" // rpc中间件自定义ctx参数
const TriggerID = "triggerID" CheckKey = "CheckKey"
const RemoteAddr = "remoteAddr" TriggerID = "triggerID"
RemoteAddr = "remoteAddr"
)
const ( const (
BecomeFriendByImport = 1 //管理员导入 BecomeFriendByImport = 1 // 管理员导入
BecomeFriendByApply = 2 //申请添加 BecomeFriendByApply = 2 // 申请添加
) )
const ( const (
ApplyNeedVerificationInviteDirectly = 0 // 申请需要同意 邀请直接进 ApplyNeedVerificationInviteDirectly = 0 // 申请需要同意 邀请直接进
AllNeedVerification = 1 //所有人进群需要验证,除了群主管理员邀请进群 AllNeedVerification = 1 // 所有人进群需要验证,除了群主管理员邀请进群
Directly = 2 //直接进群 Directly = 2 // 直接进群
) )
const ( const (
@ -345,7 +347,7 @@ const LogFileName = "OpenIM.log"
const LocalHost = "0.0.0.0" const LocalHost = "0.0.0.0"
// flag parse // flag parse.
const ( const (
FlagPort = "port" FlagPort = "port"
FlagWsPort = "ws_port" FlagWsPort = "ws_port"

@ -15,10 +15,9 @@
package constant package constant
// fixme 1<--->IOS 2<--->Android 3<--->Windows // fixme 1<--->IOS 2<--->Android 3<--->Windows
//fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux // fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux
const ( const (
//Platform ID //Platform ID.
IOSPlatformID = 1 IOSPlatformID = 1
AndroidPlatformID = 2 AndroidPlatformID = 2
WindowsPlatformID = 3 WindowsPlatformID = 3
@ -30,7 +29,7 @@ const (
IPadPlatformID = 9 IPadPlatformID = 9
AdminPlatformID = 10 AdminPlatformID = 10
//Platform string match to Platform ID //Platform string match to Platform ID.
IOSPlatformStr = "IOS" IOSPlatformStr = "IOS"
AndroidPlatformStr = "Android" AndroidPlatformStr = "Android"
WindowsPlatformStr = "Windows" WindowsPlatformStr = "Windows"
@ -42,7 +41,7 @@ const (
IPadPlatformStr = "IPad" IPadPlatformStr = "IPad"
AdminPlatformStr = "Admin" AdminPlatformStr = "Admin"
//terminal types //terminal types.
TerminalPC = "PC" TerminalPC = "PC"
TerminalMobile = "Mobile" TerminalMobile = "Mobile"
) )
@ -59,6 +58,7 @@ var PlatformID2Name = map[int]string{
IPadPlatformID: IPadPlatformStr, IPadPlatformID: IPadPlatformStr,
AdminPlatformID: AdminPlatformStr, AdminPlatformID: AdminPlatformStr,
} }
var PlatformName2ID = map[string]int{ var PlatformName2ID = map[string]int{
IOSPlatformStr: IOSPlatformID, IOSPlatformStr: IOSPlatformID,
AndroidPlatformStr: AndroidPlatformID, AndroidPlatformStr: AndroidPlatformID,
@ -71,6 +71,7 @@ var PlatformName2ID = map[string]int{
IPadPlatformStr: IPadPlatformID, IPadPlatformStr: IPadPlatformID,
AdminPlatformStr: AdminPlatformID, AdminPlatformStr: AdminPlatformID,
} }
var PlatformName2class = map[string]string{ var PlatformName2class = map[string]string{
IOSPlatformStr: TerminalMobile, IOSPlatformStr: TerminalMobile,
AndroidPlatformStr: TerminalMobile, AndroidPlatformStr: TerminalMobile,
@ -80,6 +81,7 @@ var PlatformName2class = map[string]string{
OSXPlatformStr: TerminalPC, OSXPlatformStr: TerminalPC,
LinuxPlatformStr: TerminalPC, LinuxPlatformStr: TerminalPC,
} }
var PlatformID2class = map[int]string{ var PlatformID2class = map[int]string{
IOSPlatformID: TerminalMobile, IOSPlatformID: TerminalMobile,
AndroidPlatformID: TerminalMobile, AndroidPlatformID: TerminalMobile,
@ -93,12 +95,15 @@ var PlatformID2class = map[int]string{
func PlatformIDToName(num int) string { func PlatformIDToName(num int) string {
return PlatformID2Name[num] return PlatformID2Name[num]
} }
func PlatformNameToID(name string) int { func PlatformNameToID(name string) int {
return PlatformName2ID[name] return PlatformName2ID[name]
} }
func PlatformNameToClass(name string) string { func PlatformNameToClass(name string) string {
return PlatformName2class[name] return PlatformName2class[name]
} }
func PlatformIDToClass(num int) string { func PlatformIDToClass(num int) string {
return PlatformID2class[num] return PlatformID2class[num]
} }

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package controller package controller
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package controller package controller
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package controller package controller
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package relation package relation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package relation package relation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package relation package relation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cont package cont
const ( const (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cont package cont
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cont package cont
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cont package cont
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cont package cont
import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3" import "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3"

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cos package cos
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package minio package minio
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package oss package oss
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package oss package oss
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package oss package oss
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package s3 package s3
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package relation package relation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package relation package relation
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package log package log
import ( import (

@ -26,12 +26,15 @@ var mapper = []string{constant.OperationID, constant.OpUserID, constant.OpUserPl
func WithOpUserIDContext(ctx context.Context, opUserID string) context.Context { func WithOpUserIDContext(ctx context.Context, opUserID string) context.Context {
return context.WithValue(ctx, constant.OpUserID, opUserID) return context.WithValue(ctx, constant.OpUserID, opUserID)
} }
func WithOpUserPlatformContext(ctx context.Context, platform string) context.Context { func WithOpUserPlatformContext(ctx context.Context, platform string) context.Context {
return context.WithValue(ctx, constant.OpUserPlatform, platform) return context.WithValue(ctx, constant.OpUserPlatform, platform)
} }
func WithTriggerIDContext(ctx context.Context, triggerID string) context.Context { func WithTriggerIDContext(ctx context.Context, triggerID string) context.Context {
return context.WithValue(ctx, constant.TriggerID, triggerID) return context.WithValue(ctx, constant.TriggerID, triggerID)
} }
func NewCtx(operationID string) context.Context { func NewCtx(operationID string) context.Context {
c := context.Background() c := context.Background()
ctx := context.WithValue(c, constant.OperationID, operationID) ctx := context.WithValue(c, constant.OperationID, operationID)
@ -59,6 +62,7 @@ func GetOperationID(ctx context.Context) string {
} }
return "" return ""
} }
func GetOpUserID(ctx context.Context) string { func GetOpUserID(ctx context.Context) string {
if ctx.Value(constant.OpUserID) != "" { if ctx.Value(constant.OpUserID) != "" {
s, ok := ctx.Value(constant.OpUserID).(string) s, ok := ctx.Value(constant.OpUserID).(string)
@ -68,6 +72,7 @@ func GetOpUserID(ctx context.Context) string {
} }
return "" return ""
} }
func GetConnID(ctx context.Context) string { func GetConnID(ctx context.Context) string {
if ctx.Value(constant.ConnID) != "" { if ctx.Value(constant.ConnID) != "" {
s, ok := ctx.Value(constant.ConnID).(string) s, ok := ctx.Value(constant.ConnID).(string)
@ -87,6 +92,7 @@ func GetTriggerID(ctx context.Context) string {
} }
return "" return ""
} }
func GetOpUserPlatform(ctx context.Context) string { func GetOpUserPlatform(ctx context.Context) string {
if ctx.Value(constant.OpUserPlatform) != "" { if ctx.Value(constant.OpUserPlatform) != "" {
s, ok := ctx.Value(constant.OpUserPlatform).(string) s, ok := ctx.Value(constant.OpUserPlatform).(string)
@ -96,6 +102,7 @@ func GetOpUserPlatform(ctx context.Context) string {
} }
return "" return ""
} }
func GetRemoteAddr(ctx context.Context) string { func GetRemoteAddr(ctx context.Context) string {
if ctx.Value(constant.RemoteAddr) != "" { if ctx.Value(constant.RemoteAddr) != "" {
s, ok := ctx.Value(constant.RemoteAddr).(string) s, ok := ctx.Value(constant.RemoteAddr).(string)
@ -142,8 +149,6 @@ func WithMustInfoCtx(values []string) context.Context {
ctx := context.Background() ctx := context.Background()
for i, v := range values { for i, v := range values {
ctx = context.WithValue(ctx, mapper[i], v) ctx = context.WithValue(ctx, mapper[i], v)
} }
return ctx return ctx
} }

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package zookeeper package zookeeper
import ( import (

@ -14,7 +14,7 @@
package errs package errs
// UnknownCode 没有解析到code或解析的code=0 // UnknownCode 没有解析到code或解析的code=0.
const UnknownCode = 1000 const UnknownCode = 1000
const ( const (
@ -34,47 +34,47 @@ const (
InvitationError = 10014 InvitationError = 10014
) )
// 通用错误码 // 通用错误码.
const ( const (
NoError = 0 //无错误 NoError = 0 // 无错误
DatabaseError = 90002 //redis/mysql等db错误 DatabaseError = 90002 // redis/mysql等db错误
NetworkError = 90004 //网络错误 NetworkError = 90004 // 网络错误
DataError = 90007 //数据错误 DataError = 90007 // 数据错误
CallbackError = 80000 CallbackError = 80000
//通用错误码 //通用错误码.
ServerInternalError = 500 //服务器内部错误 ServerInternalError = 500 //服务器内部错误
ArgsError = 1001 //输入参数错误 ArgsError = 1001 //输入参数错误
NoPermissionError = 1002 //权限不足 NoPermissionError = 1002 //权限不足
DuplicateKeyError = 1003 DuplicateKeyError = 1003
RecordNotFoundError = 1004 //记录不存在 RecordNotFoundError = 1004 // 记录不存在
// 账号错误码 // 账号错误码.
UserIDNotFoundError = 1101 //UserID不存在 或未注册 UserIDNotFoundError = 1101 // UserID不存在 或未注册
RegisteredAlreadyError = 1102 //用户已经注册过了 RegisteredAlreadyError = 1102 // 用户已经注册过了
// 群组错误码 // 群组错误码.
GroupIDNotFoundError = 1201 //GroupID不存在 GroupIDNotFoundError = 1201 // GroupID不存在
GroupIDExisted = 1202 //GroupID已存在 GroupIDExisted = 1202 // GroupID已存在
NotInGroupYetError = 1203 //不在群组中 NotInGroupYetError = 1203 // 不在群组中
DismissedAlreadyError = 1204 //群组已经解散 DismissedAlreadyError = 1204 // 群组已经解散
GroupTypeNotSupport = 1205 GroupTypeNotSupport = 1205
GroupRequestHandled = 1206 GroupRequestHandled = 1206
// 关系链错误码 // 关系链错误码.
CanNotAddYourselfError = 1301 //不能添加自己为好友 CanNotAddYourselfError = 1301 // 不能添加自己为好友
BlockedByPeer = 1302 //被对方拉黑 BlockedByPeer = 1302 // 被对方拉黑
NotPeersFriend = 1303 //不是对方的好友 NotPeersFriend = 1303 // 不是对方的好友
RelationshipAlreadyError = 1304 //已经是好友关系 RelationshipAlreadyError = 1304 // 已经是好友关系
// 消息错误码 // 消息错误码.
MessageHasReadDisable = 1401 MessageHasReadDisable = 1401
MutedInGroup = 1402 //群成员被禁言 MutedInGroup = 1402 // 群成员被禁言
MutedGroup = 1403 //群被禁言 MutedGroup = 1403 // 群被禁言
MsgAlreadyRevoke = 1404 //消息已撤回 MsgAlreadyRevoke = 1404 // 消息已撤回
// token错误码 // token错误码.
TokenExpiredError = 1501 TokenExpiredError = 1501
TokenInvalidError = 1502 TokenInvalidError = 1502
TokenMalformedError = 1503 TokenMalformedError = 1503
@ -83,10 +83,10 @@ const (
TokenKickedError = 1506 TokenKickedError = 1506
TokenNotExistError = 1507 TokenNotExistError = 1507
// 长连接网关错误码 // 长连接网关错误码.
ConnOverMaxNumLimit = 1601 ConnOverMaxNumLimit = 1601
ConnArgsErr = 1602 ConnArgsErr = 1602
// S3错误码 // S3错误码.
FileUploadedExpiredError = 1701 // 上传过期 FileUploadedExpiredError = 1701 // 上传过期
) )

@ -38,11 +38,11 @@ var (
ErrData = NewCodeError(DataError, "DataError") ErrData = NewCodeError(DataError, "DataError")
ErrTokenExpired = NewCodeError(TokenExpiredError, "TokenExpiredError") ErrTokenExpired = NewCodeError(TokenExpiredError, "TokenExpiredError")
ErrTokenInvalid = NewCodeError(TokenInvalidError, "TokenInvalidError") // ErrTokenInvalid = NewCodeError(TokenInvalidError, "TokenInvalidError") //
ErrTokenMalformed = NewCodeError(TokenMalformedError, "TokenMalformedError") //格式错误 ErrTokenMalformed = NewCodeError(TokenMalformedError, "TokenMalformedError") // 格式错误
ErrTokenNotValidYet = NewCodeError(TokenNotValidYetError, "TokenNotValidYetError") //还未生效 ErrTokenNotValidYet = NewCodeError(TokenNotValidYetError, "TokenNotValidYetError") // 还未生效
ErrTokenUnknown = NewCodeError(TokenUnknownError, "TokenUnknownError") //未知错误 ErrTokenUnknown = NewCodeError(TokenUnknownError, "TokenUnknownError") // 未知错误
ErrTokenKicked = NewCodeError(TokenKickedError, "TokenKickedError") ErrTokenKicked = NewCodeError(TokenKickedError, "TokenKickedError")
ErrTokenNotExist = NewCodeError(TokenNotExistError, "TokenNotExistError") //在redis中不存在 ErrTokenNotExist = NewCodeError(TokenNotExistError, "TokenNotExistError") // 在redis中不存在
ErrDuplicateKey = NewCodeError(DuplicateKeyError, "DuplicateKeyError") ErrDuplicateKey = NewCodeError(DuplicateKeyError, "DuplicateKeyError")
ErrMessageHasReadDisable = NewCodeError(MessageHasReadDisable, "MessageHasReadDisable") ErrMessageHasReadDisable = NewCodeError(MessageHasReadDisable, "MessageHasReadDisable")

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package rpcclient package rpcclient
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package rpcclient package rpcclient
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package notification package notification
import ( import (

@ -1,3 +1,17 @@
// Copyright © 2023 OpenIM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package notification package notification
import ( import (

@ -37,10 +37,12 @@ echo -e "${BOLD_PREFIX}_________________________________________________________
bin_dir="$BIN_DIR" bin_dir="$BIN_DIR"
logs_dir="$OPENIM_ROOT/logs" logs_dir="$OPENIM_ROOT/logs"
sdk_db_dir="$OPENIM_ROOT/db/sdk/" sdk_db_dir="$OPENIM_ROOT/db/sdk/"
echo "==> bin_dir=$bin_dir"
echo "==> logs_dir=$logs_dir"
echo "==> sdk_db_dir=$sdk_db_dir"
# Automatically created when there is no bin, logs folder # Automatically created when there is no bin, logs folder
if [ ! -d $bin_dir ]; then
mkdir -p $bin_dir
fi
if [ ! -d $logs_dir ]; then if [ ! -d $logs_dir ]; then
mkdir -p $logs_dir mkdir -p $logs_dir
fi fi
@ -48,20 +50,17 @@ if [ ! -d $sdk_db_dir ]; then
mkdir -p $sdk_db_dir mkdir -p $sdk_db_dir
fi fi
#Include shell font styles and some basic information cd $OPENIM_ROOT
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
echo "PWD=================>$PWD"
#Include shell font styles and some basic information # CPU core number
source ./style_info.sh cpu_count=$(lscpu | grep -e '^CPU(s):' | awk '{print $2}')
source ./path_info.sh echo -e "${GREEN_PREFIX}======> cpu_count=$cpu_count${COLOR_SUFFIX}"
source ./function.sh
cd $OPENIM_ROOT # Count the number of concurrent compilations (half the number of cpus)
compile_count=$((cpu_count / 2))
# Execute 'make build' # Execute 'make build' run the make command for concurrent compilation
make build make -j$compile_count build
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "make build Error, script exits" echo "make build Error, script exits"

@ -23,14 +23,14 @@ LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE/LICENSE_TEMPLATES
.PHONY: copyright.verify .PHONY: copyright.verify
copyright.verify: tools.verify.addlicense copyright.verify: tools.verify.addlicense
@echo "===========> Validate boilerplate headers for assign files starting in the $(ROOT_DIR) directory" @echo "===========> Validate boilerplate headers for assign files starting in the $(ROOT_DIR) directory"
@$(TOOLS_DIR)/addlicense -v -check -ignore **/test/** -f $(LICENSE_TEMPLATE) $(CODE_DIRS) @$(TOOLS_DIR)/addlicense -v -check -ignore **/test/** -ignore **pb** -f $(LICENSE_TEMPLATE) $(CODE_DIRS)
@echo "===========> End of boilerplate headers check..." @echo "===========> End of boilerplate headers check..."
## copyright.add: Add the boilerplate headers for all files ## copyright.add: Add the boilerplate headers for all files
.PHONY: copyright.add .PHONY: copyright.add
copyright.add: tools.verify.addlicense copyright.add: tools.verify.addlicense
@echo "===========> Adding $(LICENSE_TEMPLATE) the boilerplate headers for all files" @echo "===========> Adding $(LICENSE_TEMPLATE) the boilerplate headers for all files"
@$(TOOLS_DIR)/addlicense -y $(shell date +"%Y") -v -c "OpenIM." -f $(LICENSE_TEMPLATE) $(CODE_DIRS) @$(TOOLS_DIR)/addlicense -y $(shell date +"%Y") -ignore **pb** -v -c "OpenIM." -f $(LICENSE_TEMPLATE) $(CODE_DIRS)
@echo "===========> End the copyright is added..." @echo "===========> End the copyright is added..."
# Addlicense Flags: # Addlicense Flags:

@ -20,6 +20,34 @@
# docker registry: registry.example.com/namespace/image:tag as: registry.hub.docker.com/cubxxw/<image-name>:<tag> # docker registry: registry.example.com/namespace/image:tag as: registry.hub.docker.com/cubxxw/<image-name>:<tag>
# #
# # If you wish built the manager image targeting other platforms you can use the --platform flag.
# # (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# # More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# .PHONY: docker-build
# docker-build: test ## Build docker image with the manager.
# docker build -t ${IMG} .
# .PHONY: docker-push
# docker-push: ## Push docker image with the manager.
# docker push ${IMG}
# # PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# # architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# # - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
# # - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# # - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
# # To properly provided solutions that supports more than one platform you should use this option.
# PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
# .PHONY: docker-buildx
# docker-buildx: test ## Build and push docker image for the manager for cross-platform support
# # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
# sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
# - docker buildx create --name project-v3-builder
# docker buildx use project-v3-builder
# - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
# - docker buildx rm project-v3-builder
# rm Dockerfile.cross
DOCKER := docker DOCKER := docker
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41 DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41

@ -61,7 +61,7 @@ sleep 1
cd ${msg_gateway_binary_root} cd ${msg_gateway_binary_root}
for ((i = 0; i < ${#ws_ports[@]}; i++)); do for ((i = 0; i < ${#ws_ports[@]}; i++)); do
echo "==========================start msg_gateway server===========================">>$OPENIM_ROOT/logs/openIM.log echo "==========================start msg_gateway server===========================">>$OPENIM_ROOT/logs/openIM.log
nohup ./${openim_msggateway} --port ${rpc_ports[$i]} --ws_port ${ws_ports[$i]} --prometheus_port ${prome_ports[$i]} --config_folder_path ${configfile_path} --configFolderPath ${log_path} >>$OPENIM_ROOT/logs/openIM.log 2>&1 & nohup ./${openim_msggateway} --port ${rpc_ports[$i]} --ws_port ${ws_ports[$i]} --prometheus_port ${prome_ports[$i]} --config_folder_path ${configfile_path} >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
done done
#Check launched service process #Check launched service process

@ -55,9 +55,9 @@ sleep 1
cd ${msg_transfer_binary_root} cd ${msg_transfer_binary_root}
for ((i = 0; i < ${msg_transfer_service_num}; i++)); do for ((i = 0; i < ${msg_transfer_service_num}; i++)); do
prome_port=${prome_ports[$i]} prome_port=${prome_ports[$i]}
cmd="nohup ./${openim_msgtransfer} --config_folder_path ${configfile_path} --configFolderPath ${log_path}" cmd="nohup ./${openim_msgtransfer} --config_folder_path ${configfile_path} "
if [ $prome_port != "" ]; then if [ $prome_port != "" ]; then
cmd="$cmd --prometheus_port $prome_port --config_folder_path ${configfile_path} --configFolderPath ${log_path}" cmd="$cmd --prometheus_port $prome_port --config_folder_path ${configfile_path} "
fi fi
echo "==========================start msg_transfer server===========================">>$OPENIM_ROOT/logs/openIM.log echo "==========================start msg_transfer server===========================">>$OPENIM_ROOT/logs/openIM.log
$cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 & $cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &

@ -100,9 +100,9 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
for ((j = 0; j < ${#service_ports[*]}; j++)); do for ((j = 0; j < ${#service_ports[*]}; j++)); do
#Start the service in the background #Start the service in the background
if [ -z "${prome_ports[$j]}" ]; then if [ -z "${prome_ports[$j]}" ]; then
cmd="./${service_filename[$i]} --port ${service_ports[$j]} --config_folder_path ${configfile_path} --configFolderPath ${log_path}" cmd="./${service_filename[$i]} --port ${service_ports[$j]} --config_folder_path ${configfile_path} "
else else
cmd="./${service_filename[$i]} --port ${service_ports[$j]} --prometheus_port ${prome_ports[$j]} --config_folder_path ${configfile_path} --configFolderPath ${log_path}" cmd="./${service_filename[$i]} --port ${service_ports[$j]} --prometheus_port ${prome_ports[$j]} --config_folder_path ${configfile_path} "
fi fi
if [ $i -eq 0 -o $i -eq 1 ]; then if [ $i -eq 0 -o $i -eq 1 ]; then
cmd="./${service_filename[$i]} --port ${service_ports[$j]}" cmd="./${service_filename[$i]} --port ${service_ports[$j]}"

@ -0,0 +1 @@
#!/usr/bin/env bash
Loading…
Cancel
Save