diff --git a/.github/workflows/auto-invite.yml b/.github/workflows/auto-invite.yml index 0fd9a4eab..9f5597e34 100644 --- a/.github/workflows/auto-invite.yml +++ b/.github/workflows/auto-invite.yml @@ -41,7 +41,7 @@ jobs: + We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) team channel. + Get in touch with us on [Gmail](https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email. + Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information. - + Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible. + + Add [Wechat](https://github.com/openimsdk/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible. - name: Close Issue uses: peter-evans/close-issue@v3 diff --git a/.gitignore b/.gitignore index 37742a76f..ea171e8a3 100644 --- a/.gitignore +++ b/.gitignore @@ -373,3 +373,5 @@ dist # config files, may contain sensitive informatio config/config.yaml + +start-config.yml \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 2c7ab5348..a80d2c059 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -176,7 +176,7 @@ linters-settings: # put imports beginning with prefix after 3rd-party packages; # only support one prefix # if not set, use goimports.local-prefixes - prefix: github.com/OpenIMSDK/OpenKF + prefix: github.com/openimsdk/OpenKF gocognit: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 30 @@ -333,7 +333,7 @@ linters-settings: goimports: # put imports beginning with prefix after 3rd-party packages; # it's a comma-separated list of prefixes - local-prefixes: github.com/OpenIMSDK/OpenKF + local-prefixes: github.com/openimsdk/OpenKF golint: # minimal confidence for issues, default is 0.8 min-confidence: 0.9 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 56c73e225..1c619187c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -245,7 +245,7 @@ changelog: # build_flag_templates: # - "--pull" # - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/chat/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/chat/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/chat/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -267,7 +267,7 @@ changelog: # build_flag_templates: # - "--pull" # - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/chat/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/chat/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/chat/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -289,7 +289,7 @@ changelog: # build_flag_templates: # - "--pull" # - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/chat/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/chat/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/chat/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -311,7 +311,7 @@ changelog: # build_flag_templates: # - "--pull" # - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/chat/main/README.md" -# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/chat/blob/main/assets/logo/openim-logo-green.png" +# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/openimsdk/chat/blob/main/assets/logo/openim-logo-green.png" # - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]' # - "--label=io.artifacthub.package.license=Apace-2.0" # - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system" @@ -361,7 +361,7 @@ nfpms: - admin-rpc # Your app's vendor. vendor: OpenIMSDK - homepage: https://github.com/OpenIMSDK/chat + homepage: https://github.com/openimsdk/chat maintainer: kubbot description: |- Auto sync github labels @@ -441,17 +441,17 @@ release: prerelease: auto footer: | - ## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉! + ## Welcome to the {{ .Tag }} release of [chat](https://github.com/openimsdk/chat)!🎉🎉! - **Full Changelog**: https://github.com/OpenIMSDK/chat/compare/{{ .PreviousTag }}...{{ .Tag }} + **Full Changelog**: https://github.com/openimsdk/chat/compare/{{ .PreviousTag }}...{{ .Tag }} ## Helping out - + We release logs are recorded on [✨ CHANGELOG](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md) + + We release logs are recorded on [✨ CHANGELOG](https://github.com/openimsdk/Open-IM-Server/blob/main/CHANGELOG/CHANGELOG.md) - + For information on versions of OpenIM and how to maintain branches, read [📚this article](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md) + + For information on versions of OpenIM and how to maintain branches, read [📚this article](https://github.com/openimsdk/Open-IM-Server/blob/main/docs/conversions/version.md) - + If you wish to use mirroring, read OpenIM's [image management policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md) + + If you wish to use mirroring, read OpenIM's [image management policy](https://github.com/openimsdk/Open-IM-Server/blob/main/docs/conversions/images.md) **Want to be one of them 😘?** @@ -460,7 +460,7 @@ release: - + @@ -470,8 +470,8 @@ release: > **Note** > @openimbot and @kubbot have made great contributions to the community as community 🤖robots(@openimsdk/bot), respectively. > Thanks to the @openimsdk/openim team for all their hard work on this release. - > Thank you to all the [💕developers and contributors](https://github.com/OpenIMSDK/chat/graphs/contributors), people from all over the world, OpenIM brings us together - > Contributions to this project are welcome! Please see [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md) for details. + > Thank you to all the [💕developers and contributors](https://github.com/openimsdk/chat/graphs/contributors), people from all over the world, OpenIM brings us together + > Contributions to this project are welcome! Please see [CONTRIBUTING.md](https://github.com/openimsdk/Open-IM-Server/blob/main/CONTRIBUTING.md) for details. ## Get Involved with OpenIM! @@ -492,4 +492,4 @@ release: # announce: # slack: # enabled: false -# message_template: "slack {{ .Tag }} is out! Check it out: https://github.com/OpenIMSDK/Open-IM-Server/releases/tag/{{ .Tag }}" +# message_template: "slack {{ .Tag }} is out! Check it out: https://github.com/openimsdk/Open-IM-Server/releases/tag/{{ .Tag }}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 85f92bb36..01e780ebc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ The [Makefile](./Makefile) is for every developer, even if you don't know how to #### Code and doc contribution -Every action to make project Open-IM-Server better is encouraged. On GitHub, every improvement for Open-IM-Server could be via a [PR](https://github.com/OpenIMSDK/Open-IM-Server/pulls) (short for pull request). +Every action to make project Open-IM-Server better is encouraged. On GitHub, every improvement for Open-IM-Server could be via a [PR](https://github.com/openimsdk/Open-IM-Server/pulls) (short for pull request). + If you find a typo, try to fix it! + If you find a bug, try to fix it! @@ -57,14 +57,14 @@ Every action to make project Open-IM-Server better is encouraged. On GitHub, eve #### Where should I start? -+ If you are new to the project, don't know how to contribute Open-IM-Server, please check out the [good first issue](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. -+ You should be good at filtering the Open-IM-Server issue tags and finding the ones you like, such as [RFC](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+label%3Abug+) fixes. -+ If you are looking for something to work on, check out our [open issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). -+ If you have an idea for a new feature, please [open an issue](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose), and we can discuss it. ++ If you are new to the project, don't know how to contribute Open-IM-Server, please check out the [good first issue](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. ++ You should be good at filtering the Open-IM-Server issue tags and finding the ones you like, such as [RFC](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+label%3Abug+) fixes. ++ If you are looking for something to work on, check out our [open issues](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). ++ If you have an idea for a new feature, please [open an issue](https://github.com/openimsdk/Open-IM-Server/issues/new/choose), and we can discuss it. #### Design documents -For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/OpenIMSDK/Open-IM-Server/discussions) for better collaboration. Of course, after completing the design document, we should also add it to our [Shared Drive](https://drive.google.com/drive/) and notify the appropriate working group to let everyone know of its existence. Only by doing so can we maximize the effectiveness of the design document and provide strong support for the smooth progress of the project. +For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/openimsdk/Open-IM-Server/discussions) for better collaboration. Of course, after completing the design document, we should also add it to our [Shared Drive](https://drive.google.com/drive/) and notify the appropriate working group to let everyone know of its existence. Only by doing so can we maximize the effectiveness of the design document and provide strong support for the smooth progress of the project. Anybody can access the shared Drive for reading. To get access to comment. Once you've done that, head to the [shared Drive](https://drive.google.com/) and behold all the docs. @@ -91,10 +91,10 @@ To propose PR for the Open-IM-Server item, we assume you have registered a GitHu 2. **CLONE** your own repository to main locally. Use `git clone https://github.com//Open-IM-Server.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make. -3. **Set Remote** upstream to be `https://github.com/OpenIMSDK/Open-IM-Server.git` using the following two commands: +3. **Set Remote** upstream to be `https://github.com/openimsdk/Open-IM-Server.git` using the following two commands: ```bash - ❯ git remote add upstream https://github.com/OpenIMSDK/Open-IM-Server.git + ❯ git remote add upstream https://github.com/openimsdk/Open-IM-Server.git ❯ git remote set-url --push upstream no-pushing ``` @@ -104,7 +104,7 @@ To propose PR for the Open-IM-Server item, we assume you have registered a GitHu ❯ git remote -v origin https://github.com//Open-IM-Server.git (fetch) origin https://github.com//Open-IM-Server.git (push) - upstream https://github.com/OpenIMSDK/Open-IM-Server.git (fetch) + upstream https://github.com/openimsdk/Open-IM-Server.git (fetch) upstream no-pushing (push) ``` @@ -186,11 +186,11 @@ Instead we encourage you to send us a private email to winxu81@gmail.com to repo #### Reporting general issues -To be honest, we regard every user of Open-IM-Serveras a very kind contributor. After experiencing Open-IM-Server, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/OpenIMSDK/Open-IM-Server/issues/new/choose). +To be honest, we regard every user of Open-IM-Serveras a very kind contributor. After experiencing Open-IM-Server, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/openimsdk/Open-IM-Server/issues/new/choose). Since we collaborate project Open-IM-Server in a distributed way, we appreciate **WELL-WRITTEN**, **DETAILED**, **EXPLICIT** issue reports. To make the communication more efficient, we wish everyone could search if your issue is an existing one in the searching list. If you find it existing, please add your details in comments under the existing issue instead of opening a brand new one. -To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/OpenIMSDK/.github/tree/main/.github/ISSUE_TEMPLATE) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. +To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/openimsdk/.github/tree/main/.github/ISSUE_TEMPLATE) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. **There are a lot of cases when you could open an issue:** @@ -252,9 +252,9 @@ An example for this could be: #### PR Description -PR is the only way to make change to Open-IM-Server project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](https://github.com/OpenIMSDK/.github/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. +PR is the only way to make change to Open-IM-Server project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](https://github.com/openimsdk/.github/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. -You can find some very formal PR in [RFC](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. +You can find some very formal PR in [RFC](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. **📖 Opening PRs:** @@ -303,8 +303,8 @@ git() { The documentation for Open-IM-Server includes: -+ [README.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/README.md): This file includes the basic information and instructions for getting started with Open-IM-Server. -+ [CONTRIBUTING.md](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to Open-IM-Server's codebase, such as how to submit issues, pull requests, and code reviews. ++ [README.md](https://github.com/openimsdk/Open-IM-Server/blob/main/README.md): This file includes the basic information and instructions for getting started with Open-IM-Server. ++ [CONTRIBUTING.md](https://github.com/openimsdk/Open-IM-Server/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to Open-IM-Server's codebase, such as how to submit issues, pull requests, and code reviews. + [Official Documentation](https://doc.rentsoft.cn/): This is the official documentation for Open-IM-Server, which includes comprehensive information on all of its features, configuration options, and troubleshooting tips. Please obey the following rules to better format the docs, which would greatly improve the reading experience. @@ -320,9 +320,9 @@ Please obey the following rules to better format the docs, which would greatly i We choose GitHub as the primary place for Open-IM-Server to collaborate. So the latest updates of Open-IM-Server are always here. Although contributions via PR is an explicit way to help, we still call for any other ways. -+ reply to other's [issues](https://github.com/OpenIMSDK/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) if you could; ++ reply to other's [issues](https://github.com/openimsdk/Open-IM-Server/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) if you could; + help solve other user's problems; -+ help review other's [PR](https://github.com/OpenIMSDK/Open-IM-Server/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design; ++ help review other's [PR](https://github.com/openimsdk/Open-IM-Server/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design; + discuss about Open-IM-Server to make things clearer; + advocate [Open-IM-Server](https://google.com/search?q=Open-IM-Server) technology beyond GitHub; + write blogs on Open-IM-Server and so on. @@ -367,6 +367,6 @@ In addition to Slack, we also offer the following ways to get in touch: + : We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) team channel. + : Get in touch with us on [Gmail](winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email. + : Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information. -+ : Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible. ++ : Add [Wechat](https://github.com/openimsdk/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us. diff --git a/HOW_TO_ADD_REST_RPC_API.md b/HOW_TO_ADD_REST_RPC_API.md index b06e8e35e..700ea8834 100644 --- a/HOW_TO_ADD_REST_RPC_API.md +++ b/HOW_TO_ADD_REST_RPC_API.md @@ -19,7 +19,7 @@ package OpenIMChat.chat; import "pub/wrapperspb.proto"; import "pub/sdkws.proto"; import "common/common.proto"; -option go_package = "github.com/OpenIMSDK/chat/pkg/proto/chat"; +option go_package = "github.com/openimsdk/chat/pkg/protocol/chat"; ... @@ -54,10 +54,10 @@ To check the parameters in the request message, we should add a Check() method f ```go func (x *GetTokenForVideoMeetingReq) Check() error { if x.Room == "" { - errs.ErrArgs.Wrap("Room is empty") + errs.ErrArgs.WrapMsg("Room is empty") } if x.Identity == "" { - errs.ErrArgs.Wrap("User Identity is empty") + errs.ErrArgs.WrapMsg("User Identity is empty") } return nil } @@ -117,7 +117,7 @@ package chat import ( ... - "github.com/OpenIMSDK/chat/pkg/common/rtc" + "github.com/openimsdk/chat/pkg/common/rtc" ... ) diff --git a/Makefile b/Makefile deleted file mode 100644 index 826467cc0..000000000 --- a/Makefile +++ /dev/null @@ -1,573 +0,0 @@ -# Copyright 2023 OpenIM. All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. - -###################################=> common commands <=############################################# -# ========================== Capture Environment =============================== -# get the repo root and output path -ROOT_PACKAGE=github.com/OpenIM/chat -OUT_DIR=$(REPO_ROOT)/_output -VERSION_PACKAGE=github.com/OpenIMSDK/chat/pkg/common/version -# ============================================================================== - - -# define the default goal -# - -SHELL := /bin/bash -DIRS=$(shell ls) -GO=go - -.DEFAULT_GOAL := help - -# include the common makefile -COMMON_SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST))) -# ROOT_DIR: root directory of the code base -ifeq ($(origin ROOT_DIR),undefined) -ROOT_DIR := $(abspath $(shell cd $(COMMON_SELF_DIR)/. && pwd -P)) -endif -# OUTPUT_DIR: The directory where the build output is stored. -ifeq ($(origin OUTPUT_DIR),undefined) -OUTPUT_DIR := $(ROOT_DIR)/_output -$(shell mkdir -p $(OUTPUT_DIR)) -endif - -# BIN_DIR: The directory where the build output is stored. -ifeq ($(origin BIN_DIR),undefined) -BIN_DIR := $(OUTPUT_DIR)/bin -$(shell mkdir -p $(BIN_DIR)) -endif - -ifeq ($(origin TOOLS_DIR),undefined) -TOOLS_DIR := $(OUTPUT_DIR)/tools -$(shell mkdir -p $(TOOLS_DIR)) -endif - -ifeq ($(origin TMP_DIR),undefined) -TMP_DIR := $(OUTPUT_DIR)/tmp -$(shell mkdir -p $(TMP_DIR)) -endif - -ifeq ($(origin VERSION), undefined) -VERSION := $(shell git describe --tags --always --match="v*" --dirty | sed 's/-/./g') #v2.3.3.631.g00abdc9b.dirty -endif - -# Check if the tree is dirty. default to dirty(maybe u should commit?) -GIT_TREE_STATE:="dirty" -ifeq (, $(shell git status --porcelain 2>/dev/null)) - GIT_TREE_STATE="clean" -endif -GIT_COMMIT:=$(shell git rev-parse HEAD) - -IMG ?= openim_chat:latest - -BUILDFILE = "./main.go" -BUILDAPP = "$(OUTPUT_DIR)/" - -# Define the directory you want to copyright -CODE_DIRS := $(ROOT_DIR)/ #$(ROOT_DIR)/pkg $(ROOT_DIR)/core $(ROOT_DIR)/integrationtest $(ROOT_DIR)/lib $(ROOT_DIR)/mock $(ROOT_DIR)/db $(ROOT_DIR)/openapi -FINDS := find $(CODE_DIRS) - -ifndef V -MAKEFLAGS += --no-print-directory -endif - -# The OS must be linux when building docker images -# !WARNING: linux_mips64 linux_mips64le -PLATFORMS ?= linux_s390x darwin_amd64 windows_amd64 linux_amd64 linux_arm64 linux_ppc64le - -# Set a specific PLATFORM -ifeq ($(origin PLATFORM), undefined) - ifeq ($(origin GOOS), undefined) - GOOS := $(shell go env GOOS) - endif - ifeq ($(origin GOARCH), undefined) - GOARCH := $(shell go env GOARCH) - endif - PLATFORM := $(GOOS)_$(GOARCH) - # Use linux as the default OS when building images - IMAGE_PLAT := linux_$(GOARCH) -else - GOOS := $(word 1, $(subst _, ,$(PLATFORM))) - GOARCH := $(word 2, $(subst _, ,$(PLATFORM))) - IMAGE_PLAT := $(PLATFORM) -endif - -# Linux command settings -FIND := find . ! -path './image/*' ! -path './vendor/*' ! -path './bin/*' -XARGS := xargs -r - -# ============================================================================== -# TODO: License selection -# LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE/license_templates.txt # MIT License -LICENSE_TEMPLATE ?= $(ROOT_DIR)/scripts/LICENSE/LICENSE_TEMPLATES # Apache License - -# COMMA: Concatenate multiple strings to form a list of strings -COMMA := , -# SPACE: Used to separate strings -SPACE := -# SPACE: Replace multiple consecutive Spaces with a single space -SPACE += - -# ============================================================================== -# Build definition - -GO_SUPPORTED_VERSIONS ?= 1.21|1.22|1.23|1.24 -GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(VERSION) \ - -X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \ - -X $(VERSION_PACKAGE).gitTreeState=$(GIT_TREE_STATE) \ - -X $(VERSION_PACKAGE).buildDate=$(shell date +%FT%T%z) \ - -s -w -ifneq ($(DEBUG),) - GO_BUILD_FLAGS += -gcflags "all=-N -l" - LDFLAGS = "" -endif -GO_BUILD_FLAGS += -tags "containers_image_openpgp netgo exclude_graphdriver_devicemapper static osusergo exclude_graphdriver_btrfs" -trimpath -ldflags "$(GO_LDFLAGS)" - -ifeq ($(GOOS),windows) - GO_OUT_EXT := .exe -endif - -ifeq ($(ROOT_PACKAGE),) - $(error the variable ROOT_PACKAGE must be set prior to including golang.mk) -endif - -GOPATH := $(shell go env GOPATH) -ifeq ($(origin GOBIN), undefined) - GOBIN := $(GOPATH)/bin -endif - -# COMMANDS is Specify all files under ${ROOT_DIR}/cmd/ and ${ROOT_DIR}/tools/ except those ending in.md -COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/cmd/*/* ${ROOT_DIR}/tools/*)) -ifeq (${COMMANDS},) - $(error Could not determine COMMANDS, set ROOT_DIR or run in source dir) -endif -BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd})) -ifeq (${BINS},) - $(error Could not determine BINS, set ROOT_DIR or run in source dir) -endif - -EXCLUDE_TESTS=github.com/OpenIMSDK/chat/test - -# ============================================================================== -# Docker build definition -# Image and Deployment -# -DOCKER := docker - -# read: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md -REGISTRY_PREFIX ?= registry.cn-hangzhou.aliyuncs.com/openimsdk #ghcr.io/openimsdk - -BASE_IMAGE ?= ghcr.io/openim-sigs/openim-bash-image - -IMAGE_PLAT ?= $(subst $(SPACE),$(COMMA),$(subst _,/,$(PLATFORMS))) - -EXTRA_ARGS ?= --no-cache -_DOCKER_BUILD_EXTRA_ARGS := - -ifdef HTTP_PROXY -_DOCKER_BUILD_EXTRA_ARGS += --build-arg HTTP_PROXY=${HTTP_PROXY} -endif - -ifneq ($(EXTRA_ARGS), ) -_DOCKER_BUILD_EXTRA_ARGS += $(EXTRA_ARGS) -endif - -# Determine image files by looking into build/images/*/Dockerfile -IMAGES_DIR ?= $(wildcard ${ROOT_DIR}/build/images/*) -# Determine images names by stripping out the dir names, and filter out the undesired directories -IMAGES ?= $(filter-out Dockerfile, $(foreach image,${IMAGES_DIR},$(notdir ${image}))) - -ifeq (${IMAGES},) - $(error Could not determine IMAGES, set ROOT_DIR or run in source dir) -endif - -# ============================================================================== -# Build - -## all: Build all the necessary targets. -.PHONY: all -all: copyright-verify tidy build start check #lint cover - -## init: Init openim-chat config -.PHONY: init -init: - @echo "===========> Init openim-chat config" - @$(ROOT_DIR)/scripts/init-config.sh - -## init-githooks: Initialize git hooks ✨ -.PHONY: init-githooks -init-githooks: - @echo "===========> Initializing git hooks" - @${ROOT_DIR}/scripts/init-githooks.sh - -## build: Build binaries by default. -.PHONY: build -build: go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) - -.PHONY: build.% -build.%: - @echo "$(shell go version)" - @echo "===========> Building binary $(BUILDAPP) *[Git Info]: $(VERSION)-$(GIT_COMMIT)" - @export CGO_ENABLED=0 && GOOS=linux go build -o $(BUILDAPP)/$*/ -ldflags '-s -w' $*/example/$(BUILDFILE) - -.PHONY: go.build.verify -go.build.verify: -ifneq ($(shell $(GO) version | grep -q -E '\bgo($(GO_SUPPORTED_VERSIONS))\b' && echo 0 || echo 1), 0) - $(error unsupported go version. Please make install one of the following supported version: '$(GO_SUPPORTED_VERSIONS)') -endif - -## go.build: Build the binary file of the specified platform. -.PHONY: go.build.% -go.build.%: - $(eval COMMAND := $(word 2,$(subst ., ,$*))) - $(eval PLATFORM := $(word 1,$(subst ., ,$*))) - $(eval OS := $(word 1,$(subst _, ,$(PLATFORM)))) - $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) - @echo "=====> COMMAND=$(COMMAND)" - @echo "=====> PLATFORM=$(PLATFORM)" - @echo "=====> BIN_DIR=$(BIN_DIR)" - @echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)" - @mkdir -p $(BIN_DIR)/platforms/$(OS)/$(ARCH) - $(eval CMD_PATH := $(shell find ${ROOT_DIR}/cmd ${ROOT_DIR}/tools -type d -name $(COMMAND))) - @cd $(CMD_PATH) && CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \ - $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) . - @chmod +x $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) - -## build-multiarch: Build binaries for multiple platforms. -.PHONY: build-multiarch -build-multiarch: go.build.verify $(foreach p,$(PLATFORMS),$(addprefix go.build., $(addprefix $(p)., $(BINS)))) -# ============================================================================== -# Targets -.PHONY: release -release: release.verify release.ensure-tag - @scripts/release.sh - -.PHONY: install.gsemver -release.verify: install.git-chglog install.github-release install.coscmd - -.PHONY: release.tag -release.tag: install.gsemver release.ensure-tag - @git push origin `git describe --tags --abbrev=0` - -.PHONY: release.ensure-tag -release.ensure-tag: install.gsemver - @scripts/ensure_tag.sh - -## tidy: tidy go.mod -.PHONY: tidy -tidy: - @$(GO) mod tidy - -## style: Code style -> fmt,vet,lint -.PHONY: style -style: fmt vet lint - -## fmt: Run go fmt against code. -.PHONY: fmt -fmt: - @$(GO) fmt ./... - -## vet: Run go vet against code. -.PHONY: vet -vet: - @$(GO) vet ./... - -## generate: Run go generate against code. -.PHONY: generate -generate: - @$(GO) generate ./... - -## lint: Run go lint against code. -.PHONY: lint -lint: tools.verify.golangci-lint - @echo "===========> Run golangci to lint source codes" - @$(TOOLS_DIR)/golangci-lint run -c $(ROOT_DIR)/.golangci.yml $(ROOT_DIR)/... - -## test: Run unit test -.PHONY: test -test: - @$(GO) test ./... - -## cover: Run unit test with coverage. -.PHONY: cover -cover: test - @echo "Running tests with coverage..." - @$(GO) test -coverprofile=coverage.out ./... - @echo "Checking coverage..." - @$(GO) tool cover -func=coverage.out | grep total: | awk '{print $$3}' | sed 's/%//g' | { \ - read coverage; \ - echo "Total coverage: $$coverage%"; \ - minCoverage=75; \ - if [ `echo "$$coverage < $$minCoverage" | bc` -eq 1 ]; then \ - echo "Coverage ($$coverage%) is below the minimum required ($$minCoverage%). Failing."; \ - exit 1; \ - else \ - echo "Coverage meets minimum requirement ($$minCoverage%)."; \ - fi; \ - } - -## start: Start the chat all service. -.PHONY: start -start: - @echo "===========> Starting the service" - @$(ROOT_DIR)/scripts/start-all.sh - -## check: Check the chat all service. -.PHONY: check -check: - @echo "===========> Checking the service" - @$(ROOT_DIR)/scripts/check-all.sh --print-screen - -## stop: Stop the chat all service. -.PHONY: stop -stop: - @echo "===========> Stopping the service" - @$(ROOT_DIR)/scripts/stop-all.sh - -## restart: Restart openim chat -.PHONY: restart -restart: clean stop build start check - -## install: install openim chat -.PHONY: install -install: restart - -## image.build.%: Build docker image for a specific platform -.PHONY: image.build.% -image.build.%: go.build.% - $(eval IMAGE := $(COMMAND)) - $(eval IMAGE_PLAT := $(subst _,/,$(PLATFORM))) - $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) - @echo "===========> Building docker image $(IMAGE) $(VERSION) for $(IMAGE_PLAT)" - @mkdir -p $(TMP_DIR)/$(IMAGE)/$(PLATFORM) - @cat $(ROOT_DIR)/build/images/Dockerfile\ - | sed "s#BASE_IMAGE#$(BASE_IMAGE)#g" \ - | sed "s#BINARY_NAME#$(IMAGE)#g" >$(TMP_DIR)/$(IMAGE)/Dockerfile - @cp $(BIN_DIR)/platforms/$(IMAGE_PLAT)/$(IMAGE) $(TMP_DIR)/$(IMAGE) - $(eval BUILD_SUFFIX := $(_DOCKER_BUILD_EXTRA_ARGS) --pull -t $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(VERSION) $(TMP_DIR)/$(IMAGE)) - @if [ $(shell $(GO) env GOARCH) != $(ARCH) ] ; then \ - $(MAKE) image.daemon.verify ;\ - $(DOCKER) build --platform $(IMAGE_PLAT) $(BUILD_SUFFIX) ; \ - else \ - $(DOCKER) build $(BUILD_SUFFIX) ; \ - fi - @rm -rf $(TMP_DIR)/$(IMAGE) - -## docker-build: Build docker image with the manager. -.PHONY: docker-build -docker-build: - docker build -t ${IMG} . - -## docker-push: Push docker image with the manager. -.PHONY: docker-push -docker-push: - docker push ${IMG} - -## docker-buildx-push: Push docker image with the manager using buildx. -.PHONY: docker-buildx-push -docker-buildx-push: - docker buildx build --platform linux/arm64,linux/amd64 -t ${IMG} . --push - -## copyright-verify: Validate boilerplate headers for assign files. -.PHONY: copyright-verify -copyright-verify: tools.verify.addlicense copyright-add - @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) - @echo "===========> End of boilerplate headers check..." - -## copyright-add: Add the boilerplate headers for all files. -.PHONY: copyright-add -copyright-add: tools.verify.addlicense - @echo "===========> Adding $(LICENSE_TEMPLATE) the boilerplate headers for all files" - @$(TOOLS_DIR)/addlicense -y $(shell date +"%Y") -v -c "OpenIM open source community." -f $(LICENSE_TEMPLATE) $(CODE_DIRS) - @echo "===========> End the copyright is added..." - -## clean: Clean all builds. -.PHONY: clean -clean: - @echo "===========> Cleaning all builds TMP_DIR($(TMP_DIR)) AND BIN_DIR($(BIN_DIR))" - @-rm -vrf $(TMP_DIR) $(BIN_DIR) _output/logs - @echo "===========> End clean..." - -## help: Show this help info. -.PHONY: help -help: Makefile - @printf "\n\033[1mUsage: make ...\033[0m\n\n\\033[1mTargets:\\033[0m\n\n" - @sed -n 's/^##//p' $< | awk -F':' '{printf "\033[36m%-28s\033[0m %s\n", $$1, $$2}' | sed -e 's/^/ /' - -######################################=> common tools<= ############################################ -# tools - -BUILD_TOOLS ?= go-gitlint golangci-lint goimports addlicense deepcopy-gen conversion-gen ginkgo go-junit-report - -## tools.verify.%: Check if a tool is installed and install it -.PHONY: tools.verify.% -tools.verify.%: - @echo "===========> Verifying $* is installed" - @if [ ! -f $(TOOLS_DIR)/$* ]; then GOBIN=$(TOOLS_DIR) $(MAKE) tools.install.$*; fi - @echo "===========> $* is install in $(TOOLS_DIR)/$*" - -# tools: Install a must tools -.PHONY: tools -tools: $(addprefix tools.verify., $(BUILD_TOOLS)) - -# tools.install.%: Install a single tool in $GOBIN/ -.PHONY: tools.install.% -tools.install.%: - @echo "===========> Installing $,The default installation path is $(GOBIN)/$*" - @$(MAKE) install.$* - -.PHONY: install.golangci-lint -install.golangci-lint: - @$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - -.PHONY: install.goimports -install.goimports: - @$(GO) install golang.org/x/tools/cmd/goimports@latest - -.PHONY: install.addlicense -install.addlicense: - @$(GO) install github.com/google/addlicense@latest - -.PHONY: install.deepcopy-gen -install.deepcopy-gen: - @$(GO) install k8s.io/code-generator/cmd/deepcopy-gen@latest - -.PHONY: install.conversion-gen -install.conversion-gen: - @$(GO) install k8s.io/code-generator/cmd/conversion-gen@latest - -.PHONY: install.ginkgo -install.ginkgo: - @$(GO) install github.com/onsi/ginkgo/ginkgo@v1.16.2 - -.PHONY: install.go-gitlint -# wget -P _output/tools/ https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/tools/go-gitlint -# go install github.com/antham/go-gitlint/cmd/gitlint@latest -install.go-gitlint: - @wget -q https://openim-1306374445.cos.ap-guangzhou.myqcloud.com/openim/tools/go-gitlint -O ${TOOLS_DIR}/go-gitlint - @chmod +x ${TOOLS_DIR}/go-gitlint - -.PHONY: install.go-junit-report -install.go-junit-report: - @$(GO) install github.com/jstemmer/go-junit-report@latest - -# ============================================================================== -# Tools that might be used include go gvm, cos -# - -## install.kube-score: Install kube-score, used to check kubernetes yaml files -.PHONY: install.kube-score -install.kube-score: - @$(GO) install github.com/zegl/kube-score/cmd/kube-score@latest - -## install.kubeconform: Install kubeconform, used to check kubernetes yaml files -.PHONY: install.kubeconform -install.kubeconform: - @$(GO) install github.com/yannh/kubeconform/cmd/kubeconform@latest - -## install.gsemver: Install gsemver, used to generate semver -.PHONY: install.gsemver -install.gsemver: - @$(GO) install github.com/arnaud-deprez/gsemver@latest - -## install.git-chglog: Install git-chglog, used to generate changelog -.PHONY: install.git-chglog -install.git-chglog: - @$(GO) install github.com/git-chglog/git-chglog/cmd/git-chglog@latest - -## install.github-release: Install github-release, used to create github release -.PHONY: install.github-release -install.github-release: - @$(GO) install github.com/github-release/github-release@latest - -## install.coscli: Install coscli, used to upload files to cos -# example: ./coscli cp/sync -r /root/workspaces/kubecub/chat/ cos://kubecub-1306374445/code/ -e cos.ap-hongkong.myqcloud.com -# https://cloud.tencent.com/document/product/436/71763 -# kubecub/* -# - code/ -# - docs/ -# - images/ -# - scripts/ -.PHONY: install.coscli -install.coscli: - @wget -q https://github.com/tencentyun/coscli/releases/download/v0.13.0-beta/coscli-linux -O ${TOOLS_DIR}/coscli - @chmod +x ${TOOLS_DIR}/coscli - -## install.coscmd: Install coscmd, used to upload files to cos -.PHONY: install.coscmd -install.coscmd: - @if which pip &>/dev/null; then pip install coscmd; else pip3 install coscmd; fi - -## install.delve: Install delve, used to debug go program -.PHONY: install.delve -install.delve: - @$(GO) install github.com/go-delve/delve/cmd/dlv@latest - -## install.air: Install air, used to hot reload go program -.PHONY: install.air -install.air: - @$(GO) install github.com/cosmtrek/air@latest - -## install.gvm: Install gvm, gvm is a Go version manager, built on top of the official go tool. -.PHONY: install.gvm -install.gvm: - @echo "===========> Installing gvm,The default installation path is ~/.gvm/scripts/gvm" - @bash < <(curl -s -S -L https://raw.gitee.com/moovweb/gvm/master/binscripts/gvm-installer) - @$(shell source /root/.gvm/scripts/gvm) - -## install.golines: Install golines, used to format long lines -.PHONY: install.golines -install.golines: - @$(GO) install github.com/segmentio/golines@latest - -## install.go-mod-outdated: Install go-mod-outdated, used to check outdated dependencies -.PHONY: install.go-mod-outdated -install.go-mod-outdated: - @$(GO) install github.com/psampaz/go-mod-outdated@latest - -## install.mockgen: Install mockgen, used to generate mock functions -.PHONY: install.mockgen -install.mockgen: - @$(GO) install github.com/golang/mock/mockgen@latest - -## install.gotests: Install gotests, used to generate test functions -.PHONY: install.gotests -install.gotests: - @$(GO) install github.com/cweill/gotests/gotests@latest - -## install.protoc-gen-go: Install protoc-gen-go, used to generate go source files from protobuf files -.PHONY: install.protoc-gen-go -install.protoc-gen-go: - @$(GO) install github.com/golang/protobuf/protoc-gen-go@latest - -## install.cfssl: Install cfssl, used to generate certificates -.PHONY: install.cfssl -install.cfssl: - @$(ROOT_DIR)/scripts/install/install.sh OpenIM::install::install_cfssl - -## install.depth: Install depth, used to check dependency tree -.PHONY: install.depth -install.depth: - @$(GO) install github.com/KyleBanks/depth/cmd/depth@latest - -## install.go-callvis: Install go-callvis, used to visualize call graph -.PHONY: install.go-callvis -install.go-callvis: - @$(GO) install github.com/ofabry/go-callvis@latest - -## install.gothanks: Install gothanks, used to thank go dependencies -.PHONY: install.gothanks -install.gothanks: - @$(GO) install github.com/psampaz/gothanks@latest - -## install.richgo: Install richgo -.PHONY: install.richgo -install.richgo: - @$(GO) install github.com/kyoh86/richgo@latest - -## install.rts: Install rts -.PHONY: install.rts -install.rts: - @$(GO) install github.com/galeone/rts/cmd/rts@latest diff --git a/README.md b/README.md index 78a9310a4..ab0f301ae 100644 --- a/README.md +++ b/README.md @@ -14,207 +14,91 @@ You may use the OpenIM source code to create compiled versions not originally pr + Obtain a commercial license by contacting OpenIM. + For more details and licensing inquiries, please email 📧 [contact@openim.io](mailto:contact@openim.io). -## 🧩 Awesome features -1. This repository implement a business system, which consists of two parts: User related function and background management function -2. The business system depends on the api of the im system ([open-im-server repository](https://github.com/openimsdk/open-im-server)) and implement various functions by calling the api of the im system -3. User related part includes some regular functions like user login, user register, user info update, etc. -4. Background management provides api for admin to manage the im system containing functions like user management, message mangement,group management,etc. +## 🧩 Feature Overview + +1. This repository implements a business system, which consists of two parts: User System and Backend Management System. +2. The system relies on the [open-im-server repository](https://github.com/openimsdk/open-im-server) and implements various business functions by calling the APIs of the instant messaging system. +3. The User System includes regular functions such as user login, user registration, user information update, etc. +4. The Backend Management System includes APIs for managing users, groups, and messages. ## :busts_in_silhouette: Community + 💬 [Follow our Twitter account](https://twitter.com/founder_im63606) + 👫 [Join our Reddit](https://www.reddit.com/r/OpenIMessaging) + 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) -+ :eyes: [Join our wechat (微信群)](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg) -+ 📚 [OpenIM Community](https://github.com/OpenIMSDK/community) -+ 💕 [OpenIM Interest Group](https://github.com/Openim-sigs) ++ :eyes: [Join our WeChat group](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg) ++ 📚 [OpenIM Community](https://github.com/openimsdk/community) ++ 💕 [OpenIM Interest Groups](https://github.com/Openim-sigs) -## 🛫 Quick start +## 🛫 Quick Start -> **Note**: You can get started quickly with OpenIM Chat. +> :warning: **Note**: This project works on Linux/Windows/Mac platforms and both ARM and AMD architectures. -### 📦 Installation +### 📦 Clone ```bash -git clone https://github.com/openimsdk/chat openim-chat && export openim-chat=$(pwd)/openim-chat && cd $openim-chat && make +git clone https://github.com/openimsdk/chat openim-chat +cd openim-chat ``` -### Developing chat - -You can deploy OpenIM Chat in two ways, either from source (which requires openIM-server to be installed) or with [docker compose](https://github.com/openimsdk/openim-docker) - -**Here's how to deploy from source code:** +### 🛠 Initialization -If you wish to deploy chat, then you should first install and deploy OpenIM, this [open-im-server repository](https://github.com/openimsdk/open-im-server) +:computer: Before the first compilation, execute on Linux/Mac platforms: -First, install openim-server in a new directory or location repository - -```bash -git clone -b release-v3.5 https://github.com/OpenIMSDK/Open-IM-Server.git openim && export openim=$(pwd)/openim && cd $openim -sudo docker compose up -d ``` - -**Setting configuration items:** - -```bash -make init +sh bootstrap.sh ``` -> Then modify the configuration file `config/config.yaml` according to your needs -> Note: If you want to use the mysql database, you need to modify the mysql configuration item in the configuration file. If you want to use the mongo database, you need to modify the mongo configuration item in the configuration file - - -Then go back to the chat directory, Installing Chat +:computer: On Windows execute: -**Starting MySQL:** - -> Recent OpenIM versions have discontinued the MySQL component, necessitating a separate MySQL installation for chat deployment. - -```bash -docker run -d \ - --name mysql \ - -p 13306:3306 \ - -p 3306:33060 \ - -v "$(pwd)/components/mysql/data:/var/lib/mysql" \ - -v "/etc/localtime:/etc/localtime" \ - -e MYSQL_ROOT_PASSWORD="openIM123" \ - --restart always \ - mysql:5.7 ``` - -**MySQL Compatibility Note:** - -The MySQL version 5.7 primarily supports the linux/amd64 architecture. Users operating on Mac or other architectures, or those with specific version requirements for MySQL, can opt for the latest version of the open-source MariaDB. MariaDB is compatible with MySQL and can be a suitable alternative. - -```bash -docker run -d \ - --name mysql \ - -p 13306:3306 \ - -p 3306:33060 \ - -v "$(pwd)/components/mysql/data:/var/lib/mysql" \ - -v "/etc/localtime:/etc/localtime" \ - -e MYSQL_ROOT_PASSWORD="openIM123" \ - --restart always \ - mariadb:10.6 -``` - -If you want to use a local or remote database, edit the `config/config.yaml` section after the initial configuration - - -**Install Chat:** - -```bash -$ make build -$ make start -$ make check +bootstrap.bat ``` -## 🛫 Quick start - -> **Note**: You can get started quickly with chat. - -### 🚀 Run - -> **Note**: -> We need to run the backend server first +### 🏗 Build ```bash -$ make build - -# OR build Specifying binary -$ make build BINS=admin-api - -# OR build multiarch -$ make build-multiarch -$ make build-multiarch BINS="admin-api" - -# OR use scripts build source code -$ ./scripts/build_all.sh +mage ``` -### 📖 Contributors get up to speed - -Be good at using Makefile, it can ensure the quality of your project. +### 🚀 Start ```bash -Usage: make ... - -Targets: - all Build all the necessary targets. 🏗️ - build Build binaries by default. 🛠️ - go.build Build the binary file of the specified platform. 👨‍💻 - build-multiarch Build binaries for multiple platforms. 🌍 - tidy tidy go.mod 📦 - style Code style -> fmt,vet,lint 🎨 - fmt Run go fmt against code. ✨ - vet Run go vet against code. 🔍 - generate Run go generate against code and docs. ✅ - lint Run go lint against code. 🔎 - test Run unit test ✔️ - cover Run unit test with coverage. 🧪 - docker-build Build docker image with the manager. 🐳 - docker-push Push docker image with the manager. 🔝 - docker-buildx-push Push docker image with the manager using buildx. 🚢 - copyright-verify Validate boilerplate headers for assign files. 📄 - copyright-add Add the boilerplate headers for all files. 📝 - swagger Generate swagger document. 📚 - serve-swagger Serve swagger spec and docs. 🌐 - clean Clean all builds. 🧹 - help Show this help info. ℹ️ +mage start ``` -> **Note**: -> It's highly recommended that you run `make all` before committing your code. 🚀 +### :floppy_disk: Or start in the background and collect logs -```bash -$ make all ``` - -### Chat Start - -```bash -$ make start_all -# OR use scripts start -$ ./scripts/start-all.sh +nohup mage start >> _output/logs/chat.log 2>&1 & ``` -### Chat Detection +### :mag_right: Check ```bash -$ make check -# OR use scripts check -$ ./scripts/check-all.sh --print-screen +mage check ``` -### Chat Stop +### 🛑 Stop ```bash -$ make stop -# OR use scripts stop -$ ./scripts/stop-all.sh +mage stop ``` -## Add REST RPC API - -Please refer to "[How to add REST RPC API for OpenIM Chat](./HOW_TO_ADD_REST_RPC_API.md)". - -## Setup LiveKit if you want to enable Audio and Video chat - -Please refer to "[How to setup LiveKit server](./HOW_TO_SETUP_LIVEKIT_SERVER.md)". - -## Contributing -Contributions to this project are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details. +### 🚀 Start Sequence -## Community Meetings -We want anyone to get involved in our community, we offer gifts and rewards, and we welcome you to join us every Thursday night. +1. Successfully start [open-im-server](https://github.com/openimsdk/open-im-server). +2. Compile chat `mage`. +3. Start chat `mage start`. -We take notes of each [biweekly meeting](https://github.com/openimsdk/open-im-server/issues/381) in [GitHub discussions](https://github.com/openimsdk/open-im-server/discussions/categories/meeting), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). +## 📞 If you want to enable audio and video calls, please configure LiveKit +:link: Please refer to "[How to set up LiveKit server](./HOW_TO_SETUP_LIVEKIT_SERVER.md)". -## Who are using open-im-server -The [user case studies](https://github.com/openimsdk/community/blob/main/ADOPTERS.md) page includes the user list of the project. You can leave a [📝comment](https://github.com/openimsdk/open-im-server/issues/379) to let us know your use case. +## :handshake: Contributing +:heart: Contributions to this project are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details. ## 🚨 License -chat is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/openimsdk/chat/tree/main/LICENSE) for the full license text. +:scroll: chat is licensed under the [GPL-3.0 license](https://github.com/openimsdk/chat#GPL-3.0-1-ov-file). See the [LICENSE](https://github.com/openimsdk/chat/tree/main/LICENSE) for the full license text. diff --git a/README_zh_CN.md b/README_zh_CN.md new file mode 100644 index 000000000..fb190a1f0 --- /dev/null +++ b/README_zh_CN.md @@ -0,0 +1,104 @@ +# openim-chat + +## 📄 源代码的许可选项 + +您可以在以下两种许可选项之一下使用 OpenIM 源代码来创建非 OpenIM 原始生产的编译版本: + +### 1. 通用公共许可证 v3.0 (GPLv3) 🆓 + ++ 该选项受自由软件基金会的 [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) 管理。 ++ 使用受此政策概述的某些例外的约束。 + +### 2. 商业许可 💼 + ++ 通过联系 OpenIM 获得商业许可。 ++ 有关详细信息和许可查询,请通过电子邮件 📧 [contact@openim.io](mailto:contact@openim.io)。 + +## 🧩 功能简介 + +1. 该仓库实现了业务系统,包括两部分:用户系统和后台管理系统。 +2. 该系统依赖于 [open-im-server 仓库](https://github.com/openimsdk/open-im-server),通过调用即时消息系统的 API 实现丰富的业务功能。 +3. 用户系统包括一些常规功能,如用户登录、用户注册、用户信息更新等。 +4. 后台管理系统包括提供了 API 管理用户、群组和消息等。 + +## :busts_in_silhouette: 社区 + ++ 💬 [关注我们的 Twitter 账户](https://twitter.com/founder_im63606) ++ 👫 [加入我们的 Reddit](https://www.reddit.com/r/OpenIMessaging) ++ 🚀 [加入我们的 Slack 社区](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q) ++ :eyes: [加入我们的微信群](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg) ++ 📚 [OpenIM 社区](https://github.com/openimsdk/community) ++ 💕 [OpenIM 兴趣小组](https://github.com/Openim-sigs) + +## 🛫 快速开始 + +> :warning: **注意**:本项目在 Linux/Windows/Mac 平台以及 ARM 和 AMD 架构下均可正常使用 + +### 📦 克隆 + +```bash +git clone https://github.com/openimsdk/chat openim-chat +cd openim-chat +``` + +### 🛠 初始化 + +:computer: 第一次编译前,Linux/Mac 平台下执行: + +``` +sh bootstrap.sh +``` + +:computer: Windows 执行: + +``` +bootstrap.bat +``` + +### 🏗 编译 + +```bash +mage +``` + +### 🚀 启动 + +```bash +mage start +``` + +### :floppy_disk: 或后台启动 收集日志 + +``` +nohup mage start >> _output/logs/chat.log 2>&1 & +``` + +### :mag_right: 检测 + +```bash +mage check +``` + +### 🛑 停止 + +```bash +mage stop +``` + +### 🚀 启动顺序 + +1. 成功启动 [open-im-server](https://github.com/openimsdk/open-im-server)。 +2. 编译 chat `mage`。 +3. 启动 chat `mage start`。 + +## 📞 如果您想启用音视频通话,请配置 LiveKit + +:link: 请参考 "[如何设置 LiveKit 服务器](./HOW_TO_SETUP_LIVEKIT_SERVER.md)"。 + +## :handshake: 贡献 + +:heart: 欢迎对该项目做出贡献!请查看 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解详情。 + +## 🚨 许可 + +:scroll: chat 根据 [GPL-3.0 license](https://github.com/openimsdk/chat#GPL-3.0-1-ov-file) 许可证授权。查看 [LICENSE](https://github.com/openimsdk/chat/tree/main/LICENSE) 获取完整的许可证文本。 diff --git a/bootstrap.bat b/bootstrap.bat new file mode 100644 index 000000000..819f19c87 --- /dev/null +++ b/bootstrap.bat @@ -0,0 +1,31 @@ +@echo off +SETLOCAL + +mage -version >nul 2>&1 +IF %ERRORLEVEL% EQU 0 ( + echo Mage is already installed. + GOTO DOWNLOAD +) + +go version >nul 2>&1 +IF NOT %ERRORLEVEL% EQU 0 ( + echo Go is not installed. Please install Go and try again. + exit /b 1 +) + +echo Installing Mage... +go install github.com/magefile/mage@latest + +mage -version >nul 2>&1 +IF NOT %ERRORLEVEL% EQU 0 ( + echo Mage installation failed. + echo Please ensure that %GOPATH%/bin is in your PATH. + exit /b 1 +) + +echo Mage installed successfully. + +:DOWNLOAD +go mod download + +ENDLOCAL diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 000000000..f79cd1f11 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then + TARGET_DIR="$HOME/.local/bin" +else + TARGET_DIR="/usr/local/bin" + echo "Using /usr/local/bin as the installation directory. Might require sudo permissions." +fi + +if ! command -v mage &> /dev/null; then + echo "Installing Mage to $TARGET_DIR ..." + GOBIN=$TARGET_DIR go install github.com/magefile/mage@latest +fi + +if ! command -v mage &> /dev/null; then + echo "Mage installation failed." + echo "Please ensure that $TARGET_DIR is in your \$PATH." + exit 1 +fi + +echo "Mage installed successfully." + +go mod download diff --git a/cmd/api/admin-api/main.go b/cmd/api/admin-api/main.go index 19fb27692..26f321539 100644 --- a/cmd/api/admin-api/main.go +++ b/cmd/api/admin-api/main.go @@ -15,116 +15,12 @@ package main import ( - "context" - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "math/rand" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "syscall" - "time" - - "github.com/OpenIMSDK/tools/errs" - - "github.com/OpenIMSDK/chat/pkg/discovery_register" - - "github.com/OpenIMSDK/tools/discoveryregistry" - - mw2 "github.com/OpenIMSDK/chat/pkg/common/mw" - "github.com/OpenIMSDK/chat/pkg/common/version" - - "github.com/OpenIMSDK/chat/internal/api" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/mw" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - "github.com/gin-gonic/gin" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/tools/system/program" ) func main() { - rand.Seed(time.Now().UnixNano()) - configFile, ginPort, showVersion, err := config.FlagParse() - if err != nil { - util.ExitWithError(err) - } - - // Check if the version flag was set - if showVersion { - ver := version.Get() - fmt.Println("Version:", ver.GitVersion) - fmt.Println("Git Commit:", ver.GitCommit) - fmt.Println("Build Date:", ver.BuildDate) - fmt.Println("Go Version:", ver.GoVersion) - fmt.Println("Compiler:", ver.Compiler) - fmt.Println("Platform:", ver.Platform) - return - } - - if err := config.InitConfig(configFile); err != nil { - util.ExitWithError(err) - } - if err != nil { - util.ExitWithError(err) - } - if err := log.InitFromConfig("chat.log", "admin-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil { - util.ExitWithError(err) + if err := cmd.NewAdminApiCmd().Exec(); err != nil { + program.ExitWithError(err) } - if config.Config.Envs.Discovery == "k8s" { - ginPort = 80 - } - var zk discoveryregistry.SvcDiscoveryRegistry - zk, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery) - //zk, err = openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema, - // openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword(config.Config.Zookeeper.Username, config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger())) - if err != nil { - util.ExitWithError(err) - } - - if err := zk.CreateRpcRootNodes([]string{config.Config.RpcRegisterName.OpenImAdminName, config.Config.RpcRegisterName.OpenImChatName}); err != nil { - panic(errs.Wrap(err, "CreateRpcRootNodes error")) - } - zk.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) // 默认RPC中间件 - engine := gin.Default() - engine.Use(mw.CorsHandler(), mw.GinParseOperationID(), mw2.GinLog()) - api.NewAdminRoute(engine, zk) - - address := net.JoinHostPort(config.Config.AdminApi.ListenIP, strconv.Itoa(ginPort)) - - server := http.Server{Addr: address, Handler: engine} - - var ( - netDone = make(chan struct{}, 1) - netErr error - ) - - go func() { - err = server.ListenAndServe() - if err != nil && err != http.ErrServerClosed { - netErr = errs.Wrap(err, fmt.Sprintf("server addr: %s", server.Addr)) - netDone <- struct{}{} - } - }() - - sigs := make(chan os.Signal, 1) - signal.Notify(sigs, syscall.SIGTERM) - - select { - case <-sigs: - util.SIGTERMExit() - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - err = server.Shutdown(ctx) - if err != nil { - util.ExitWithError(errs.Wrap(err, "shutdown err")) - } - case <-netDone: - close(netDone) - util.ExitWithError(netErr) - } - } diff --git a/cmd/api/chat-api/main.go b/cmd/api/chat-api/main.go index 20ce3f095..7d8165671 100644 --- a/cmd/api/chat-api/main.go +++ b/cmd/api/chat-api/main.go @@ -15,117 +15,12 @@ package main import ( - "context" - "flag" - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "syscall" - "time" - - "github.com/OpenIMSDK/tools/errs" - - "github.com/OpenIMSDK/chat/pkg/discovery_register" - "github.com/OpenIMSDK/tools/discoveryregistry" - - mw2 "github.com/OpenIMSDK/chat/pkg/common/mw" - "github.com/OpenIMSDK/chat/pkg/common/version" - - "github.com/OpenIMSDK/chat/internal/api" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/mw" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - "github.com/gin-gonic/gin" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/tools/system/program" ) func main() { - - configFile, ginPort, showVersion, err := config.FlagParse() - if err != nil { - util.ExitWithError(err) - } - - // Check if the version flag was set - if showVersion { - ver := version.Get() - fmt.Println("Version:", ver.GitVersion) - fmt.Println("Git Commit:", ver.GitCommit) - fmt.Println("Build Date:", ver.BuildDate) - fmt.Println("Go Version:", ver.GoVersion) - fmt.Println("Compiler:", ver.Compiler) - fmt.Println("Platform:", ver.Platform) - return - } - - flag.Parse() - - err = config.InitConfig(configFile) - if err != nil { - util.ExitWithError(err) - } - if err != nil { - util.ExitWithError(err) - } - if err := log.InitFromConfig("chat.log", "chat-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil { - util.ExitWithError(err) - } - if config.Config.Envs.Discovery == "k8s" { - ginPort = 80 - } - var zk discoveryregistry.SvcDiscoveryRegistry - zk, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery) - /*zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema, - openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword(config.Config.Zookeeper.Username, - config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger()))*/ - if err != nil { - util.ExitWithError(err) - } - if err := zk.CreateRpcRootNodes([]string{config.Config.RpcRegisterName.OpenImAdminName, config.Config.RpcRegisterName.OpenImChatName}); err != nil { - util.ExitWithError(err) - } - zk.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) // 默认RPC中间件 - engine := gin.Default() - engine.Use(mw.CorsHandler(), mw.GinParseOperationID(), mw2.GinLog()) - api.NewChatRoute(engine, zk) - - address := net.JoinHostPort(config.Config.ChatApi.ListenIP, strconv.Itoa(ginPort)) - - server := http.Server{Addr: address, Handler: engine} - - var ( - netDone = make(chan struct{}, 1) - netErr error - ) - - go func() { - err = server.ListenAndServe() - if err != nil && err != http.ErrServerClosed { - netErr = errs.Wrap(err, fmt.Sprintf("Server address: %s", server.Addr)) - netDone <- struct{}{} - } - }() - - sigs := make(chan os.Signal, 1) - signal.Notify(sigs, syscall.SIGTERM) - - select { - case <-sigs: - util.SIGTERMExit() - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - err = server.Shutdown(ctx) - if err != nil { - util.ExitWithError(errs.Wrap(err, "shutdown err")) - } - case <-netDone: - close(netDone) - util.ExitWithError(netErr) + if err := cmd.NewChatApiCmd().Exec(); err != nil { + program.ExitWithError(err) } } diff --git a/cmd/rpc/admin-rpc/main.go b/cmd/rpc/admin-rpc/main.go index 0f9793e9c..cd3f2e9a0 100644 --- a/cmd/rpc/admin-rpc/main.go +++ b/cmd/rpc/admin-rpc/main.go @@ -15,56 +15,12 @@ package main import ( - "flag" - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "math/rand" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/chatrpcstart" - "github.com/OpenIMSDK/chat/pkg/common/version" - "github.com/OpenIMSDK/tools/log" - - "github.com/OpenIMSDK/chat/internal/rpc/admin" - "github.com/OpenIMSDK/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/tools/system/program" ) func main() { - rand.Seed(time.Now().UnixNano()) - - configFile, rpcPort, showVersion, err := config.FlagParse() - if err != nil { - util.ExitWithError(err) - } - - // Check if the version flag was set - if showVersion { - ver := version.Get() - fmt.Println("Version:", ver.GitVersion) - fmt.Println("Git Commit:", ver.GitCommit) - fmt.Println("Build Date:", ver.BuildDate) - fmt.Println("Go Version:", ver.GoVersion) - fmt.Println("Compiler:", ver.Compiler) - fmt.Println("Platform:", ver.Platform) - return - } - - flag.Parse() - - if err := config.InitConfig(configFile); err != nil { - util.ExitWithError(err) - } - if err != nil { - util.ExitWithError(err) - } - if config.Config.Envs.Discovery == "k8s" { - rpcPort = 80 - } - if err := log.InitFromConfig("chat.log", "admin-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil { - util.ExitWithError(err) - } - err = chatrpcstart.Start(rpcPort, config.Config.RpcRegisterName.OpenImAdminName, 0, admin.Start) - if err != nil { - util.ExitWithError(err) + if err := cmd.NewAdminRpcCmd().Exec(); err != nil { + program.ExitWithError(err) } } diff --git a/cmd/rpc/chat-rpc/main.go b/cmd/rpc/chat-rpc/main.go index 35bbdbe3a..0dcb03a7d 100644 --- a/cmd/rpc/chat-rpc/main.go +++ b/cmd/rpc/chat-rpc/main.go @@ -15,52 +15,12 @@ package main import ( - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "math/rand" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/chatrpcstart" - "github.com/OpenIMSDK/tools/log" - - "github.com/OpenIMSDK/chat/internal/rpc/chat" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/version" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/tools/system/program" ) func main() { - rand.Seed(time.Now().UnixNano()) - configFile, rpcPort, showVersion, err := config.FlagParse() - if err != nil { - util.ExitWithError(err) - } - - // Check if the version flag was set - if showVersion { - ver := version.Get() - fmt.Println("Version:", ver.GitVersion) - fmt.Println("Git Commit:", ver.GitCommit) - fmt.Println("Build Date:", ver.BuildDate) - fmt.Println("Go Version:", ver.GoVersion) - fmt.Println("Compiler:", ver.Compiler) - fmt.Println("Platform:", ver.Platform) - return - } - - if err := config.InitConfig(configFile); err != nil { - util.ExitWithError(err) - } - if config.Config.Envs.Discovery == "k8s" { - rpcPort = 80 - } - if err != nil { - util.ExitWithError(err) - } - if err := log.InitFromConfig("chat.log", "chat-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil { - util.ExitWithError(err) - } - err = chatrpcstart.Start(rpcPort, config.Config.RpcRegisterName.OpenImChatName, 0, chat.Start) - if err != nil { - util.ExitWithError(err) + if err := cmd.NewChatRpcCmd().Exec(); err != nil { + program.ExitWithError(err) } } diff --git a/config/Readme.md b/config/Readme.md deleted file mode 100644 index c835bdf9c..000000000 --- a/config/Readme.md +++ /dev/null @@ -1,16 +0,0 @@ -# Configuration file - -The configuration file is automatically generated through make init or `scripts/init-config.sh`. Is generated by the source file [https://github.com/openimsdk/chat/blob/main/deployments/templates/config.yaml](https://github.com/openimsdk/chat/blob/main/deployments/templates/config.yaml) - -Add the configuration file to the policy that adds version management - - -```bash -make init -``` - -## Fix config/config.yaml - -```bash -vim config/config.yaml -``` diff --git a/config/chat-api-admin.yml b/config/chat-api-admin.yml new file mode 100644 index 000000000..dfc773c9f --- /dev/null +++ b/config/chat-api-admin.yml @@ -0,0 +1,4 @@ +api: + listenIP: 0.0.0.0 + ports: [ 10009 ] + diff --git a/config/chat-api-chat.yml b/config/chat-api-chat.yml new file mode 100644 index 000000000..4c86fed55 --- /dev/null +++ b/config/chat-api-chat.yml @@ -0,0 +1,4 @@ +api: + listenIP: 0.0.0.0 + ports: [ 10008 ] + diff --git a/config/chat-rpc-admin.yml b/config/chat-rpc-admin.yml new file mode 100644 index 000000000..fb25d131a --- /dev/null +++ b/config/chat-rpc-admin.yml @@ -0,0 +1,9 @@ +rpc: + registerIP: '' + listenIP: 0.0.0.0 + ports: [ 30200 ] + +tokenPolicy: + expire: 90 + +secret: chat123 \ No newline at end of file diff --git a/config/chat-rpc-chat.yml b/config/chat-rpc-chat.yml new file mode 100644 index 000000000..264759c61 --- /dev/null +++ b/config/chat-rpc-chat.yml @@ -0,0 +1,32 @@ +rpc: + registerIP: '' + listenIP: 0.0.0.0 + ports: [ 30300 ] + +verifyCode: + validTime: 300 + validCount: 5 + uintTime: 86400 + maxCount: 10 + superCode: "666666" + len: 6 + phone: + use: "" + ali: + endpoint: "" + accessKeyId: "" + accessKeySecret: "" + signName: "" + verificationCodeTemplateCode: "" + mail: + enable: false + title: "" + senderMail: "" + senderAuthorizationCode: "" + smtpAddr: "" + smtpPort: + +liveKit: + url: "ws://127.0.0.1:7880" # LIVEKIT_URL, LiveKit server address and port + key: "APIGPW3gnFTzqHH" + secret: "23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3" diff --git a/config/log.yml b/config/log.yml new file mode 100644 index 000000000..081393902 --- /dev/null +++ b/config/log.yml @@ -0,0 +1,7 @@ +storageLocation: ../../../../logs/ +rotationTime: 24 +remainRotationCount: 2 +remainLogLevel: 6 +isStdout: false +isJson: false +withStack: false diff --git a/config/mongodb.yml b/config/mongodb.yml new file mode 100644 index 000000000..12f1f66a5 --- /dev/null +++ b/config/mongodb.yml @@ -0,0 +1,7 @@ +uri: '' +address: [ localhost:37017 ] +database: openim_v3 +username: openIM +password: openIM123 +maxPoolSize: 100 +maxRetry: 10 \ No newline at end of file diff --git a/config/redis.yml b/config/redis.yml new file mode 100644 index 000000000..26becd887 --- /dev/null +++ b/config/redis.yml @@ -0,0 +1,7 @@ +address: [ localhost:16379 ] +username: '' +password: openIM123 +enablePipeline: false +clusterMode: false +db: 0 +maxRetry: 10 \ No newline at end of file diff --git a/config/share.yml b/config/share.yml new file mode 100644 index 000000000..76e1b4427 --- /dev/null +++ b/config/share.yml @@ -0,0 +1,16 @@ +env: zookeeper +rpcRegisterName: + chat: chat + admin: admin + +openIM: + apiURL: http://127.0.0.1:10002 + secret: openIM123 + adminUserID: imAdmin + +chatAdmin: + - adminID: chatAdmin + imUserID: imAdmin + nickname: chatAdmin + +#proxyHeader: "X-Forwarded-For" \ No newline at end of file diff --git a/config/zookeeper.yml b/config/zookeeper.yml new file mode 100644 index 000000000..73c76e79c --- /dev/null +++ b/config/zookeeper.yml @@ -0,0 +1,5 @@ +schema: openim +address: [ localhost:12181 ] +username: '' +password: '' + diff --git a/docs/contrib/git_workflow.md b/docs/contrib/git_workflow.md index 1d21f9cdd..9919f2055 100644 --- a/docs/contrib/git_workflow.md +++ b/docs/contrib/git_workflow.md @@ -18,7 +18,7 @@ OpenIM project uses the [GitHub flow](https://docs.github.com/en/get-started/qui ### Branch naming conventions -Every forked repository works independently, meaning that any contributor can create branches with the name they see fit. However, it is worth noting that OpenIM mirrors [OpenIM version skew policy](https://github.com/OpenIMSDK/Open-IM-Server/releases) by maintaining release branches for the most recent three minor releases. The only exception is that the main branch mirrors the latest OpenIM release (3.10) instead of using a `release-` prefixed one. +Every forked repository works independently, meaning that any contributor can create branches with the name they see fit. However, it is worth noting that OpenIM mirrors [OpenIM version skew policy](https://github.com/openimsdk/Open-IM-Server/releases) by maintaining release branches for the most recent three minor releases. The only exception is that the main branch mirrors the latest OpenIM release (3.10) instead of using a `release-` prefixed one. ```text main -------------------------------------------. (OpenIM 3.10) @@ -39,7 +39,7 @@ There are everyday tasks related to git that every contributor needs to perform, Creating a OpenIM fork, cloning it, and setting its upstream remote can be summarized on: -1. Visit +1. Visit 2. Click the `Fork` button (top right) to establish a cloud-based fork 3. Clone fork to local storage 4. Add to your fork OpenIM remote as upstream @@ -54,7 +54,7 @@ git clone https://github.com/$user/OpenIM.git ## Add OpenIM as upstream to your fork cd OpenIM -git remote add upstream https://github.com/OpenIMSDK/Open-IM-Server.git +git remote add upstream https://github.com/openimsdk/Open-IM-Server.git # or: git remote add upstream git@github.com:OpenIMSDK/Open-IM-Server.git ## Ensure to never push to upstream directly diff --git a/docs/conversions/logging.md b/docs/conversions/logging.md index 82f74c9aa..22918dfbb 100644 --- a/docs/conversions/logging.md +++ b/docs/conversions/logging.md @@ -2,7 +2,7 @@ ### Log Standards -- The unified log package `github.com/OpenIMSDK/Open-IM-Server/internal/pkg/log` should be used for all logging; +- The unified log package `github.com/openimsdk/Open-IM-Server/internal/pkg/log` should be used for all logging; - Use structured logging formats: `log.Infow`, `log.Warnw`, `log.Errorw`, etc. For example: `log.Infow("Update post function called")`; - All logs should start with an uppercase letter and should not end with a `.`. For example: `log.Infow("Update post function called")`; - Use past tense. For example, use `Could not delete B` instead of `Cannot delete B`; diff --git a/example/callback/callback.go b/example/callback/callback.go deleted file mode 100644 index e22b8eb5b..000000000 --- a/example/callback/callback.go +++ /dev/null @@ -1,315 +0,0 @@ -package callback - -import ( - "bytes" - "context" - "crypto/md5" - "encoding/hex" - "encoding/json" - "errors" - "github.com/OpenIMSDK/chat/pkg/common/apistruct" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/chat/pkg/proto/common" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/utils" - "github.com/gin-gonic/gin" - "io" - "net/http" - "reflect" - "strings" - "time" -) - -func CallbackExample(c *gin.Context) { - // 1. Handling callbacks after sending a single chat message - msgInfo, err := handlingCallbackAfterSendMsg(c) - if err != nil { - log.ZError(c, "handlingCallbackAfterSendMsg failed", err) - return - } - - // 2. If the user receiving the message is a customer service bot, return the message. - // 2.1 UserID of the robot account - robotics := "robotics" - - // 2.2 ChatRobot account validation and determining if messages are text and images - if msgInfo.SendID == robotics || msgInfo.RecvID != robotics { - return - } - if msgInfo.ContentType != constant.Picture && msgInfo.ContentType != constant.Text { - return - } - - // 2.3 Get administrator token - adminToken, err := getAdminToken(c) - if err != nil { - log.ZError(c, "getAdminToken failed", err) - return - } - - // 2.4 Get RobotAccount info - robUser, err := getRobotAccountInfo(c, adminToken.AdminToken, robotics) - if err != nil { - log.ZError(c, "getRobotAccountInfo failed", err) - return - } - - // 2.5 Constructing Message Field Contents - mapStruct, err := contextToMap(c, msgInfo) - if err != nil { - log.ZError(c, "contextToMap", err) - return - } - - // 2.6 Send Message - err = sendMessage(c, adminToken.ImToken, msgInfo, robUser, mapStruct) - if err != nil { - log.ZError(c, "getRobotAccountInfo failed", err) - return - } -} - -// struct to map -func convertStructToMap(input interface{}) (map[string]interface{}, error) { - result := make(map[string]interface{}) - inputType := reflect.TypeOf(input) - inputValue := reflect.ValueOf(input) - - if inputType.Kind() != reflect.Struct { - return nil, errors.New("input is not a struct") - } - - for i := 0; i < inputType.NumField(); i++ { - field := inputType.Field(i) - fieldValue := inputValue.Field(i) - - mapKey := field.Tag.Get("mapstructure") - if mapKey == "" { - mapKey = field.Name - } - - mapKey = strings.ToLower(mapKey) - result[mapKey] = fieldValue.Interface() - } - - return result, nil -} - -func Post(ctx context.Context, url string, header map[string]string, data any, timeout int) (content []byte, err error) { - var ( - // define http client. - client = &http.Client{ - Timeout: 15 * time.Second, // max timeout is 15s - } - ) - - if timeout > 0 { - var cancel func() - ctx, cancel = context.WithTimeout(ctx, time.Second*time.Duration(timeout)) - defer cancel() - } - - jsonStr, err := json.Marshal(data) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewBuffer(jsonStr)) - if err != nil { - return nil, err - } - - if operationID, _ := ctx.Value(constant.OperationID).(string); operationID != "" { - req.Header.Set(constant.OperationID, operationID) - } - for k, v := range header { - req.Header.Set(k, v) - } - req.Header.Add("content-type", "application/json; charset=utf-8") - - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - result, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - return result, nil -} - -// handlingCallbackAfterSendMsg Handling callbacks after sending a message -func handlingCallbackAfterSendMsg(c *gin.Context) (*apistruct.CallbackAfterSendSingleMsgReq, error) { - - var req apistruct.CallbackAfterSendSingleMsgReq - - if err := c.BindJSON(&req); err != nil { - return nil, err - } - - resp := apistruct.CallbackAfterSendSingleMsgResp{ - CommonCallbackResp: apistruct.CommonCallbackResp{ - ActionCode: 0, - ErrCode: 200, - ErrMsg: "success", - ErrDlt: "successful", - NextCode: 0, - }, - } - c.JSON(http.StatusOK, resp) - return &req, nil -} - -func getAdminToken(c *gin.Context) (*apistruct.AdminLoginResp, error) { - url := "http://127.0.0.1:10009/account/login" - adminID := config.Config.ChatAdmin[0].AdminID - paswd := md5.Sum([]byte(adminID)) - - adminInput := admin.LoginReq{ - Account: config.Config.ChatAdmin[0].AdminID, - Password: hex.EncodeToString(paswd[:]), - } - - header := make(map[string]string, 2) - header["operationID"] = "111" - - b, err := Post(c, url, header, adminInput, 10) - if err != nil { - return nil, err - } - - type TokenInfo struct { - ErrCode int `json:"errCode"` - ErrMsg string `json:"errMsg"` - ErrDlt string `json:"errDlt"` - Data apistruct.AdminLoginResp `json:"data,omitempty"` - } - - adminOutput := &TokenInfo{} - - if err = json.Unmarshal(b, adminOutput); err != nil { - return nil, err - } - return &apistruct.AdminLoginResp{AdminToken: adminOutput.Data.AdminToken, ImToken: adminOutput.Data.ImToken}, nil -} - -// CheckRobotAccount Verify if the robot account exists -func getRobotAccountInfo(c *gin.Context, token, robotics string) (*common.UserPublicInfo, error) { - header := make(map[string]string) - header["token"] = token - - url := "http://127.0.0.1:10008/user/find/public" - - searchInput := chat.FindUserPublicInfoReq{ - UserIDs: []string{robotics}, - } - - b, err := Post(c, url, header, searchInput, 10) - if err != nil { - return nil, err - } - - type UserInfo struct { - ErrCode int `json:"errCode"` - ErrMsg string `json:"errMsg"` - ErrDlt string `json:"errDlt"` - Data chat.FindUserPublicInfoResp `json:"data,omitempty"` - } - searchOutput := &UserInfo{} - if err = json.Unmarshal(b, searchOutput); err != nil { - return nil, err - } - - if len(searchOutput.Data.Users) == 0 || searchOutput.Data.Users == nil { - return nil, err - } - return searchOutput.Data.Users[0], nil -} - -func contextToMap(c *gin.Context, req *apistruct.CallbackAfterSendSingleMsgReq) (map[string]any, error) { - text := apistruct.TextElem{} - picture := apistruct.PictureElem{} - mapStruct := make(map[string]any) - var err error - // Handle message structures - if req.ContentType == constant.Text { - err = json.Unmarshal([]byte(req.Content), &text) - if err != nil { - return nil, err - } - mapStruct["content"] = text.Content - } else { - err = json.Unmarshal([]byte(req.Content), &picture) - if err != nil { - return nil, err - } - if strings.Contains(picture.SourcePicture.Type, "/") { - arr := strings.Split(picture.SourcePicture.Type, "/") - picture.SourcePicture.Type = arr[1] - } - - if strings.Contains(picture.BigPicture.Type, "/") { - arr := strings.Split(picture.BigPicture.Type, "/") - picture.BigPicture.Type = arr[1] - } - - if len(picture.SnapshotPicture.Type) == 0 { - picture.SnapshotPicture.Type = picture.SourcePicture.Type - } - - mapStructSnap := make(map[string]interface{}) - if mapStructSnap, err = convertStructToMap(picture.SnapshotPicture); err != nil { - return nil, errs.Wrap(err) - } - mapStruct["snapshotPicture"] = mapStructSnap - - mapStructBig := make(map[string]interface{}) - if mapStructBig, err = convertStructToMap(picture.BigPicture); err != nil { - return nil, errs.Wrap(err) - } - mapStruct["bigPicture"] = mapStructBig - - mapStructSource := make(map[string]interface{}) - if mapStructSource, err = convertStructToMap(picture.SourcePicture); err != nil { - return nil, errs.Wrap(err) - } - mapStruct["sourcePicture"] = mapStructSource - mapStruct["sourcePath"] = picture.SourcePath - } - return mapStruct, nil -} - -func sendMessage(c *gin.Context, token string, req *apistruct.CallbackAfterSendSingleMsgReq, rob *common.UserPublicInfo, mapStruct map[string]interface{}) error { - header := map[string]string{} - header["token"] = token - - input := &apistruct.SendMsgReq{ - RecvID: req.SendID, - SendMsg: apistruct.SendMsg{ - SendID: rob.UserID, - SenderNickname: rob.Nickname, - SenderFaceURL: rob.FaceURL, - SenderPlatformID: req.SenderPlatformID, - Content: mapStruct, - ContentType: req.ContentType, - SessionType: req.SessionType, - SendTime: utils.GetCurrentTimestampByMill(), // millisecond - }, - } - - url := "http://127.0.0.1:10002/msg/send_msg" - - // Initiate a post request that calls the interface that sends the message (the bot sends a message to user) - _, err := Post(c, url, header, input, 10) - if err != nil { - return err - } - return nil -} diff --git a/go.mod b/go.mod index c073ef9c9..058c9be80 100644 --- a/go.mod +++ b/go.mod @@ -1,43 +1,42 @@ -module github.com/OpenIMSDK/chat - -go 1.21 -toolchain go1.21.2 +module github.com/openimsdk/chat +go 1.21.2 require ( github.com/gin-gonic/gin v1.9.1 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.6.0 - github.com/jinzhu/copier v0.3.5 // indirect + github.com/jinzhu/copier v0.4.0 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect - google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 - gorm.io/driver/mysql v1.5.1 - gorm.io/gorm v1.25.4 + gorm.io/gorm v1.25.8 ) require ( github.com/alibabacloud-go/darabonba-openapi v0.2.1 github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.18 github.com/alibabacloud-go/tea v1.2.1 - github.com/go-sql-driver/mysql v1.7.1 ) require ( - github.com/OpenIMSDK/protocol v0.0.21 - github.com/OpenIMSDK/tools v0.0.37 github.com/livekit/protocol v1.10.1 + github.com/mitchellh/mapstructure v1.5.0 + github.com/openimsdk/gomake v0.0.6 + github.com/openimsdk/protocol v0.0.63 + github.com/openimsdk/tools v0.0.47-alpha.42 github.com/redis/go-redis/v9 v9.5.1 + github.com/spf13/cobra v1.8.0 + github.com/spf13/viper v1.18.2 github.com/xuri/excelize/v2 v2.8.0 - go.mongodb.org/mongo-driver v1.12.0 + go.mongodb.org/mongo-driver v1.14.0 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df ) require ( - github.com/IBM/sarama v1.42.1 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect @@ -45,59 +44,52 @@ require ( github.com/alibabacloud-go/tea-utils v1.4.5 // indirect github.com/alibabacloud-go/tea-xml v1.1.2 // indirect github.com/aliyun/credentials-go v1.1.2 // indirect - github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/clbanning/mxj/v2 v2.5.6 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/eapache/go-resiliency v1.4.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect - github.com/eapache/queue v1.1.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-jose/go-jose/v3 v3.0.2 // indirect + github.com/go-jose/go-jose/v3 v3.0.3 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/go-playground/validator/v10 v10.18.0 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/jcmturner/aescts/v2 v2.0.0 // indirect - github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect - github.com/jcmturner/gofork v1.7.6 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect - github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/lestrrat-go/strftime v1.0.6 // indirect + github.com/magefile/mage v1.15.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/minio-go/v7 v7.0.66 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect - github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/pierrec/lz4/v4 v4.1.18 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/richardlehane/mscfb v1.0.4 // indirect github.com/richardlehane/msoleps v1.0.3 // indirect - github.com/rs/xid v1.5.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/shirou/gopsutil v3.21.11+incompatible // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/tjfoc/gmsm v1.3.2 // indirect + github.com/tklauser/go-sysconf v0.3.13 // indirect + github.com/tklauser/numcpus v0.7.0 // indirect github.com/twitchtv/twirp v8.1.3+incompatible // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect @@ -107,17 +99,18 @@ require ( github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/image v0.11.0 // indirect - golang.org/x/net v0.21.0 // indirect + golang.org/x/net v0.22.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 99ad17f15..986e7b103 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,3 @@ -github.com/IBM/sarama v1.42.1 h1:wugyWa15TDEHh2kvq2gAy1IHLjEjuYOYgXz/ruC/OSQ= -github.com/IBM/sarama v1.42.1/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= -github.com/OpenIMSDK/protocol v0.0.21 h1:5H6H+hJ9d/VgRqttvxD/zfK9Asd+4M8Eknk5swSbUVY= -github.com/OpenIMSDK/protocol v0.0.21/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= -github.com/OpenIMSDK/tools v0.0.37 h1:qvDqmA4RbEJtPjZouWCkVuf/pjm6Y8nUrG5iH2gcnOg= -github.com/OpenIMSDK/tools v0.0.37/go.mod h1:wBfR5CYmEyvxl03QJbTkhz1CluK6J4/lX0lviu8JAjE= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/darabonba-openapi v0.1.18/go.mod h1:PB4HffMhJVmAgNKNq3wYbTUlFvPgxJpTzd1F5pTuUsc= @@ -35,10 +29,11 @@ github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCE github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -50,43 +45,45 @@ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583j github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/clbanning/mxj/v2 v2.5.6 h1:Jm4VaCI/+Ug5Q57IzEoZbwx4iQFA6wkXv72juUSeK+g= github.com/clbanning/mxj/v2 v2.5.6/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/channels v1.1.0 h1:F1taHcn7/F0i8DYqKXJnyhJcVpp2kgFcNePxXtnyu4k= -github.com/eapache/go-resiliency v1.4.0 h1:3OK9bWpPk5q6pbFAaYSEwD9CLUSHG8bnZuqX2yMt3B0= -github.com/eapache/go-resiliency v1.4.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= -github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= -github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= +github.com/eapache/channels v1.1.0/go.mod h1:jMm2qB5Ubtg9zLd+inMZd2/NUvXgzmWXsDaLyQIGfH0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frostbyte73/core v0.0.10 h1:D4DQXdPb8ICayz0n75rs4UYTXrUSdxzUfeleuNJORsU= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/frostbyte73/core v0.0.10/go.mod h1:XsOGqrqe/VEV7+8vJ+3a8qnCIXNbKsoEiu/czs7nrcU= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0= +github.com/gammazero/deque v0.2.1/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-jose/go-jose/v3 v3.0.2 h1:2Edjn8Nrb44UvTdp84KU0bBPs1cO7noRCybtS3eJEUQ= -github.com/go-jose/go-jose/v3 v3.0.2/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U= +github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= @@ -96,66 +93,49 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= -github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= -github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= -github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= -github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= -github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= -github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= -github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= -github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= -github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= -github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= +github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= +github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jxskiss/base62 v1.1.0 h1:A5zbF8v8WXx2xixnAKD2w+abC+sIzYJX+nxmhA6HWFw= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/jxskiss/base62 v1.1.0/go.mod h1:HhWAlUXvxKThfOlZbcuFzsqwtF5TcqS9ru3y5GfjWAc= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= @@ -163,19 +143,23 @@ github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECae github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= github.com/lithammer/shortuuid/v4 v4.0.0 h1:QRbbVkfgNippHOS8PXDkti4NaWeyYfcBTHtw7k08o4c= +github.com/lithammer/shortuuid/v4 v4.0.0/go.mod h1:Zs8puNcrvf2rV9rTH51ZLLcj7ZXqQI3lv67aw4KiB1Y= github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkDaKb5iXdynYrzB84ErPPO4LbRASk58= +github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ= github.com/livekit/protocol v1.10.1 h1:upe6pKRqH8wpsMuR2OLtgizEm94iia3pDYm3O4/2PRY= github.com/livekit/protocol v1.10.1/go.mod h1:eWPz45pnxwpCwB84qqhHxG0bCRgasa2itN6GAHCDddc= github.com/livekit/psrpc v0.5.3-0.20240227154351-b7f99eaaf7b3 h1:bvjzDR+Rvdf3JgzQMtLiGVHBQ8KoOWM7x7sHj79jevQ= +github.com/livekit/psrpc v0.5.3-0.20240227154351-b7f99eaaf7b3/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= +github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= +github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= +github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= -github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.66 h1:bnTOXOHjOqv/gcMuiVbN9o2ngRItvqE774dG9nq0Dzw= -github.com/minio/minio-go/v7 v7.0.66/go.mod h1:DHAgmyQEGdW3Cif0UooKOyrT3Vxs82zNdV6tkKhRtbs= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -188,43 +172,67 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= +github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= -github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/openimsdk/gomake v0.0.6 h1:bJmQWDHBj8PQ7oGJ2SL3Gsx0k5CdI/BPfGzlGcV105s= +github.com/openimsdk/gomake v0.0.6/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= +github.com/openimsdk/protocol v0.0.63 h1:9DnweZe9nEYDFa4fGTbC9Cqi0gLUdtBhRo1NRP2X3WQ= +github.com/openimsdk/protocol v0.0.63/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8= +github.com/openimsdk/tools v0.0.47-alpha.42 h1:wM6t9otTLhXECq8aQcYaZGvBgo/ZAmbNTqVt3g3NHGg= +github.com/openimsdk/tools v0.0.47-alpha.42/go.mod h1:P4oGP1Pd+d4ctbLD5U/XQTgl8yu8Hd3skx640Fr69ko= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pion/datachannel v1.5.5 h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8= +github.com/pion/datachannel v1.5.5/go.mod h1:iMz+lECmfdCMqFRhXhcA/219B0SQlbpoR2V118yimL0= github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8= +github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= github.com/pion/ice/v2 v2.3.13 h1:xOxP+4V9nSDlUaGFRf/LvAuGHDXRcjIdsbbXPK/w7c8= +github.com/pion/ice/v2 v2.3.13/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw= github.com/pion/interceptor v0.1.25 h1:pwY9r7P6ToQ3+IF0bajN0xmk/fNw/suTgaTdlwTDmhc= +github.com/pion/interceptor v0.1.25/go.mod h1:wkbPYAak5zKsfpVDYMtEfWEy8D4zL+rpxCxPImLOg3Y= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= +github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8= +github.com/pion/mdns v0.0.12/go.mod h1:VExJjv8to/6Wqm1FXK+Ii/Z9tsVk/F5sD/N70cnYFbk= github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= +github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= github.com/pion/rtcp v1.2.12 h1:bKWiX93XKgDZENEXCijvHRU/wRifm6JV5DGcH6twtSM= +github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= github.com/pion/rtp v1.8.3 h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8= +github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= github.com/pion/sctp v1.8.12 h1:2VX50pedElH+is6FI+OKyRTeN5oy4mrk2HjnGa3UCmY= +github.com/pion/sctp v1.8.12/go.mod h1:cMLT45jqw3+jiJCrtHVwfQLnfR0MGZ4rgOJwUOIqLkI= github.com/pion/sdp/v3 v3.0.6 h1:WuDLhtuFUUVpTfus9ILC4HRyHsW6TdugjEX/QY9OiUw= +github.com/pion/sdp/v3 v3.0.6/go.mod h1:iiFWFpQO8Fy3S5ldclBkpXqmWy02ns78NOKoLLL0YQw= github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo= +github.com/pion/srtp/v2 v2.0.18/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA= github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= +github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= github.com/pion/transport/v2 v2.2.3 h1:XcOE3/x41HOSKbl1BfyY1TF1dERx7lVvlMCbXU7kfvA= +github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/turn/v2 v2.1.3 h1:pYxTVWG2gpC97opdRc5IGsQ1lJ9O/IlNhkzj7MMrGAA= +github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/webrtc/v3 v3.2.28 h1:ienStxZ6HcjtH2UlmnFpMM0loENiYjaX437uIUpQSKo= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pion/webrtc/v3 v3.2.28/go.mod h1:PNRCEuQlibrmuBhOTnol9j6KkIbUG11aHLEfNpUYey0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/puzpuzpuz/xsync v1.5.2 h1:yRAP4wqSOZG+/4pxJ08fPTwrfL0IzE/LKQ/cw509qGY= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/puzpuzpuz/xsync v1.5.2/go.mod h1:K98BYhX3k1dQ2M63t1YNVDanbwUPmBCAhNmVrrxfiGg= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= @@ -232,31 +240,52 @@ github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7 github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM= github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= +github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= +github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= +github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/twitchtv/twirp v8.1.3+incompatible h1:+F4TdErPgSUbMZMwp13Q/KgDVuI7HJXP61mNV3/7iuU= github.com/twitchtv/twirp v8.1.3+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -280,11 +309,16 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= -go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE= -go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -297,8 +331,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= @@ -306,27 +338,25 @@ golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= +golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= +golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -336,13 +366,12 @@ golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -350,8 +379,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -362,7 +391,6 @@ golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -380,19 +408,20 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -403,9 +432,6 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= -gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= -gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= -gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.8 h1:WAGEZ/aEcznN4D03laj8DKnehe1e9gYQAjW8xyPRdeo= +gorm.io/gorm v1.25.8/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/api/admin.go b/internal/api/admin/admin.go similarity index 55% rename from internal/api/admin.go rename to internal/api/admin/admin.go index 97d9244c7..e0586939c 100644 --- a/internal/api/admin.go +++ b/internal/api/admin/admin.go @@ -12,76 +12,72 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package admin import ( "context" "crypto/md5" "encoding/hex" - "fmt" - "github.com/OpenIMSDK/chat/pkg/common/apicall" - "github.com/OpenIMSDK/chat/pkg/common/apistruct" - "github.com/OpenIMSDK/chat/pkg/common/config" - constant2 "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/common/xlsx" - "github.com/OpenIMSDK/chat/pkg/common/xlsx/model" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/protocol/user" - "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/tools/apiresp" - "github.com/OpenIMSDK/tools/checker" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/utils" "github.com/gin-gonic/gin" - "google.golang.org/grpc" - "net" + "github.com/openimsdk/chat/internal/api/util" + "github.com/openimsdk/chat/pkg/common/apistruct" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/imapi" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/common/xlsx" + "github.com/openimsdk/chat/pkg/common/xlsx/model" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/protocol/user" + "github.com/openimsdk/tools/a2r" + "github.com/openimsdk/tools/apiresp" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils/datautil" + "github.com/openimsdk/tools/utils/encrypt" "net/http" "strconv" "strings" "time" ) -func NewAdmin(chatConn, adminConn grpc.ClientConnInterface) *AdminApi { - return &AdminApi{chatClient: chat.NewChatClient(chatConn), adminClient: admin.NewAdminClient(adminConn), imApiCaller: apicall.NewCallerInterface()} +func New(chatClient chat.ChatClient, adminClient admin.AdminClient, imApiCaller imapi.CallerInterface, api *util.Api) *Api { + return &Api{ + Api: api, + chatClient: chatClient, + adminClient: adminClient, + imApiCaller: imApiCaller, + } } -type AdminApi struct { +type Api struct { + *util.Api chatClient chat.ChatClient adminClient admin.AdminClient - imApiCaller apicall.CallerInterface + imApiCaller imapi.CallerInterface } -func (o *AdminApi) AdminLogin(c *gin.Context) { - var ( - req admin.LoginReq - resp apistruct.AdminLoginResp - ) - if err := c.BindJSON(&req); err != nil { +func (o *Api) AdminLogin(c *gin.Context) { + req, err := a2r.ParseRequest[admin.LoginReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - loginResp, err := o.adminClient.Login(c, &req) + loginResp, err := o.adminClient.Login(c, req) if err != nil { apiresp.GinError(c, err) return } - imAdminUserID := config.GetIMAdmin(loginResp.AdminUserID) + imAdminUserID := o.GetDefaultIMAdminUserID() imToken, err := o.imApiCaller.UserToken(c, imAdminUserID, constant.AdminPlatformID) if err != nil { apiresp.GinError(c, err) return } - err = utils.CopyStructFields(&resp, loginResp) - if err != nil { + var resp apistruct.AdminLoginResp + if err := datautil.CopyStructFields(&resp, loginResp); err != nil { apiresp.GinError(c, err) return } @@ -90,27 +86,23 @@ func (o *AdminApi) AdminLogin(c *gin.Context) { apiresp.GinSuccess(c, resp) } -func (o *AdminApi) ResetUserPassword(c *gin.Context) { +func (o *Api) ResetUserPassword(c *gin.Context) { a2r.Call(chat.ChatClient.ChangePassword, o.chatClient, c) } -func (o *AdminApi) AdminUpdateInfo(c *gin.Context) { - var req admin.AdminUpdateInfoReq - if err := c.BindJSON(&req); err != nil { +func (o *Api) AdminUpdateInfo(c *gin.Context) { + req, err := a2r.ParseRequest[admin.AdminUpdateInfoReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - resp, err := o.adminClient.AdminUpdateInfo(c, &req) + resp, err := o.adminClient.AdminUpdateInfo(c, req) if err != nil { apiresp.GinError(c, err) return } - imAdminUserID := config.GetIMAdmin(resp.UserID) + imAdminUserID := o.GetDefaultIMAdminUserID() imToken, err := o.imApiCaller.UserToken(c, imAdminUserID, constant.AdminPlatformID) if err != nil { log.ZError(c, "AdminUpdateInfo ImAdminTokenWithDefaultAdmin", err, "imAdminUserID", imAdminUserID) @@ -122,31 +114,29 @@ func (o *AdminApi) AdminUpdateInfo(c *gin.Context) { apiresp.GinSuccess(c, nil) } -func (o *AdminApi) AdminInfo(c *gin.Context) { +func (o *Api) AdminInfo(c *gin.Context) { a2r.Call(admin.AdminClient.GetAdminInfo, o.adminClient, c) } -func (o *AdminApi) ChangeAdminPassword(c *gin.Context) { +func (o *Api) ChangeAdminPassword(c *gin.Context) { a2r.Call(admin.AdminClient.ChangeAdminPassword, o.adminClient, c) } -func (o *AdminApi) AddAdminAccount(c *gin.Context) { +func (o *Api) AddAdminAccount(c *gin.Context) { a2r.Call(admin.AdminClient.AddAdminAccount, o.adminClient, c) } -func (o *AdminApi) AddUserAccount(c *gin.Context) { - var req chat.AddUserAccountReq - if err := c.BindJSON(&req); err != nil { +func (o *Api) AddUserAccount(c *gin.Context) { + req, err := a2r.ParseRequest[chat.AddUserAccountReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 + if _, err := o.chatClient.AddUserAccount(c, req); err != nil { + apiresp.GinError(c, err) return } - _, err := o.chatClient.AddUserAccount(c, &req) - userInfo := &sdkws.UserInfo{ UserID: req.User.UserID, Nickname: req.User.Nickname, @@ -163,41 +153,37 @@ func (o *AdminApi) AddUserAccount(c *gin.Context) { } -func (o *AdminApi) DelAdminAccount(c *gin.Context) { +func (o *Api) DelAdminAccount(c *gin.Context) { a2r.Call(admin.AdminClient.DelAdminAccount, o.adminClient, c) } -func (o *AdminApi) SearchAdminAccount(c *gin.Context) { +func (o *Api) SearchAdminAccount(c *gin.Context) { a2r.Call(admin.AdminClient.SearchAdminAccount, o.adminClient, c) } -func (o *AdminApi) AddDefaultFriend(c *gin.Context) { +func (o *Api) AddDefaultFriend(c *gin.Context) { a2r.Call(admin.AdminClient.AddDefaultFriend, o.adminClient, c) } -func (o *AdminApi) DelDefaultFriend(c *gin.Context) { +func (o *Api) DelDefaultFriend(c *gin.Context) { a2r.Call(admin.AdminClient.DelDefaultFriend, o.adminClient, c) } -func (o *AdminApi) SearchDefaultFriend(c *gin.Context) { +func (o *Api) SearchDefaultFriend(c *gin.Context) { a2r.Call(admin.AdminClient.SearchDefaultFriend, o.adminClient, c) } -func (o *AdminApi) FindDefaultFriend(c *gin.Context) { +func (o *Api) FindDefaultFriend(c *gin.Context) { a2r.Call(admin.AdminClient.FindDefaultFriend, o.adminClient, c) } -func (o *AdminApi) AddDefaultGroup(c *gin.Context) { - var req admin.AddDefaultGroupReq - if err := c.BindJSON(&req); err != nil { - apiresp.GinError(c, err) - return - } - if err := checker.Validate(&req); err != nil { +func (o *Api) AddDefaultGroup(c *gin.Context) { + req, err := a2r.ParseRequest[admin.AddDefaultGroupReq](c) + if err != nil { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.UserToken(c, config.GetIMAdmin(mctx.GetOpUserID(c)), constant.AdminPlatformID) + imToken, err := o.imApiCaller.UserToken(c, o.GetDefaultIMAdminUserID(), constant.AdminPlatformID) if err != nil { apiresp.GinError(c, err) return @@ -208,7 +194,7 @@ func (o *AdminApi) AddDefaultGroup(c *gin.Context) { return } if len(req.GroupIDs) != len(groups) { - apiresp.GinError(c, errs.ErrArgs.Wrap("group id not found")) + apiresp.GinError(c, errs.ErrArgs.WrapMsg("group id not found")) return } resp, err := o.adminClient.AddDefaultGroup(c, &admin.AddDefaultGroupReq{ @@ -221,25 +207,21 @@ func (o *AdminApi) AddDefaultGroup(c *gin.Context) { apiresp.GinSuccess(c, resp) } -func (o *AdminApi) DelDefaultGroup(c *gin.Context) { +func (o *Api) DelDefaultGroup(c *gin.Context) { a2r.Call(admin.AdminClient.DelDefaultGroup, o.adminClient, c) } -func (o *AdminApi) FindDefaultGroup(c *gin.Context) { +func (o *Api) FindDefaultGroup(c *gin.Context) { a2r.Call(admin.AdminClient.FindDefaultGroup, o.adminClient, c) } -func (o *AdminApi) SearchDefaultGroup(c *gin.Context) { - var req admin.SearchDefaultGroupReq - if err := c.BindJSON(&req); err != nil { - apiresp.GinError(c, err) - return - } - if err := checker.Validate(&req); err != nil { +func (o *Api) SearchDefaultGroup(c *gin.Context) { + req, err := a2r.ParseRequest[admin.SearchDefaultGroupReq](c) + if err != nil { apiresp.GinError(c, err) return } - searchResp, err := o.adminClient.SearchDefaultGroup(c, &req) + searchResp, err := o.adminClient.SearchDefaultGroup(c, req) if err != nil { apiresp.GinError(c, err) return @@ -249,7 +231,7 @@ func (o *AdminApi) SearchDefaultGroup(c *gin.Context) { Groups: make([]*sdkws.GroupInfo, 0, len(searchResp.GroupIDs)), } if len(searchResp.GroupIDs) > 0 { - imToken, err := o.imApiCaller.UserToken(c, config.GetIMAdmin(mctx.GetOpUserID(c)), constant.AdminPlatformID) + imToken, err := o.imApiCaller.UserToken(c, o.GetDefaultIMAdminUserID(), constant.AdminPlatformID) if err != nil { apiresp.GinError(c, err) return @@ -276,66 +258,62 @@ func (o *AdminApi) SearchDefaultGroup(c *gin.Context) { apiresp.GinSuccess(c, resp) } -func (o *AdminApi) AddInvitationCode(c *gin.Context) { +func (o *Api) AddInvitationCode(c *gin.Context) { a2r.Call(admin.AdminClient.AddInvitationCode, o.adminClient, c) } -func (o *AdminApi) GenInvitationCode(c *gin.Context) { +func (o *Api) GenInvitationCode(c *gin.Context) { a2r.Call(admin.AdminClient.GenInvitationCode, o.adminClient, c) } -func (o *AdminApi) DelInvitationCode(c *gin.Context) { +func (o *Api) DelInvitationCode(c *gin.Context) { a2r.Call(admin.AdminClient.DelInvitationCode, o.adminClient, c) } -func (o *AdminApi) SearchInvitationCode(c *gin.Context) { +func (o *Api) SearchInvitationCode(c *gin.Context) { a2r.Call(admin.AdminClient.SearchInvitationCode, o.adminClient, c) } -func (o *AdminApi) AddUserIPLimitLogin(c *gin.Context) { +func (o *Api) AddUserIPLimitLogin(c *gin.Context) { a2r.Call(admin.AdminClient.AddUserIPLimitLogin, o.adminClient, c) } -func (o *AdminApi) SearchUserIPLimitLogin(c *gin.Context) { +func (o *Api) SearchUserIPLimitLogin(c *gin.Context) { a2r.Call(admin.AdminClient.SearchUserIPLimitLogin, o.adminClient, c) } -func (o *AdminApi) DelUserIPLimitLogin(c *gin.Context) { +func (o *Api) DelUserIPLimitLogin(c *gin.Context) { a2r.Call(admin.AdminClient.DelUserIPLimitLogin, o.adminClient, c) } -func (o *AdminApi) SearchIPForbidden(c *gin.Context) { +func (o *Api) SearchIPForbidden(c *gin.Context) { a2r.Call(admin.AdminClient.SearchIPForbidden, o.adminClient, c) } -func (o *AdminApi) AddIPForbidden(c *gin.Context) { +func (o *Api) AddIPForbidden(c *gin.Context) { a2r.Call(admin.AdminClient.AddIPForbidden, o.adminClient, c) } -func (o *AdminApi) DelIPForbidden(c *gin.Context) { +func (o *Api) DelIPForbidden(c *gin.Context) { a2r.Call(admin.AdminClient.DelIPForbidden, o.adminClient, c) } -func (o *AdminApi) ParseToken(c *gin.Context) { +func (o *Api) ParseToken(c *gin.Context) { a2r.Call(admin.AdminClient.ParseToken, o.adminClient, c) } -func (o *AdminApi) BlockUser(c *gin.Context) { - var req admin.BlockUserReq - if err := c.BindJSON(&req); err != nil { +func (o *Api) BlockUser(c *gin.Context) { + req, err := a2r.ParseRequest[admin.BlockUserReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - resp, err := o.adminClient.BlockUser(c, &req) + resp, err := o.adminClient.BlockUser(c, req) if err != nil { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.UserToken(c, config.GetIMAdmin(mctx.GetOpUserID(c)), constant.AdminPlatformID) + imToken, err := o.imApiCaller.UserToken(c, o.GetDefaultIMAdminUserID(), constant.AdminPlatformID) if err != nil { apiresp.GinError(c, err) return @@ -348,58 +326,53 @@ func (o *AdminApi) BlockUser(c *gin.Context) { apiresp.GinSuccess(c, resp) } -func (o *AdminApi) UnblockUser(c *gin.Context) { +func (o *Api) UnblockUser(c *gin.Context) { a2r.Call(admin.AdminClient.UnblockUser, o.adminClient, c) } -func (o *AdminApi) SearchBlockUser(c *gin.Context) { +func (o *Api) SearchBlockUser(c *gin.Context) { a2r.Call(admin.AdminClient.SearchBlockUser, o.adminClient, c) } -func (o *AdminApi) SetClientConfig(c *gin.Context) { +func (o *Api) SetClientConfig(c *gin.Context) { a2r.Call(admin.AdminClient.SetClientConfig, o.adminClient, c) } -func (o *AdminApi) DelClientConfig(c *gin.Context) { +func (o *Api) DelClientConfig(c *gin.Context) { a2r.Call(admin.AdminClient.DelClientConfig, o.adminClient, c) } -func (o *AdminApi) GetClientConfig(c *gin.Context) { +func (o *Api) GetClientConfig(c *gin.Context) { a2r.Call(admin.AdminClient.GetClientConfig, o.adminClient, c) } -func (o *AdminApi) AddApplet(c *gin.Context) { +func (o *Api) AddApplet(c *gin.Context) { a2r.Call(admin.AdminClient.AddApplet, o.adminClient, c) } -func (o *AdminApi) DelApplet(c *gin.Context) { +func (o *Api) DelApplet(c *gin.Context) { a2r.Call(admin.AdminClient.DelApplet, o.adminClient, c) } -func (o *AdminApi) UpdateApplet(c *gin.Context) { +func (o *Api) UpdateApplet(c *gin.Context) { a2r.Call(admin.AdminClient.UpdateApplet, o.adminClient, c) } -func (o *AdminApi) SearchApplet(c *gin.Context) { +func (o *Api) SearchApplet(c *gin.Context) { a2r.Call(admin.AdminClient.SearchApplet, o.adminClient, c) } -func (o *AdminApi) LoginUserCount(c *gin.Context) { +func (o *Api) LoginUserCount(c *gin.Context) { a2r.Call(chat.ChatClient.UserLoginCount, o.chatClient, c) } -func (o *AdminApi) NewUserCount(c *gin.Context) { - var req user.UserRegisterCountReq - var resp apistruct.NewUserCountResp - if err := c.BindJSON(&req); err != nil { +func (o *Api) NewUserCount(c *gin.Context) { + req, err := a2r.ParseRequest[user.UserRegisterCountReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - imToken, err := o.imApiCaller.UserToken(c, config.GetIMAdmin(mctx.GetOpUserID(c)), constant.AdminPlatformID) + imToken, err := o.imApiCaller.UserToken(c, o.GetDefaultIMAdminUserID(), constant.AdminPlatformID) if err != nil { apiresp.GinError(c, err) return @@ -409,64 +382,23 @@ func (o *AdminApi) NewUserCount(c *gin.Context) { apiresp.GinError(c, err) return } - resp.DateCount = dateCount - resp.Total = total - apiresp.GinSuccess(c, resp) -} - -func (o *AdminApi) SearchLogs(c *gin.Context) { - a2r.Call(chat.ChatClient.SearchLogs, o.chatClient, c) -} - -func (o *AdminApi) DeleteLogs(c *gin.Context) { - a2r.Call(chat.ChatClient.DeleteLogs, o.chatClient, c) -} - -func (o *AdminApi) getClientIP(c *gin.Context) (string, error) { - if config.Config.ProxyHeader == "" { - ip, _, err := net.SplitHostPort(c.Request.RemoteAddr) - return ip, err - } - ip := c.Request.Header.Get(config.Config.ProxyHeader) - if ip == "" { - return "", errs.ErrInternalServer.Wrap() - } - if ip := net.ParseIP(ip); ip == nil { - return "", errs.ErrInternalServer.Wrap(fmt.Sprintf("parse proxy ip header %s failed", ip)) - } - return ip, nil -} - -func (o *AdminApi) checkSecretAdmin(c *gin.Context, secret string) error { - if _, ok := c.Get(constant2.RpcOpUserID); ok { - return nil - } - if config.Config.ChatSecret == "" { - return errs.ErrNoPermission.Wrap("not config chat secret") - } - if config.Config.ChatSecret != secret { - return errs.ErrNoPermission.Wrap("secret error") - } - SetToken(c, config.GetDefaultIMAdmin(), constant2.AdminUser) - return nil + apiresp.GinSuccess(c, &apistruct.NewUserCountResp{ + DateCount: dateCount, + Total: total, + }) } -func (o *AdminApi) ImportUserByXlsx(c *gin.Context) { +func (o *Api) ImportUserByXlsx(c *gin.Context) { formFile, err := c.FormFile("data") if err != nil { apiresp.GinError(c, err) return } - ip, err := o.getClientIP(c) + ip, err := o.GetClientIP(c) if err != nil { apiresp.GinError(c, err) return } - secret := c.PostForm("secret") - if err := o.checkSecretAdmin(c, secret); err != nil { - apiresp.GinError(c, err) - return - } file, err := formFile.Open() if err != nil { apiresp.GinError(c, err) @@ -475,7 +407,7 @@ func (o *AdminApi) ImportUserByXlsx(c *gin.Context) { defer file.Close() var users []model.User if err := xlsx.ParseAll(file, &users); err != nil { - apiresp.GinError(c, errs.ErrArgs.Wrap("xlsx file parse error "+err.Error())) + apiresp.GinError(c, errs.ErrArgs.WrapMsg("xlsx file parse error "+err.Error())) return } us, err := o.xlsx2user(users) @@ -489,25 +421,20 @@ func (o *AdminApi) ImportUserByXlsx(c *gin.Context) { return } - ctx := mctx.WithAdminUser(mctx.WithApiToken(c, imToken)) + ctx := o.WithAdminUser(mctx.WithApiToken(c, imToken)) apiresp.GinError(c, o.registerChatUser(ctx, ip, us)) } -func (o *AdminApi) ImportUserByJson(c *gin.Context) { - var req struct { - Secret string `json:"secret"` - Users []*chat.RegisterUserInfo `json:"users"` - } - if err := c.BindJSON(&req); err != nil { - apiresp.GinError(c, err) - return - } - ip, err := o.getClientIP(c) +func (o *Api) ImportUserByJson(c *gin.Context) { + req, err := a2r.ParseRequest[struct { + Users []*chat.RegisterUserInfo `json:"users"` + }](c) if err != nil { apiresp.GinError(c, err) return } - if err := o.checkSecretAdmin(c, req.Secret); err != nil { + ip, err := o.GetClientIP(c) + if err != nil { apiresp.GinError(c, err) return } @@ -516,27 +443,27 @@ func (o *AdminApi) ImportUserByJson(c *gin.Context) { apiresp.GinError(c, err) return } - ctx := mctx.WithAdminUser(mctx.WithApiToken(c, imToken)) + ctx := o.WithAdminUser(mctx.WithApiToken(c, imToken)) apiresp.GinError(c, o.registerChatUser(ctx, ip, req.Users)) } -func (o *AdminApi) xlsx2user(users []model.User) ([]*chat.RegisterUserInfo, error) { +func (o *Api) xlsx2user(users []model.User) ([]*chat.RegisterUserInfo, error) { chatUsers := make([]*chat.RegisterUserInfo, len(users)) for i, info := range users { if info.Nickname == "" { - return nil, errs.ErrArgs.Wrap("nickname is empty") + return nil, errs.ErrArgs.WrapMsg("nickname is empty") } if info.AreaCode == "" || info.PhoneNumber == "" { - return nil, errs.ErrArgs.Wrap("areaCode or phoneNumber is empty") + return nil, errs.ErrArgs.WrapMsg("areaCode or phoneNumber is empty") } if info.Password == "" { - return nil, errs.ErrArgs.Wrap("password is empty") + return nil, errs.ErrArgs.WrapMsg("password is empty") } if !strings.HasPrefix(info.AreaCode, "+") { - return nil, errs.ErrArgs.Wrap("areaCode format error") + return nil, errs.ErrArgs.WrapMsg("areaCode format error") } if _, err := strconv.ParseUint(info.AreaCode[1:], 10, 16); err != nil { - return nil, errs.ErrArgs.Wrap("areaCode format error") + return nil, errs.ErrArgs.WrapMsg("areaCode format error") } gender, _ := strconv.Atoi(info.Gender) chatUsers[i] = &chat.RegisterUserInfo{ @@ -549,13 +476,13 @@ func (o *AdminApi) xlsx2user(users []model.User) ([]*chat.RegisterUserInfo, erro PhoneNumber: info.PhoneNumber, Email: info.Email, Account: info.Account, - Password: utils.Md5(info.Password), + Password: encrypt.Md5(info.Password), } } return chatUsers, nil } -func (o *AdminApi) xlsxBirth(s string) time.Time { +func (o *Api) xlsxBirth(s string) time.Time { if s == "" { return time.Now() } @@ -579,9 +506,9 @@ func (o *AdminApi) xlsxBirth(s string) time.Time { return t } -func (o *AdminApi) registerChatUser(ctx context.Context, ip string, users []*chat.RegisterUserInfo) error { +func (o *Api) registerChatUser(ctx context.Context, ip string, users []*chat.RegisterUserInfo) error { if len(users) == 0 { - return errs.ErrArgs.Wrap("users is empty") + return errs.ErrArgs.WrapMsg("users is empty") } for _, info := range users { respRegisterUser, err := o.chatClient.RegisterUser(ctx, &chat.RegisterUserReq{Ip: ip, User: info, Platform: constant.AdminPlatformID}) @@ -606,7 +533,7 @@ func (o *AdminApi) registerChatUser(ctx context.Context, ip string, users []*cha return nil } -func (o *AdminApi) BatchImportTemplate(c *gin.Context) { +func (o *Api) BatchImportTemplate(c *gin.Context) { md5Sum := md5.Sum(config.ImportTemplate) md5Val := hex.EncodeToString(md5Sum[:]) if c.GetHeader("If-None-Match") == md5Val { diff --git a/internal/api/router.go b/internal/api/admin/start.go similarity index 55% rename from internal/api/router.go rename to internal/api/admin/start.go index 550efcbfe..8dd06d636 100644 --- a/internal/api/router.go +++ b/internal/api/admin/start.go @@ -1,87 +1,68 @@ -// Copyright © 2023 OpenIM open source community. 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 admin import ( "context" "fmt" - "os" - - "github.com/OpenIMSDK/chat/example/callback" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/gin-gonic/gin" + chatmw "github.com/openimsdk/chat/internal/api/mw" + "github.com/openimsdk/chat/internal/api/util" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/imapi" + "github.com/openimsdk/chat/pkg/common/kdisc" + adminclient "github.com/openimsdk/chat/pkg/protocol/admin" + chatclient "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/mw" + "github.com/openimsdk/tools/utils/datautil" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) -func NewChatRoute(router gin.IRouter, discov discoveryregistry.SvcDiscoveryRegistry) { - chatConn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImChatName) +type Config struct { + ApiConfig config.API + ZookeeperConfig config.ZooKeeper + Share config.Share +} + +func Start(ctx context.Context, index int, config *Config) error { + if len(config.Share.ChatAdmin) == 0 { + return errs.New("share chat admin not configured") + } + apiPort, err := datautil.GetElemByIndex(config.ApiConfig.Api.Ports, index) if err != nil { - fmt.Printf("\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) + return err } - adminConn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAdminName) + client, err := kdisc.NewDiscoveryRegister(&config.ZookeeperConfig, &config.Share) if err != nil { - fmt.Printf("\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) + return err } - mw := NewMW(adminConn) - chat := NewChat(chatConn, adminConn) - account := router.Group("/account") - account.POST("/code/send", chat.SendVerifyCode) // Send verification code - account.POST("/code/verify", chat.VerifyCode) // Verify the verification code - account.POST("/register", mw.CheckAdminOrNil, chat.RegisterUser) // Register - account.POST("/login", chat.Login) // Login - account.POST("/password/reset", chat.ResetPassword) // Forgot password - account.POST("/password/change", mw.CheckToken, chat.ChangePassword) // Change password - - user := router.Group("/user", mw.CheckToken) - user.POST("/update", chat.UpdateUserInfo) // Edit personal information - user.POST("/find/public", chat.FindUserPublicInfo) // Get user's public information - user.POST("/find/full", chat.FindUserFullInfo) // Get all information of the user - user.POST("/search/full", chat.SearchUserFullInfo) // Search user's public information - user.POST("/search/public", chat.SearchUserPublicInfo) // Search all information of the user - user.POST("/rtc/get_token", chat.GetTokenForVideoMeeting) // Get token for video meeting for the user - - router.POST("/friend/search", mw.CheckToken, chat.SearchFriend) - - router.Group("/applet").POST("/find", mw.CheckToken, chat.FindApplet) // Applet list - - router.Group("/client_config").POST("/get", chat.GetClientConfig) // Get client initialization configuration - - router.Group("/callback").POST("/open_im", chat.OpenIMCallback) // Callback - - router.Group("/callbackExample").POST("/callbackAfterSendSingleMsgCommand", callback.CallbackExample) - - logs := router.Group("/logs", mw.CheckToken) - logs.POST("/upload", chat.UploadLogs) -} - -func NewAdminRoute(router gin.IRouter, discov discoveryregistry.SvcDiscoveryRegistry) { - adminConn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAdminName) + chatConn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Chat, grpc.WithTransportCredentials(insecure.NewCredentials()), mw.GrpcClient()) if err != nil { - fmt.Printf("\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) + return err } - chatConn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImChatName) + adminConn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Admin, grpc.WithTransportCredentials(insecure.NewCredentials()), mw.GrpcClient()) if err != nil { - fmt.Printf("\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) + return err } - mw := NewMW(adminConn) - admin := NewAdmin(chatConn, adminConn) + chatClient := chatclient.NewChatClient(chatConn) + adminClient := adminclient.NewAdminClient(adminConn) + im := imapi.New(config.Share.OpenIM.ApiURL, config.Share.OpenIM.Secret, config.Share.OpenIM.AdminUserID) + base := util.Api{ + ImUserID: config.Share.OpenIM.AdminUserID, + ProxyHeader: config.Share.ProxyHeader, + ChatAdminUserID: config.Share.ChatAdmin[0].AdminID, + } + adminApi := New(chatClient, adminClient, im, &base) + mwApi := chatmw.New(adminClient) + gin.SetMode(gin.ReleaseMode) + engine := gin.Default() + engine.Use(mw.CorsHandler(), mw.GinParseOperationID()) + SetAdminRoute(engine, adminApi, mwApi) + return engine.Run(fmt.Sprintf(":%d", apiPort)) +} + +func SetAdminRoute(router gin.IRouter, admin *Api, mw *chatmw.MW) { + adminRouterGroup := router.Group("/account") adminRouterGroup.POST("/login", admin.AdminLogin) // Login adminRouterGroup.POST("/update", mw.CheckAdmin, admin.AdminUpdateInfo) // Modify information @@ -94,8 +75,8 @@ func NewAdminRoute(router gin.IRouter, discov discoveryregistry.SvcDiscoveryRegi //account.POST("/add_notification_account") importGroup := router.Group("/user/import") - importGroup.POST("/json", mw.CheckAdminOrNil, admin.ImportUserByJson) - importGroup.POST("/xlsx", mw.CheckAdminOrNil, admin.ImportUserByXlsx) + importGroup.POST("/json", mw.CheckAdmin, admin.ImportUserByJson) + importGroup.POST("/xlsx", mw.CheckAdmin, admin.ImportUserByXlsx) importGroup.GET("/xlsx", admin.BatchImportTemplate) defaultRouter := router.Group("/default", mw.CheckAdmin) @@ -148,8 +129,4 @@ func NewAdminRoute(router gin.IRouter, discov discoveryregistry.SvcDiscoveryRegi statistic := router.Group("/statistic", mw.CheckAdmin) statistic.POST("/new_user_count", admin.NewUserCount) statistic.POST("/login_user_count", admin.LoginUserCount) - - logs := router.Group("/logs", mw.CheckAdmin) - logs.POST("/search", admin.SearchLogs) - logs.POST("/delete", admin.DeleteLogs) } diff --git a/internal/api/chat.go b/internal/api/chat/chat.go similarity index 57% rename from internal/api/chat.go rename to internal/api/chat/chat.go index 7b8cf14bf..b8bb05bf9 100644 --- a/internal/api/chat.go +++ b/internal/api/chat/chat.go @@ -12,58 +12,58 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package chat import ( - "fmt" + "github.com/openimsdk/chat/internal/api/util" "io" - "net" "time" - "github.com/OpenIMSDK/chat/pkg/common/apicall" - "github.com/OpenIMSDK/chat/pkg/common/apistruct" - constant2 "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/a2r" - "github.com/OpenIMSDK/tools/apiresp" - "github.com/OpenIMSDK/tools/checker" - "github.com/OpenIMSDK/tools/errs" "github.com/gin-gonic/gin" - "google.golang.org/grpc" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/chat" + "github.com/openimsdk/chat/pkg/common/apistruct" + chatconstant "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/imapi" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/a2r" + "github.com/openimsdk/tools/apiresp" + "github.com/openimsdk/tools/errs" ) -func NewChat(chatConn, adminConn grpc.ClientConnInterface) *ChatApi { - return &ChatApi{chatClient: chat.NewChatClient(chatConn), adminClient: admin.NewAdminClient(adminConn), imApiCaller: apicall.NewCallerInterface()} +func New(chatClient chat.ChatClient, adminClient admin.AdminClient, imApiCaller imapi.CallerInterface, api *util.Api) *Api { + return &Api{ + Api: api, + chatClient: chatClient, + adminClient: adminClient, + imApiCaller: imApiCaller, + } } -type ChatApi struct { +type Api struct { + *util.Api chatClient chat.ChatClient adminClient admin.AdminClient - imApiCaller apicall.CallerInterface + imApiCaller imapi.CallerInterface } // ################## ACCOUNT ################## -func (o *ChatApi) SendVerifyCode(c *gin.Context) { - req := chat.SendVerifyCodeReq{} - - if err := c.BindJSON(&req); err != nil { +func (o *Api) SendVerifyCode(c *gin.Context) { + req, err := a2r.ParseRequest[chat.SendVerifyCodeReq](c) + if err != nil { apiresp.GinError(c, err) return } - ip, err := o.getClientIP(c) + ip, err := o.GetClientIP(c) if err != nil { apiresp.GinError(c, err) return } req.Ip = ip - resp, err := o.chatClient.SendVerifyCode(c, &req) + resp, err := o.chatClient.SendVerifyCode(c, req) if err != nil { apiresp.GinError(c, err) return @@ -71,30 +71,23 @@ func (o *ChatApi) SendVerifyCode(c *gin.Context) { apiresp.GinSuccess(c, resp) } -func (o *ChatApi) VerifyCode(c *gin.Context) { +func (o *Api) VerifyCode(c *gin.Context) { a2r.Call(chat.ChatClient.VerifyCode, o.chatClient, c) } -func (o *ChatApi) RegisterUser(c *gin.Context) { - var ( - req chat.RegisterUserReq - resp apistruct.UserRegisterResp - ) - if err := c.BindJSON(&req); err != nil { +func (o *Api) RegisterUser(c *gin.Context) { + req, err := a2r.ParseRequest[chat.RegisterUserReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - ip, err := o.getClientIP(c) + ip, err := o.GetClientIP(c) if err != nil { apiresp.GinError(c, err) return } req.Ip = ip - respRegisterUser, err := o.chatClient.RegisterUser(c, &req) + respRegisterUser, err := o.chatClient.RegisterUser(c, req) if err != nil { apiresp.GinError(c, err) return @@ -116,13 +109,14 @@ func (o *ChatApi) RegisterUser(c *gin.Context) { return } apiCtx := mctx.WithApiToken(c, imToken) - rpcCtx := mctx.WithAdminUser(c) + rpcCtx := o.WithAdminUser(c) if resp, err := o.adminClient.FindDefaultFriend(rpcCtx, &admin.FindDefaultFriendReq{}); err == nil { _ = o.imApiCaller.ImportFriend(apiCtx, respRegisterUser.UserID, resp.UserIDs) } if resp, err := o.adminClient.FindDefaultGroup(rpcCtx, &admin.FindDefaultGroupReq{}); err == nil { _ = o.imApiCaller.InviteToGroup(apiCtx, respRegisterUser.UserID, resp.GroupIDs) } + var resp apistruct.UserRegisterResp if req.AutoLogin { resp.ImToken, err = o.imApiCaller.UserToken(c, respRegisterUser.UserID, req.Platform) if err != nil { @@ -135,65 +129,52 @@ func (o *ChatApi) RegisterUser(c *gin.Context) { apiresp.GinSuccess(c, &resp) } -func (o *ChatApi) Login(c *gin.Context) { - var ( - req chat.LoginReq - resp apistruct.LoginResp - ) - if err := c.BindJSON(&req); err != nil { +func (o *Api) Login(c *gin.Context) { + req, err := a2r.ParseRequest[chat.LoginReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - ip, err := o.getClientIP(c) + ip, err := o.GetClientIP(c) if err != nil { apiresp.GinError(c, err) return } req.Ip = ip - resp1, err := o.chatClient.Login(c, &req) + resp, err := o.chatClient.Login(c, req) if err != nil { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.UserToken(c, resp1.UserID, req.Platform) + imToken, err := o.imApiCaller.UserToken(c, resp.UserID, req.Platform) if err != nil { apiresp.GinError(c, err) return } - resp.ImToken = imToken - resp.UserID = resp1.UserID - resp.ChatToken = resp1.ChatToken - apiresp.GinSuccess(c, resp) + apiresp.GinSuccess(c, &apistruct.LoginResp{ + ImToken: imToken, + UserID: resp.UserID, + ChatToken: resp.ChatToken, + }) } -func (o *ChatApi) ResetPassword(c *gin.Context) { +func (o *Api) ResetPassword(c *gin.Context) { a2r.Call(chat.ChatClient.ResetPassword, o.chatClient, c) } -func (o *ChatApi) ChangePassword(c *gin.Context) { +func (o *Api) ChangePassword(c *gin.Context) { a2r.Call(chat.ChatClient.ChangePassword, o.chatClient, c) } // ################## USER ################## -func (o *ChatApi) UpdateUserInfo(c *gin.Context) { - var ( - req chat.UpdateUserInfoReq - resp apistruct.UpdateUserInfoResp - ) - if err := c.BindJSON(&req); err != nil { +func (o *Api) UpdateUserInfo(c *gin.Context) { + req, err := a2r.ParseRequest[chat.UpdateUserInfoReq](c) + if err != nil { apiresp.GinError(c, err) return } - if err := checker.Validate(&req); err != nil { - apiresp.GinError(c, err) // 参数校验失败 - return - } - respUpdate, err := o.chatClient.UpdateUserInfo(c, &req) + respUpdate, err := o.chatClient.UpdateUserInfo(c, req) if err != nil { apiresp.GinError(c, err) return @@ -204,12 +185,12 @@ func (o *ChatApi) UpdateUserInfo(c *gin.Context) { return } var imToken string - if opUserType == constant2.NormalUser { + if opUserType == chatconstant.NormalUser { imToken, err = o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) - } else if opUserType == constant2.AdminUser { - imToken, err = o.imApiCaller.UserToken(c, config.GetIMAdmin(mctx.GetOpUserID(c)), constant.AdminPlatformID) + } else if opUserType == chatconstant.AdminUser { + imToken, err = o.imApiCaller.UserToken(c, o.GetDefaultIMAdminUserID(), constant.AdminPlatformID) } else { - apiresp.GinError(c, errs.ErrArgs.Wrap("opUserType unknown")) + apiresp.GinError(c, errs.ErrArgs.WrapMsg("opUserType unknown")) return } if err != nil { @@ -235,44 +216,44 @@ func (o *ChatApi) UpdateUserInfo(c *gin.Context) { apiresp.GinError(c, err) return } - apiresp.GinSuccess(c, resp) + apiresp.GinSuccess(c, apistruct.UpdateUserInfoResp{}) } -func (o *ChatApi) FindUserPublicInfo(c *gin.Context) { +func (o *Api) FindUserPublicInfo(c *gin.Context) { a2r.Call(chat.ChatClient.FindUserPublicInfo, o.chatClient, c) } -func (o *ChatApi) FindUserFullInfo(c *gin.Context) { +func (o *Api) FindUserFullInfo(c *gin.Context) { a2r.Call(chat.ChatClient.FindUserFullInfo, o.chatClient, c) } -func (o *ChatApi) SearchUserFullInfo(c *gin.Context) { +func (o *Api) SearchUserFullInfo(c *gin.Context) { a2r.Call(chat.ChatClient.SearchUserFullInfo, o.chatClient, c) } -func (o *ChatApi) SearchUserPublicInfo(c *gin.Context) { +func (o *Api) SearchUserPublicInfo(c *gin.Context) { a2r.Call(chat.ChatClient.SearchUserPublicInfo, o.chatClient, c) } -func (o *ChatApi) GetTokenForVideoMeeting(c *gin.Context) { +func (o *Api) GetTokenForVideoMeeting(c *gin.Context) { a2r.Call(chat.ChatClient.GetTokenForVideoMeeting, o.chatClient, c) } // ################## APPLET ################## -func (o *ChatApi) FindApplet(c *gin.Context) { +func (o *Api) FindApplet(c *gin.Context) { a2r.Call(admin.AdminClient.FindApplet, o.adminClient, c) } // ################## CONFIG ################## -func (o *ChatApi) GetClientConfig(c *gin.Context) { +func (o *Api) GetClientConfig(c *gin.Context) { a2r.Call(admin.AdminClient.GetClientConfig, o.adminClient, c) } // ################## CALLBACK ################## -func (o *ChatApi) OpenIMCallback(c *gin.Context) { +func (o *Api) OpenIMCallback(c *gin.Context) { body, err := io.ReadAll(c.Request.Body) if err != nil { apiresp.GinError(c, err) @@ -289,31 +270,12 @@ func (o *ChatApi) OpenIMCallback(c *gin.Context) { apiresp.GinSuccess(c, nil) } -func (o *ChatApi) getClientIP(c *gin.Context) (string, error) { - if config.Config.ProxyHeader == "" { - ip, _, err := net.SplitHostPort(c.Request.RemoteAddr) - return ip, err - } - ip := c.Request.Header.Get(config.Config.ProxyHeader) - if ip == "" { - return "", errs.ErrInternalServer.Wrap() - } - if ip := net.ParseIP(ip); ip == nil { - return "", errs.ErrInternalServer.Wrap(fmt.Sprintf("parse proxy ip header %s failed", ip)) - } - return ip, nil -} - -func (o *ChatApi) UploadLogs(c *gin.Context) { - a2r.Call(chat.ChatClient.UploadLogs, o.chatClient, c) -} - -func (o *ChatApi) SearchFriend(c *gin.Context) { - var req struct { +func (o *Api) SearchFriend(c *gin.Context) { + req, err := a2r.ParseRequest[struct { UserID string `json:"userID"` chat.SearchUserInfoReq - } - if err := c.BindJSON(&req); err != nil { + }](c) + if err != nil { apiresp.GinError(c, err) return } diff --git a/internal/api/chat/start.go b/internal/api/chat/start.go new file mode 100644 index 000000000..2b003e10e --- /dev/null +++ b/internal/api/chat/start.go @@ -0,0 +1,88 @@ +package chat + +import ( + "context" + "fmt" + "github.com/gin-gonic/gin" + chatmw "github.com/openimsdk/chat/internal/api/mw" + "github.com/openimsdk/chat/internal/api/util" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/imapi" + "github.com/openimsdk/chat/pkg/common/kdisc" + adminclient "github.com/openimsdk/chat/pkg/protocol/admin" + chatclient "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/mw" + "github.com/openimsdk/tools/utils/datautil" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type Config struct { + ApiConfig config.API + ZookeeperConfig config.ZooKeeper + Share config.Share +} + +func Start(ctx context.Context, index int, config *Config) error { + if len(config.Share.ChatAdmin) == 0 { + return errs.New("share chat admin not configured") + } + apiPort, err := datautil.GetElemByIndex(config.ApiConfig.Api.Ports, index) + if err != nil { + return err + } + client, err := kdisc.NewDiscoveryRegister(&config.ZookeeperConfig, &config.Share) + if err != nil { + return err + } + chatConn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Chat, grpc.WithTransportCredentials(insecure.NewCredentials()), mw.GrpcClient()) + if err != nil { + return err + } + adminConn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Admin, grpc.WithTransportCredentials(insecure.NewCredentials()), mw.GrpcClient()) + if err != nil { + return err + } + chatClient := chatclient.NewChatClient(chatConn) + adminClient := adminclient.NewAdminClient(adminConn) + im := imapi.New(config.Share.OpenIM.ApiURL, config.Share.OpenIM.Secret, config.Share.OpenIM.AdminUserID) + base := util.Api{ + ImUserID: config.Share.OpenIM.AdminUserID, + ProxyHeader: config.Share.ProxyHeader, + ChatAdminUserID: config.Share.ChatAdmin[0].AdminID, + } + adminApi := New(chatClient, adminClient, im, &base) + mwApi := chatmw.New(adminClient) + gin.SetMode(gin.ReleaseMode) + engine := gin.Default() + engine.Use(mw.CorsHandler(), mw.GinParseOperationID()) + SetChatRoute(engine, adminApi, mwApi) + return engine.Run(fmt.Sprintf(":%d", apiPort)) +} + +func SetChatRoute(router gin.IRouter, chat *Api, mw *chatmw.MW) { + account := router.Group("/account") + account.POST("/code/send", chat.SendVerifyCode) // Send verification code + account.POST("/code/verify", chat.VerifyCode) // Verify the verification code + account.POST("/register", mw.CheckAdminOrNil, chat.RegisterUser) // Register + account.POST("/login", chat.Login) // Login + account.POST("/password/reset", chat.ResetPassword) // Forgot password + account.POST("/password/change", mw.CheckToken, chat.ChangePassword) // Change password + + user := router.Group("/user", mw.CheckToken) + user.POST("/update", chat.UpdateUserInfo) // Edit personal information + user.POST("/find/public", chat.FindUserPublicInfo) // Get user's public information + user.POST("/find/full", chat.FindUserFullInfo) // Get all information of the user + user.POST("/search/full", chat.SearchUserFullInfo) // Search user's public information + user.POST("/search/public", chat.SearchUserPublicInfo) // Search all information of the user + user.POST("/rtc/get_token", chat.GetTokenForVideoMeeting) // Get token for video meeting for the user + + router.POST("/friend/search", mw.CheckToken, chat.SearchFriend) + + router.Group("/applet").POST("/find", mw.CheckToken, chat.FindApplet) // Applet list + + router.Group("/client_config").POST("/get", chat.GetClientConfig) // Get client initialization configuration + + router.Group("/callback").POST("/open_im", chat.OpenIMCallback) // Callback +} diff --git a/internal/api/mw.go b/internal/api/mw/mw.go similarity index 75% rename from internal/api/mw.go rename to internal/api/mw/mw.go index 755600363..84375163e 100644 --- a/internal/api/mw.go +++ b/internal/api/mw/mw.go @@ -12,24 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package mw import ( "strconv" - "github.com/OpenIMSDK/chat/pkg/common/constant" - constant2 "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/apiresp" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" "github.com/gin-gonic/gin" - "google.golang.org/grpc" - - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/protocol/admin" + constant2 "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/apiresp" + "github.com/openimsdk/tools/errs" ) -func NewMW(adminConn grpc.ClientConnInterface) *MW { - return &MW{client: admin.NewAdminClient(adminConn)} +func New(client admin.AdminClient) *MW { + return &MW{client: client} } type MW struct { @@ -39,7 +36,7 @@ type MW struct { func (o *MW) parseToken(c *gin.Context) (string, int32, string, error) { token := c.GetHeader("token") if token == "" { - return "", 0, "", errs.ErrArgs.Wrap("token is empty") + return "", 0, "", errs.ErrArgs.WrapMsg("token is empty") } resp, err := o.client.ParseToken(c, &admin.ParseTokenReq{Token: token}) if err != nil { @@ -54,34 +51,29 @@ func (o *MW) parseTokenType(c *gin.Context, userType int32) (string, string, err return "", "", err } if t != userType { - return "", "", errs.ErrArgs.Wrap("token type error") + return "", "", errs.ErrArgs.WrapMsg("token type error") } return userID, token, nil } func (o *MW) isValidToken(c *gin.Context, userID string, token string) error { resp, err := o.client.GetUserToken(c, &admin.GetUserTokenReq{UserID: userID}) - m := resp.TokensMap if err != nil { - log.ZWarn(c, "cache get token error", errs.ErrTokenNotExist.Wrap()) return err } - if len(m) == 0 { - log.ZWarn(c, "cache do not exist token error", errs.ErrTokenNotExist.Wrap()) - return errs.ErrTokenNotExist.Wrap() + if len(resp.TokensMap) == 0 { + return errs.ErrTokenExpired.Wrap() } - if v, ok := m[token]; ok { + if v, ok := resp.TokensMap[token]; ok { switch v { case constant2.NormalToken: case constant2.KickedToken: - log.ZWarn(c, "cache kicked token error", errs.ErrTokenKicked.Wrap()) - return errs.ErrTokenKicked.Wrap() + return errs.ErrTokenExpired.Wrap() default: - log.ZWarn(c, "cache unknown token error", errs.ErrTokenUnknown.Wrap()) - return err + return errs.ErrTokenUnknown.Wrap() } } else { - return errs.ErrTokenNotExist.Wrap() + return errs.ErrTokenExpired.Wrap() } return nil } diff --git a/internal/api/util/api.go b/internal/api/util/api.go new file mode 100644 index 000000000..6d75268b9 --- /dev/null +++ b/internal/api/util/api.go @@ -0,0 +1,39 @@ +package util + +import ( + "context" + "fmt" + "github.com/gin-gonic/gin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/tools/errs" + "net" +) + +type Api struct { + ImUserID string + ProxyHeader string + ChatAdminUserID string +} + +func (o *Api) WithAdminUser(ctx context.Context) context.Context { + return mctx.WithAdminUser(ctx, o.ChatAdminUserID) +} + +func (o *Api) GetClientIP(c *gin.Context) (string, error) { + if o.ProxyHeader == "" { + ip, _, err := net.SplitHostPort(c.Request.RemoteAddr) + return ip, err + } + ip := c.Request.Header.Get(o.ProxyHeader) + if ip == "" { + return "", errs.ErrInternalServer.Wrap() + } + if ip := net.ParseIP(ip); ip == nil { + return "", errs.ErrInternalServer.WrapMsg(fmt.Sprintf("parse proxy ip header %s failed", ip)) + } + return ip, nil +} + +func (o *Api) GetDefaultIMAdminUserID() string { + return o.ImUserID +} diff --git a/internal/rpc/admin/admin.go b/internal/rpc/admin/admin.go index d0666eadd..7bf2171c1 100644 --- a/internal/rpc/admin/admin.go +++ b/internal/rpc/admin/admin.go @@ -17,60 +17,20 @@ package admin import ( "context" "fmt" - "github.com/OpenIMSDK/chat/pkg/common/db/cache" - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/tools/utils" - "google.golang.org/grpc" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/mcontext" + "github.com/openimsdk/tools/utils/datautil" "math/rand" "time" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/db/database" - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/dbconn" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/rpclient/chat" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/admin" ) -func Start(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { - db, err := dbconn.NewMongo() - if err != nil { - return err - } - rdb, err := cache.NewRedis() - if err != nil { - return errs.Wrap(err) - } - - adminDatabase, err := database.NewAdminDatabase(db, rdb) - if err != nil { - return err - } - - if err := adminDatabase.InitAdmin(context.Background()); err != nil { - return err - } - if err := discov.CreateRpcRootNodes([]string{config.Config.RpcRegisterName.OpenImAdminName, config.Config.RpcRegisterName.OpenImChatName}); err != nil { - return errs.Wrap(err, "CreateRpcRootNodes error") - } - - admin.RegisterAdminServer(server, &adminServer{Database: adminDatabase, - Chat: chat.NewChatClient(discov), - }) - return nil -} - -type adminServer struct { - Database database.AdminDatabaseInterface - Chat *chat.ChatClient -} - func (o *adminServer) GetAdminInfo(ctx context.Context, req *admin.GetAdminInfoReq) (*admin.GetAdminInfoResp, error) { userID, err := mctx.CheckAdmin(ctx) if err != nil { @@ -98,7 +58,7 @@ func (o *adminServer) ChangeAdminPassword(ctx context.Context, req *admin.Change } if user.Password != req.CurrentPassword { - return nil, errs.ErrInternalServer.Wrap("password error") + return nil, errs.ErrInternalServer.WrapMsg("password error") } if err := o.Database.ChangePassword(ctx, req.UserID, req.NewPassword); err != nil { @@ -114,7 +74,7 @@ func (o *adminServer) AddAdminAccount(ctx context.Context, req *admin.AddAdminAc _, err := o.Database.GetAdmin(ctx, req.Account) if err == nil { - return nil, errs.ErrRegisteredAlready.Wrap("the account is registered") + return nil, errs.ErrDuplicateKey.WrapMsg("the account is registered") } adm := &admin2.Admin{ @@ -137,8 +97,8 @@ func (o *adminServer) DelAdminAccount(ctx context.Context, req *admin.DelAdminAc return nil, err } - if utils.Duplicate(req.UserIDs) { - return nil, errs.ErrArgs.Wrap("user ids is duplicate") + if datautil.Duplicate(req.UserIDs) { + return nil, errs.ErrArgs.WrapMsg("user ids is duplicate") } for _, userID := range req.UserIDs { @@ -147,8 +107,7 @@ func (o *adminServer) DelAdminAccount(ctx context.Context, req *admin.DelAdminAc return nil, err } if superAdmin.Level == constant.AdvancedUserLevel { - str := fmt.Sprintf("%s is superAdminID", userID) - return nil, errs.ErrNoPermission.Wrap(str) + return nil, errs.ErrNoPermission.WrapMsg(fmt.Sprintf("%s is superAdminID", userID)) } } @@ -205,7 +164,7 @@ func (o *adminServer) AdminUpdateInfo(ctx context.Context, req *admin.AdminUpdat resp.Nickname = req.Nickname.Value } if req.FaceURL == nil { - resp.Nickname = info.FaceURL + resp.FaceURL = info.FaceURL } else { resp.FaceURL = req.FaceURL.Value } diff --git a/internal/rpc/admin/applet.go b/internal/rpc/admin/applet.go index 4ce22e95e..1e09c5651 100644 --- a/internal/rpc/admin/applet.go +++ b/internal/rpc/admin/applet.go @@ -16,18 +16,18 @@ package admin import ( "context" + "github.com/openimsdk/tools/utils/datautil" "strings" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" "github.com/google/uuid" + "github.com/openimsdk/tools/errs" - "github.com/OpenIMSDK/chat/pkg/common/constant" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/common" + "github.com/openimsdk/chat/pkg/common/constant" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/common" ) func (o *adminServer) AddApplet(ctx context.Context, req *admin.AddAppletReq) (*admin.AddAppletResp, error) { @@ -35,13 +35,13 @@ func (o *adminServer) AddApplet(ctx context.Context, req *admin.AddAppletReq) (* return nil, err } if req.Name == "" { - return nil, errs.ErrArgs.Wrap("name empty") + return nil, errs.ErrArgs.WrapMsg("name empty") } if req.AppID == "" { - return nil, errs.ErrArgs.Wrap("appid empty") + return nil, errs.ErrArgs.WrapMsg("appid empty") } if !(req.Status == constant.StatusOnShelf || req.Status == constant.StatusUnShelf) { - return nil, errs.ErrArgs.Wrap("invalid status") + return nil, errs.ErrArgs.WrapMsg("invalid status") } m := admin2.Applet{ ID: req.Id, @@ -70,14 +70,14 @@ func (o *adminServer) DelApplet(ctx context.Context, req *admin.DelAppletReq) (* return nil, err } if len(req.AppletIds) == 0 { - return nil, errs.ErrArgs.Wrap("AppletIds empty") + return nil, errs.ErrArgs.WrapMsg("AppletIds empty") } applets, err := o.Database.FindApplet(ctx, req.AppletIds) if err != nil { return nil, err } - if ids := utils.Single(req.AppletIds, utils.Slice(applets, func(e *admin2.Applet) string { return e.ID })); len(ids) > 0 { - return nil, errs.ErrArgs.Wrap("ids not found: " + strings.Join(ids, ", ")) + if ids := datautil.Single(req.AppletIds, datautil.Slice(applets, func(e *admin2.Applet) string { return e.ID })); len(ids) > 0 { + return nil, errs.ErrArgs.WrapMsg("ids not found: " + strings.Join(ids, ", ")) } if err := o.Database.DelApplet(ctx, req.AppletIds); err != nil { return nil, err diff --git a/internal/rpc/admin/check.go b/internal/rpc/admin/check.go index d357b84f8..5b15c9b6e 100644 --- a/internal/rpc/admin/check.go +++ b/internal/rpc/admin/check.go @@ -16,11 +16,9 @@ package admin import ( "context" - "fmt" - - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) CheckRegisterForbidden(ctx context.Context, req *admin.CheckRegisterForbiddenReq) (*admin.CheckRegisterForbiddenResp, error) { @@ -43,7 +41,7 @@ func (o *adminServer) CheckLoginForbidden(ctx context.Context, req *admin.CheckL } for _, forbidden := range forbiddens { if forbidden.LimitLogin { - return nil, eerrs.ErrForbidden.Wrap("ip forbidden") + return nil, eerrs.ErrForbidden.WrapMsg("ip forbidden") } } if _, err := o.Database.GetLimitUserLoginIP(ctx, req.UserID, req.Ip); err != nil { @@ -55,11 +53,11 @@ func (o *adminServer) CheckLoginForbidden(ctx context.Context, req *admin.CheckL return nil, err } if count > 0 { - return nil, eerrs.ErrForbidden.Wrap("user ip forbidden") + return nil, eerrs.ErrForbidden.WrapMsg("user ip forbidden") } } if forbiddenAccount, err := o.Database.GetBlockInfo(ctx, req.UserID); err == nil { - return nil, eerrs.ErrForbidden.Wrap(fmt.Sprintf("account forbidden: %s", forbiddenAccount.Reason)) + return nil, eerrs.ErrForbidden.WrapMsg("account forbidden", "reason", forbiddenAccount.Reason) } else if !dbutil.IsDBNotFound(err) { return nil, err } diff --git a/internal/rpc/admin/client_config.go b/internal/rpc/admin/client_config.go index 53e3bf6ff..6cb80cbd0 100644 --- a/internal/rpc/admin/client_config.go +++ b/internal/rpc/admin/client_config.go @@ -17,10 +17,10 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) GetClientConfig(ctx context.Context, req *admin.GetClientConfigReq) (*admin.GetClientConfigResp, error) { @@ -36,7 +36,7 @@ func (o *adminServer) SetClientConfig(ctx context.Context, req *admin.SetClientC return nil, err } if len(req.Config) == 0 { - return nil, errs.ErrArgs.Wrap("update config empty") + return nil, errs.ErrArgs.WrapMsg("update config empty") } if err := o.Database.SetConfig(ctx, req.Config); err != nil { return nil, err diff --git a/internal/rpc/admin/invitation.go b/internal/rpc/admin/invitation.go index 903094f84..11aac3bbf 100644 --- a/internal/rpc/admin/invitation.go +++ b/internal/rpc/admin/invitation.go @@ -16,17 +16,17 @@ package admin import ( "context" + "github.com/openimsdk/tools/utils/datautil" "math/rand" "strings" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/tools/errs" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) AddInvitationCode(ctx context.Context, req *admin.AddInvitationCodeReq) (*admin.AddInvitationCodeResp, error) { @@ -34,18 +34,18 @@ func (o *adminServer) AddInvitationCode(ctx context.Context, req *admin.AddInvit return nil, err } if len(req.Codes) == 0 { - return nil, errs.ErrArgs.Wrap("codes is empty") + return nil, errs.ErrArgs.WrapMsg("codes is empty") } - if utils.Duplicate(req.Codes) { - return nil, errs.ErrArgs.Wrap("codes is duplicate") + if datautil.Duplicate(req.Codes) { + return nil, errs.ErrArgs.WrapMsg("codes is duplicate") } irs, err := o.Database.FindInvitationRegister(ctx, req.Codes) if err != nil { return nil, err } if len(irs) > 0 { - ids := utils.Slice(irs, func(info *admin2.InvitationRegister) string { return info.InvitationCode }) - return nil, errs.ErrArgs.Wrap("code existed " + strings.Join(ids, ", ")) + ids := datautil.Slice(irs, func(info *admin2.InvitationRegister) string { return info.InvitationCode }) + return nil, errs.ErrArgs.WrapMsg("code existed", "ids", ids) } now := time.Now() codes := make([]*admin2.InvitationRegister, 0, len(req.Codes)) @@ -67,7 +67,7 @@ func (o *adminServer) GenInvitationCode(ctx context.Context, req *admin.GenInvit return nil, err } if req.Num <= 0 || req.Len <= 0 { - return nil, errs.ErrArgs.Wrap("num or len <= 0") + return nil, errs.ErrArgs.WrapMsg("num or len <= 0") } if len(req.Chars) == 0 { req.Chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -88,16 +88,16 @@ func (o *adminServer) GenInvitationCode(ctx context.Context, req *admin.GenInvit CreateTime: now, }) } - if utils.Duplicate(codes) { - return nil, errs.ErrArgs.Wrap("gen duplicate codes") + if datautil.Duplicate(codes) { + return nil, errs.ErrArgs.WrapMsg("gen duplicate codes") } irs, err := o.Database.FindInvitationRegister(ctx, codes) if err != nil { return nil, err } if len(irs) > 0 { - ids := utils.Single(codes, utils.Slice(irs, func(ir *admin2.InvitationRegister) string { return ir.InvitationCode })) - return nil, errs.ErrArgs.Wrap(strings.Join(ids, ", ")) + ids := datautil.Single(codes, datautil.Slice(irs, func(ir *admin2.InvitationRegister) string { return ir.InvitationCode })) + return nil, errs.ErrArgs.WrapMsg(strings.Join(ids, ", ")) } if err := o.Database.CreatInvitationRegister(ctx, invitationRegisters); err != nil { return nil, err @@ -110,7 +110,7 @@ func (o *adminServer) FindInvitationCode(ctx context.Context, req *admin.FindInv return nil, err } if len(req.Codes) == 0 { - return nil, errs.ErrArgs.Wrap("codes is empty") + return nil, errs.ErrArgs.WrapMsg("codes is empty") } invitationRegisters, err := o.Database.FindInvitationRegister(ctx, req.Codes) if err != nil { @@ -163,18 +163,18 @@ func (o *adminServer) DelInvitationCode(ctx context.Context, req *admin.DelInvit return nil, err } if len(req.Codes) == 0 { - return nil, errs.ErrArgs.Wrap("codes is empty") + return nil, errs.ErrArgs.WrapMsg("codes is empty") } - if utils.Duplicate(req.Codes) { - return nil, errs.ErrArgs.Wrap("codes is duplicate") + if datautil.Duplicate(req.Codes) { + return nil, errs.ErrArgs.WrapMsg("codes is duplicate") } irs, err := o.Database.FindInvitationRegister(ctx, req.Codes) if err != nil { return nil, err } if len(irs) != len(req.Codes) { - ids := utils.Single(req.Codes, utils.Slice(irs, func(ir *admin2.InvitationRegister) string { return ir.InvitationCode })) - return nil, errs.ErrArgs.Wrap("code not found " + strings.Join(ids, ", ")) + ids := datautil.Single(req.Codes, datautil.Slice(irs, func(ir *admin2.InvitationRegister) string { return ir.InvitationCode })) + return nil, errs.ErrArgs.WrapMsg("code not found " + strings.Join(ids, ", ")) } if err := o.Database.DelInvitationRegister(ctx, req.Codes); err != nil { return nil, err diff --git a/internal/rpc/admin/ip_forbidden.go b/internal/rpc/admin/ip_forbidden.go index 2446bb08f..dbb65a68d 100644 --- a/internal/rpc/admin/ip_forbidden.go +++ b/internal/rpc/admin/ip_forbidden.go @@ -18,9 +18,9 @@ import ( "context" "time" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) SearchIPForbidden(ctx context.Context, req *admin.SearchIPForbiddenReq) (*admin.SearchIPForbiddenResp, error) { diff --git a/internal/rpc/admin/register_add_friend.go b/internal/rpc/admin/register_add_friend.go index c649852fe..f859e8c0d 100644 --- a/internal/rpc/admin/register_add_friend.go +++ b/internal/rpc/admin/register_add_friend.go @@ -16,16 +16,15 @@ package admin import ( "context" - "strings" + "github.com/openimsdk/tools/utils/datautil" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/tools/errs" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/common" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/common" ) func (o *adminServer) AddDefaultFriend(ctx context.Context, req *admin.AddDefaultFriendReq) (*admin.AddDefaultFriendResp, error) { @@ -33,24 +32,24 @@ func (o *adminServer) AddDefaultFriend(ctx context.Context, req *admin.AddDefaul return nil, err } if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("user ids is empty") + return nil, errs.ErrArgs.WrapMsg("user ids is empty") } - if utils.Duplicate(req.UserIDs) { - return nil, errs.ErrArgs.Wrap("user ids is duplicate") + if datautil.Duplicate(req.UserIDs) { + return nil, errs.ErrArgs.WrapMsg("user ids is duplicate") } users, err := o.Chat.FindUserPublicInfo(ctx, req.UserIDs) if err != nil { return nil, err } - if ids := utils.Single(req.UserIDs, utils.Slice(users, func(user *common.UserPublicInfo) string { return user.UserID })); len(ids) > 0 { - return nil, errs.ErrUserIDNotFound.Wrap(strings.Join(ids, ", ")) + if ids := datautil.Single(req.UserIDs, datautil.Slice(users, func(user *common.UserPublicInfo) string { return user.UserID })); len(ids) > 0 { + return nil, errs.ErrRecordNotFound.WrapMsg("user id not found", "userID", ids) } exists, err := o.Database.FindDefaultFriend(ctx, req.UserIDs) if err != nil { return nil, err } if len(exists) > 0 { - return nil, errs.ErrDuplicateKey.Wrap(strings.Join(exists, ", ")) + return nil, errs.ErrDuplicateKey.WrapMsg("user id existed", "userID", exists) } now := time.Now() ms := make([]*admin2.RegisterAddFriend, 0, len(req.UserIDs)) @@ -71,17 +70,17 @@ func (o *adminServer) DelDefaultFriend(ctx context.Context, req *admin.DelDefaul return nil, err } if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("user ids is empty") + return nil, errs.ErrArgs.WrapMsg("user ids is empty") } - if utils.Duplicate(req.UserIDs) { - return nil, errs.ErrArgs.Wrap("user ids is duplicate") + if datautil.Duplicate(req.UserIDs) { + return nil, errs.ErrArgs.WrapMsg("user ids is duplicate") } exists, err := o.Database.FindDefaultFriend(ctx, req.UserIDs) if err != nil { return nil, err } - if ids := utils.Single(req.UserIDs, exists); len(ids) > 0 { - return nil, errs.ErrUserIDNotFound.Wrap(strings.Join(ids, ", ")) + if ids := datautil.Single(req.UserIDs, exists); len(ids) > 0 { + return nil, errs.ErrRecordNotFound.WrapMsg("user id not found", "userID", ids) } now := time.Now() ms := make([]*admin2.RegisterAddFriend, 0, len(req.UserIDs)) @@ -116,7 +115,7 @@ func (o *adminServer) SearchDefaultFriend(ctx context.Context, req *admin.Search if err != nil { return nil, err } - userIDs := utils.Slice(infos, func(info *admin2.RegisterAddFriend) string { return info.UserID }) + userIDs := datautil.Slice(infos, func(info *admin2.RegisterAddFriend) string { return info.UserID }) userMap, err := o.Chat.MapUserPublicInfo(ctx, userIDs) if err != nil { return nil, err diff --git a/internal/rpc/admin/register_add_group.go b/internal/rpc/admin/register_add_group.go index 04ec8133f..63283071a 100644 --- a/internal/rpc/admin/register_add_group.go +++ b/internal/rpc/admin/register_add_group.go @@ -16,15 +16,14 @@ package admin import ( "context" - "strings" + "github.com/openimsdk/tools/utils/datautil" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/tools/errs" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) AddDefaultGroup(ctx context.Context, req *admin.AddDefaultGroupReq) (*admin.AddDefaultGroupResp, error) { @@ -32,17 +31,17 @@ func (o *adminServer) AddDefaultGroup(ctx context.Context, req *admin.AddDefault return nil, err } if len(req.GroupIDs) == 0 { - return nil, errs.ErrArgs.Wrap("group ids is empty") + return nil, errs.ErrArgs.WrapMsg("group ids is empty") } - if utils.Duplicate(req.GroupIDs) { - return nil, errs.ErrArgs.Wrap("group ids is duplicate") + if datautil.Duplicate(req.GroupIDs) { + return nil, errs.ErrArgs.WrapMsg("group ids is duplicate") } exists, err := o.Database.FindDefaultGroup(ctx, req.GroupIDs) if err != nil { return nil, err } if len(exists) > 0 { - return nil, errs.ErrGroupIDExisted.Wrap(strings.Join(exists, ", ")) + return nil, errs.ErrDuplicateKey.WrapMsg("group id existed", "groupID", exists) } now := time.Now() ms := make([]*admin2.RegisterAddGroup, 0, len(req.GroupIDs)) @@ -63,17 +62,17 @@ func (o *adminServer) DelDefaultGroup(ctx context.Context, req *admin.DelDefault return nil, err } if len(req.GroupIDs) == 0 { - return nil, errs.ErrArgs.Wrap("group ids is empty") + return nil, errs.ErrArgs.WrapMsg("group ids is empty") } - if utils.Duplicate(req.GroupIDs) { - return nil, errs.ErrArgs.Wrap("group ids is duplicate") + if datautil.Duplicate(req.GroupIDs) { + return nil, errs.ErrArgs.WrapMsg("group ids is duplicate") } exists, err := o.Database.FindDefaultGroup(ctx, req.GroupIDs) if err != nil { return nil, err } - if ids := utils.Single(req.GroupIDs, exists); len(ids) > 0 { - return nil, errs.ErrGroupIDNotFound.Wrap(strings.Join(ids, ", ")) + if ids := datautil.Single(req.GroupIDs, exists); len(ids) > 0 { + return nil, errs.ErrRecordNotFound.WrapMsg("group id not found", "groupID", ids) } now := time.Now() ms := make([]*admin2.RegisterAddGroup, 0, len(req.GroupIDs)) @@ -108,5 +107,5 @@ func (o *adminServer) SearchDefaultGroup(ctx context.Context, req *admin.SearchD if err != nil { return nil, err } - return &admin.SearchDefaultGroupResp{Total: uint32(total), GroupIDs: utils.Slice(infos, func(info *admin2.RegisterAddGroup) string { return info.GroupID })}, nil + return &admin.SearchDefaultGroupResp{Total: uint32(total), GroupIDs: datautil.Slice(infos, func(info *admin2.RegisterAddGroup) string { return info.GroupID })}, nil } diff --git a/internal/rpc/admin/start.go b/internal/rpc/admin/start.go new file mode 100644 index 000000000..c8ed81ea6 --- /dev/null +++ b/internal/rpc/admin/start.go @@ -0,0 +1,94 @@ +package admin + +import ( + "context" + "crypto/md5" + "encoding/hex" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/database" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/tokenverify" + pbadmin "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/chat" + chatClient "github.com/openimsdk/chat/pkg/rpclient/chat" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "math/rand" + "time" +) + +type Config struct { + RpcConfig config.Admin + RedisConfig config.Redis + MongodbConfig config.Mongo + ZookeeperConfig config.ZooKeeper + Share config.Share +} + +func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error { + if len(config.Share.ChatAdmin) == 0 { + return errs.New("share chat admin not configured") + } + rand.Seed(time.Now().UnixNano()) + rdb, err := redisutil.NewRedisClient(ctx, config.RedisConfig.Build()) + if err != nil { + return err + } + mgocli, err := mongoutil.NewMongoDB(ctx, config.MongodbConfig.Build()) + if err != nil { + return err + } + var srv adminServer + srv.Database, err = database.NewAdminDatabase(mgocli, rdb) + if err != nil { + return err + } + conn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Chat, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return err + } + srv.Chat = chatClient.NewChatClient(chat.NewChatClient(conn)) + srv.Token = &tokenverify.Token{ + Expires: time.Duration(config.RpcConfig.TokenPolicy.Expire) * time.Hour * 24, + Secret: config.RpcConfig.Secret, + } + if err := srv.initAdmin(ctx, config.Share.ChatAdmin); err != nil { + return err + } + pbadmin.RegisterAdminServer(server, &srv) + return nil +} + +type adminServer struct { + Database database.AdminDatabaseInterface + Chat *chatClient.ChatClient + Token *tokenverify.Token +} + +func (o *adminServer) initAdmin(ctx context.Context, users []config.AdminUser) error { + for _, user := range users { + if _, err := o.Database.GetAdmin(ctx, user.AdminID); err == nil { + continue + } else if !dbutil.IsDBNotFound(err) { + return err + } + sum := md5.Sum([]byte(user.AdminID)) + a := admin.Admin{ + Account: user.AdminID, + UserID: user.IMUserID, + Password: hex.EncodeToString(sum[:]), + Level: constant.DefaultAdminLevel, + CreateTime: time.Now(), + } + if err := o.Database.AddAdminAccount(ctx, []*admin.Admin{&a}); err != nil { + return err + } + } + return nil +} diff --git a/internal/rpc/admin/token.go b/internal/rpc/admin/token.go index 934e77fd1..41240738f 100644 --- a/internal/rpc/admin/token.go +++ b/internal/rpc/admin/token.go @@ -17,13 +17,11 @@ package admin import ( "context" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/tokenverify" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/protocol/admin" ) func (o *adminServer) CreateToken(ctx context.Context, req *admin.CreateTokenReq) (*admin.CreateTokenResp, error) { - token, err := tokenverify.CreateToken(req.UserID, req.UserType, *config.Config.TokenPolicy.Expire) + token, err := o.Token.CreateToken(req.UserID, req.UserType) if err != nil { return nil, err } @@ -36,8 +34,8 @@ func (o *adminServer) CreateToken(ctx context.Context, req *admin.CreateTokenReq }, nil } -func (*adminServer) ParseToken(ctx context.Context, req *admin.ParseTokenReq) (*admin.ParseTokenResp, error) { - userID, userType, err := tokenverify.GetToken(req.Token) +func (o *adminServer) ParseToken(ctx context.Context, req *admin.ParseTokenReq) (*admin.ParseTokenResp, error) { + userID, userType, err := o.Token.GetToken(req.Token) if err != nil { return nil, err } diff --git a/internal/rpc/admin/update.go b/internal/rpc/admin/update.go index d3fd97984..75e68ac29 100644 --- a/internal/rpc/admin/update.go +++ b/internal/rpc/admin/update.go @@ -19,9 +19,9 @@ import ( "encoding/hex" "time" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/protocol/admin" ) type Admin struct { @@ -38,13 +38,13 @@ func ToDBAdminUpdate(req *admin.AdminUpdateInfoReq) (map[string]any, error) { update := make(map[string]any) if req.Account != nil { if req.Account.Value == "" { - return nil, errs.ErrArgs.Wrap("account is empty") + return nil, errs.ErrArgs.WrapMsg("account is empty") } update["account"] = req.Account.Value } if req.Password != nil { if req.Password.Value == "" { - return nil, errs.ErrArgs.Wrap("password is empty") + return nil, errs.ErrArgs.WrapMsg("password is empty") } update["password"] = req.Password.Value } @@ -53,7 +53,7 @@ func ToDBAdminUpdate(req *admin.AdminUpdateInfoReq) (map[string]any, error) { } if req.Nickname != nil { if req.Nickname.Value == "" { - return nil, errs.ErrArgs.Wrap("nickname is empty") + return nil, errs.ErrArgs.WrapMsg("nickname is empty") } update["nickname"] = req.Nickname.Value } @@ -64,14 +64,14 @@ func ToDBAdminUpdate(req *admin.AdminUpdateInfoReq) (map[string]any, error) { update["level"] = req.Level.Value } if len(update) == 0 { - return nil, errs.ErrArgs.Wrap("no update info") + return nil, errs.ErrArgs.WrapMsg("no update info") } return update, nil } func ToDBAdminUpdatePassword(password string) (map[string]any, error) { if password == "" { - return nil, errs.ErrArgs.Wrap("password is empty") + return nil, errs.ErrArgs.WrapMsg("password is empty") } return map[string]any{"password": password}, nil } @@ -80,13 +80,13 @@ func ToDBAppletUpdate(req *admin.UpdateAppletReq) (map[string]any, error) { update := make(map[string]any) if req.Name != nil { if req.Name.Value == "" { - return nil, errs.ErrArgs.Wrap("name is empty") + return nil, errs.ErrArgs.WrapMsg("name is empty") } update["name"] = req.Name.Value } if req.AppID != nil { if req.AppID.Value == "" { - return nil, errs.ErrArgs.Wrap("appID is empty") + return nil, errs.ErrArgs.WrapMsg("appID is empty") } update["app_id"] = req.AppID.Value } @@ -95,25 +95,25 @@ func ToDBAppletUpdate(req *admin.UpdateAppletReq) (map[string]any, error) { } if req.Url != nil { if req.Url.Value == "" { - return nil, errs.ErrArgs.Wrap("url is empty") + return nil, errs.ErrArgs.WrapMsg("url is empty") } update["url"] = req.Url.Value } if req.Md5 != nil { if hash, _ := hex.DecodeString(req.Md5.Value); len(hash) != md5.Size { - return nil, errs.ErrArgs.Wrap("md5 is invalid") + return nil, errs.ErrArgs.WrapMsg("md5 is invalid") } update["md5"] = req.Md5.Value } if req.Size != nil { if req.Size.Value <= 0 { - return nil, errs.ErrArgs.Wrap("size is invalid") + return nil, errs.ErrArgs.WrapMsg("size is invalid") } update["size"] = req.Size.Value } if req.Version != nil { if req.Version.Value == "" { - return nil, errs.ErrArgs.Wrap("version is empty") + return nil, errs.ErrArgs.WrapMsg("version is empty") } update["version"] = req.Version.Value } @@ -124,7 +124,7 @@ func ToDBAppletUpdate(req *admin.UpdateAppletReq) (map[string]any, error) { update["status"] = req.Status.Value } if len(update) == 0 { - return nil, errs.ErrArgs.Wrap("no update info") + return nil, errs.ErrArgs.WrapMsg("no update info") } return update, nil } diff --git a/internal/rpc/admin/user.go b/internal/rpc/admin/user.go index 01d0edab8..e2ddddaa2 100644 --- a/internal/rpc/admin/user.go +++ b/internal/rpc/admin/user.go @@ -16,27 +16,22 @@ package admin import ( "context" + "github.com/openimsdk/protocol/wrapperspb" + "github.com/openimsdk/tools/utils/datautil" "strings" "time" - "github.com/OpenIMSDK/protocol/wrapperspb" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/tools/utils" - - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" - "github.com/OpenIMSDK/chat/pkg/proto/chat" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/mcontext" ) func (o *adminServer) CancellationUser(ctx context.Context, req *admin.CancellationUserReq) (*admin.CancellationUserResp, error) { - _, err := mctx.CheckAdmin(ctx) - if err != nil { - return nil, err - } - if err != nil { + if _, err := mctx.CheckAdmin(ctx); err != nil { return nil, err } empty := wrapperspb.String("") @@ -54,7 +49,7 @@ func (o *adminServer) BlockUser(ctx context.Context, req *admin.BlockUserReq) (* } _, err = o.Database.GetBlockInfo(ctx, req.UserID) if err == nil { - return nil, errs.ErrArgs.Wrap("user already blocked") + return nil, errs.ErrArgs.WrapMsg("user already blocked") } else if !dbutil.IsDBNotFound(err) { return nil, err } @@ -76,18 +71,18 @@ func (o *adminServer) UnblockUser(ctx context.Context, req *admin.UnblockUserReq return nil, err } if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("empty user id") + return nil, errs.ErrArgs.WrapMsg("empty user id") } - if utils.Duplicate(req.UserIDs) { - return nil, errs.ErrArgs.Wrap("duplicate user id") + if datautil.Duplicate(req.UserIDs) { + return nil, errs.ErrArgs.WrapMsg("duplicate user id") } bs, err := o.Database.FindBlockInfo(ctx, req.UserIDs) if err != nil { return nil, err } if len(req.UserIDs) != len(bs) { - ids := utils.Single(req.UserIDs, utils.Slice(bs, func(info *admin2.ForbiddenAccount) string { return info.UserID })) - return nil, errs.ErrArgs.Wrap("user not blocked " + strings.Join(ids, ", ")) + ids := datautil.Single(req.UserIDs, datautil.Slice(bs, func(info *admin2.ForbiddenAccount) string { return info.UserID })) + return nil, errs.ErrArgs.WrapMsg("user not blocked " + strings.Join(ids, ", ")) } if err := o.Database.DelBlockUser(ctx, req.UserIDs); err != nil { return nil, err @@ -103,7 +98,7 @@ func (o *adminServer) SearchBlockUser(ctx context.Context, req *admin.SearchBloc if err != nil { return nil, err } - userIDs := utils.Slice(infos, func(info *admin2.ForbiddenAccount) string { return info.UserID }) + userIDs := datautil.Slice(infos, func(info *admin2.ForbiddenAccount) string { return info.UserID }) userMap, err := o.Chat.MapUserFullInfo(ctx, userIDs) if err != nil { return nil, err diff --git a/internal/rpc/admin/user_ip_limit_login.go b/internal/rpc/admin/user_ip_limit_login.go index 1ab52b291..f1d6cd42b 100644 --- a/internal/rpc/admin/user_ip_limit_login.go +++ b/internal/rpc/admin/user_ip_limit_login.go @@ -16,14 +16,13 @@ package admin import ( "context" + "github.com/openimsdk/tools/utils/datautil" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" - - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + admin2 "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/tools/errs" ) func (o *adminServer) SearchUserIPLimitLogin(ctx context.Context, req *admin.SearchUserIPLimitLoginReq) (*admin.SearchUserIPLimitLoginResp, error) { @@ -34,8 +33,8 @@ func (o *adminServer) SearchUserIPLimitLogin(ctx context.Context, req *admin.Sea if err != nil { return nil, err } - userIDs := utils.Slice(list, func(info *admin2.LimitUserLoginIP) string { return info.UserID }) - userMap, err := o.Chat.MapUserPublicInfo(ctx, utils.Distinct(userIDs)) + userIDs := datautil.Slice(list, func(info *admin2.LimitUserLoginIP) string { return info.UserID }) + userMap, err := o.Chat.MapUserPublicInfo(ctx, datautil.Distinct(userIDs)) if err != nil { return nil, err } @@ -56,7 +55,7 @@ func (o *adminServer) AddUserIPLimitLogin(ctx context.Context, req *admin.AddUse return nil, err } if len(req.Limits) == 0 { - return nil, errs.ErrArgs.Wrap("limits is empty") + return nil, errs.ErrArgs.WrapMsg("limits is empty") } now := time.Now() ts := make([]*admin2.LimitUserLoginIP, 0, len(req.Limits)) @@ -78,12 +77,12 @@ func (o *adminServer) DelUserIPLimitLogin(ctx context.Context, req *admin.DelUse return nil, err } if len(req.Limits) == 0 { - return nil, errs.ErrArgs.Wrap("limits is empty") + return nil, errs.ErrArgs.WrapMsg("limits is empty") } ts := make([]*admin2.LimitUserLoginIP, 0, len(req.Limits)) for _, limit := range req.Limits { if limit.UserID == "" || limit.Ip == "" { - return nil, errs.ErrArgs.Wrap("user_id or ip is empty") + return nil, errs.ErrArgs.WrapMsg("user_id or ip is empty") } ts = append(ts, &admin2.LimitUserLoginIP{ UserID: limit.UserID, diff --git a/internal/rpc/chat/callback.go b/internal/rpc/chat/callback.go index 9af4584e7..8d793927c 100644 --- a/internal/rpc/chat/callback.go +++ b/internal/rpc/chat/callback.go @@ -19,11 +19,11 @@ import ( "encoding/json" "fmt" - constant2 "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" + constant2 "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" ) type CallbackBeforeAddFriendReq struct { @@ -52,10 +52,10 @@ func (o *chatSvr) OpenIMCallback(ctx context.Context, req *chat.OpenIMCallbackRe return nil, err } if user.AllowAddFriend != constant2.OrdinaryUserAddFriendEnable { - return nil, eerrs.ErrRefuseFriend.Wrap(fmt.Sprintf("state %d", user.AllowAddFriend)) + return nil, eerrs.ErrRefuseFriend.WrapMsg(fmt.Sprintf("state %d", user.AllowAddFriend)) } return &chat.OpenIMCallbackResp{}, nil default: - return nil, errs.ErrArgs.Wrap(fmt.Sprintf("invalid command %s", req.Command)) + return nil, errs.ErrArgs.WrapMsg(fmt.Sprintf("invalid command %s", req.Command)) } } diff --git a/internal/rpc/chat/chat.go b/internal/rpc/chat/chat.go deleted file mode 100644 index 1524545fb..000000000 --- a/internal/rpc/chat/chat.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "github.com/OpenIMSDK/chat/pkg/common/apicall" - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/errs" - "google.golang.org/grpc" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/db/database" - "github.com/OpenIMSDK/chat/pkg/common/dbconn" - "github.com/OpenIMSDK/chat/pkg/email" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - chatClient "github.com/OpenIMSDK/chat/pkg/rpclient/chat" - "github.com/OpenIMSDK/chat/pkg/sms" -) - -func Start(discov discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { - mgodb, err := dbconn.NewMongo() - if err != nil { - return err - } - s, err := sms.New() - if err != nil { - return errs.Wrap(err) - } - db, err := database.NewChatDatabase(mgodb) - if err != nil { - return err - } - if err := discov.CreateRpcRootNodes([]string{config.Config.RpcRegisterName.OpenImAdminName, config.Config.RpcRegisterName.OpenImChatName}); err != nil { - return err - } - chat.RegisterChatServer(server, &chatSvr{ - Database: db, - Admin: chatClient.NewAdminClient(discov), - SMS: s, - Mail: email.NewMail(), - imApiCaller: apicall.NewCallerInterface(), - }) - return nil -} - -type chatSvr struct { - Database database.ChatDatabaseInterface - Admin *chatClient.AdminClient - SMS sms.SMS - Mail email.Mail - imApiCaller apicall.CallerInterface -} diff --git a/internal/rpc/chat/log.go b/internal/rpc/chat/log.go deleted file mode 100644 index b590aebbd..000000000 --- a/internal/rpc/chat/log.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "fmt" - "math/rand" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/constant" - table "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw/specialerror" - utils2 "github.com/OpenIMSDK/tools/utils" - "gorm.io/gorm/utils" -) - -func (o *chatSvr) genLogID() string { - const l = 10 - data := make([]byte, l) - rand.Read(data) - chars := []byte("0123456789") - for i := 0; i < len(data); i++ { - if i == 0 { - data[i] = chars[1:][data[i]%9] - } else { - data[i] = chars[data[i]%10] - } - } - return string(data) -} - -func (o *chatSvr) IsNotFound(err error) bool { - return errs.ErrRecordNotFound.Is(specialerror.ErrCode(errs.Unwrap(err))) -} - -func (o *chatSvr) UploadLogs(ctx context.Context, req *chat.UploadLogsReq) (*chat.UploadLogsResp, error) { - var DBlogs []*table.Log - userID, _, err := mctx.Check(ctx) - if _, err := o.Database.GetUser(ctx, userID); err != nil { - return nil, err - } - for _, fileURL := range req.FileURLs { - log := table.Log{ - Version: req.Version, - SystemType: req.SystemType, - Platform: utils.ToString(req.Platform), - UserID: userID, - CreateTime: time.Now(), - Url: fileURL.URL, - FileName: fileURL.Filename, - } - for i := 0; i < 20; i++ { - id := o.genLogID() - logs, err := o.Database.GetLogs(ctx, []string{id}, "") - if err != nil { - return nil, err - } - if len(logs) == 0 { - log.LogID = id - break - } - } - if log.LogID == "" { - return nil, errs.ErrData.Wrap("Log id gen error") - } - DBlogs = append(DBlogs, &log) - } - err = o.Database.UploadLogs(ctx, DBlogs) - if err != nil { - return nil, err - } - return &chat.UploadLogsResp{}, nil -} - -func (o *chatSvr) DeleteLogs(ctx context.Context, req *chat.DeleteLogsReq) (*chat.DeleteLogsResp, error) { - userID, userType, err := mctx.Check(ctx) - if err != nil { - return nil, err - } - if userType == constant.AdminUser { - userID = "" - } - logs, err := o.Database.GetLogs(ctx, req.LogIDs, userID) - if err != nil { - return nil, err - } - var logIDs []string - for _, log := range logs { - logIDs = append(logIDs, log.LogID) - } - if ids := utils2.Single(req.LogIDs, logIDs); len(ids) > 0 { - return nil, errs.ErrRecordNotFound.Wrap(fmt.Sprintf("logIDs not found%#v", ids)) - } - err = o.Database.DeleteLogs(ctx, req.LogIDs, userID) - if err != nil { - return nil, err - } - return &chat.DeleteLogsResp{}, nil -} - -func (o *chatSvr) SearchLogs(ctx context.Context, req *chat.SearchLogsReq) (*chat.SearchLogsResp, error) { - var ( - resp chat.SearchLogsResp - userIDs []string - ) - if req.StartTime > req.EndTime { - return nil, errs.ErrArgs.Wrap("startTime>endTime") - } - total, logs, err := o.Database.SearchLogs(ctx, req.Keyword, time.UnixMilli(req.StartTime), time.UnixMilli(req.EndTime), req.Pagination) - if err != nil { - return nil, err - } - pbLogs := DbToPbLogInfos(logs) - for _, log := range logs { - userIDs = append(userIDs, log.UserID) - } - attributes, err := o.Database.FindAttribute(ctx, userIDs) - if err != nil { - return nil, err - } - IDtoName := make(map[string]string) - for _, attribute := range attributes { - IDtoName[attribute.UserID] = attribute.Nickname - } - for _, pbLog := range pbLogs { - pbLog.Nickname = IDtoName[pbLog.UserID] - } - resp.LogsInfos = pbLogs - resp.Total = uint32(total) - return &resp, nil -} diff --git a/internal/rpc/chat/login.go b/internal/rpc/chat/login.go index f35141a09..86f6bcc31 100644 --- a/internal/rpc/chat/login.go +++ b/internal/rpc/chat/login.go @@ -16,26 +16,24 @@ package chat import ( "context" + "fmt" + "github.com/openimsdk/tools/utils/datautil" "math/rand" "strconv" "strings" "time" - "github.com/OpenIMSDK/chat/pkg/common/mctx" + constant2 "github.com/openimsdk/protocol/constant" - constant2 "github.com/OpenIMSDK/protocol/constant" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mcontext" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/tools/utils" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - chat2 "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/chat" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + chat2 "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/chat" ) func (o *chatSvr) verifyCodeJoin(areaCode, phoneNumber string) string { @@ -50,31 +48,31 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe } if req.Email == "" { if req.AreaCode == "" || req.PhoneNumber == "" { - return nil, errs.ErrArgs.Wrap("area code or phone number is empty") + return nil, errs.ErrArgs.WrapMsg("area code or phone number is empty") } if req.AreaCode[0] != '+' { req.AreaCode = "+" + req.AreaCode } if _, err := strconv.ParseUint(req.AreaCode[1:], 10, 64); err != nil { - return nil, errs.ErrArgs.Wrap("area code must be number") + return nil, errs.ErrArgs.WrapMsg("area code must be number") } if _, err := strconv.ParseUint(req.PhoneNumber, 10, 64); err != nil { - return nil, errs.ErrArgs.Wrap("phone number must be number") + return nil, errs.ErrArgs.WrapMsg("phone number must be number") } _, err := o.Database.TakeAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) if err == nil { - return nil, eerrs.ErrPhoneAlreadyRegister.Wrap("phone already register") - } else if !o.Database.IsNotFound(err) { + return nil, eerrs.ErrPhoneAlreadyRegister.WrapMsg("phone already register") + } else if !dbutil.IsDBNotFound(err) { return nil, err } } else { if err := chat.EmailCheck(req.Email); err != nil { - return nil, errs.ErrArgs.Wrap("email must be right") + return nil, errs.ErrArgs.WrapMsg("email must be right") } _, err := o.Database.TakeAttributeByEmail(ctx, req.Email) if err == nil { - return nil, eerrs.ErrEmailAlreadyRegister.Wrap("email already register") - } else if !o.Database.IsNotFound(err) { + return nil, eerrs.ErrEmailAlreadyRegister.WrapMsg("email already register") + } else if !dbutil.IsDBNotFound(err) { return nil, err } } @@ -82,9 +80,9 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe if err != nil { return nil, err } - if val := conf[constant.NeedInvitationCodeRegisterConfigKey]; utils.Contain(strings.ToLower(val), "1", "true", "yes") { + if val := conf[constant.NeedInvitationCodeRegisterConfigKey]; datautil.Contain(strings.ToLower(val), "1", "true", "yes") { if req.InvitationCode == "" { - return nil, errs.ErrArgs.Wrap("invitation code is empty") + return nil, errs.ErrArgs.WrapMsg("invitation code is empty") } if err := o.Admin.CheckInvitationCode(ctx, req.InvitationCode); err != nil { return nil, err @@ -93,86 +91,83 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe case constant.VerificationCodeForLogin, constant.VerificationCodeForResetPassword: if req.Email == "" { _, err := o.Database.TakeAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) - if o.Database.IsNotFound(err) { - return nil, eerrs.ErrAccountNotFound.Wrap("phone unregistered") + if dbutil.IsDBNotFound(err) { + return nil, eerrs.ErrAccountNotFound.WrapMsg("phone unregistered") } else if err != nil { return nil, err } } else { _, err := o.Database.TakeAttributeByEmail(ctx, req.Email) - if o.Database.IsNotFound(err) { - return nil, eerrs.ErrAccountNotFound.Wrap("email unregistered") + if dbutil.IsDBNotFound(err) { + return nil, eerrs.ErrAccountNotFound.WrapMsg("email unregistered") } else if err != nil { return nil, err } } default: - return nil, errs.ErrArgs.Wrap("used unknown") - } - var account string - var isEmail bool - if req.Email == "" { - account = o.verifyCodeJoin(req.AreaCode, req.PhoneNumber) - } else { - isEmail = true - account = req.Email + return nil, errs.ErrArgs.WrapMsg("used unknown") } - - verifyCode := config.Config.VerifyCode - if verifyCode.UintTime == 0 || verifyCode.MaxCount == 0 { - return nil, errs.ErrNoPermission.Wrap("verify code disabled") + if o.SMS == nil && o.Mail == nil { + return &chat.SendVerifyCodeResp{}, nil // super code } - if verifyCode.Use == "" { - if verifyCode.SuperCode == "" { - return nil, errs.ErrInternalServer.Wrap("super code is empty") + isEmail := req.Email != "" + var ( + code = o.genVerifyCode() + account string + sendCode func() error + ) + if isEmail { + if o.Mail == nil { + return nil, errs.ErrInternalServer.WrapMsg("email verification code is not enabled") } - return &chat.SendVerifyCodeResp{}, nil - } - now := time.Now() - - var count int64 - var err error - if !isEmail { - count, err = o.Database.CountVerifyCodeRange(ctx, o.verifyCodeJoin(req.AreaCode, req.PhoneNumber), now.Add(-time.Duration(verifyCode.UintTime)*time.Second), now) - if err != nil { - return nil, err + sendCode = func() error { + return o.Mail.SendMail(ctx, req.Email, code) } + account = req.Email } else { - count, err = o.Database.CountVerifyCodeRange(ctx, req.Email, now.Add(-time.Duration(verifyCode.UintTime)*time.Second), now) + if o.SMS == nil { + return nil, errs.ErrInternalServer.WrapMsg("mobile phone verification code is not enabled") + } + sendCode = func() error { + return o.SMS.SendCode(ctx, req.AreaCode, req.PhoneNumber, code) + } + account = o.verifyCodeJoin(req.AreaCode, req.PhoneNumber) + } + now := time.Now() + count, err := o.Database.CountVerifyCodeRange(ctx, account, now.Add(-o.Code.UintTime), now) + if err != nil { + return nil, err } - if verifyCode.MaxCount < int(count) { + if o.Code.MaxCount < int(count) { return nil, eerrs.ErrVerifyCodeSendFrequently.Wrap() } - - t := &chat2.VerifyCode{ - Account: account, - Code: o.genVerifyCode(), - Duration: uint(config.Config.VerifyCode.ValidTime), - CreateTime: time.Now(), - } - if !isEmail { - err = o.Database.AddVerifyCode(ctx, t, func() error { - return o.SMS.SendCode(ctx, req.AreaCode, req.PhoneNumber, t.Code) - }) - } else { - // 发送邮件验证码 - err = o.Database.AddVerifyCode(ctx, t, func() error { - return o.Mail.SendMail(ctx, req.Email, t.Code) - }) + platformName := constant2.PlatformIDToName(int(req.Platform)) + if platformName == "" { + platformName = fmt.Sprintf("platform:%d", req.Platform) } - if err != nil { + vc := &chat2.VerifyCode{ + Account: account, + Code: code, + Platform: platformName, + Duration: uint(o.Code.ValidTime / time.Second), + Count: 0, + Used: false, + CreateTime: now, + } + if err := o.Database.AddVerifyCode(ctx, vc, sendCode); err != nil { return nil, err } + log.ZDebug(ctx, "send code success", "account", account, "code", code, "platform", platformName) return &chat.SendVerifyCodeResp{}, nil } func (o *chatSvr) verifyCode(ctx context.Context, account string, verifyCode string) (string, error) { if verifyCode == "" { - return "", errs.ErrArgs.Wrap("verify code is empty") + return "", errs.ErrArgs.WrapMsg("verify code is empty") } - if config.Config.VerifyCode.Use == "" { - if verifyCode != config.Config.VerifyCode.SuperCode { + if o.SMS == nil && o.Mail == nil { + if o.Code.SuperCode != verifyCode { return "", eerrs.ErrVerifyCodeNotMatch.Wrap() } return "", nil @@ -190,8 +185,8 @@ func (o *chatSvr) verifyCode(ctx context.Context, account string, verifyCode str if last.Used { return last.ID, eerrs.ErrVerifyCodeUsed.Wrap() } - if config.Config.VerifyCode.MaxCount > 0 { - if last.Count >= config.Config.VerifyCode.MaxCount { + if n := o.Code.ValidCount; n > 0 { + if last.Count >= n { return last.ID, eerrs.ErrVerifyCodeMaxCount.Wrap() } if last.Code != verifyCode { @@ -235,7 +230,7 @@ func (o *chatSvr) genUserID() string { } func (o *chatSvr) genVerifyCode() string { - data := make([]byte, config.Config.VerifyCode.Len) + data := make([]byte, o.Code.Len) rand.Read(data) chars := []byte("0123456789") for i := 0; i < len(data); i++ { @@ -248,22 +243,22 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( resp := &chat.RegisterUserResp{} isAdmin, err := o.Admin.CheckNilOrAdmin(ctx) - ctx = mctx.WithAdminUser(ctx) + ctx = o.WithAdminUser(ctx) if err != nil { return nil, err } if req.User == nil { - return nil, errs.ErrArgs.Wrap("user is nil") + return nil, errs.ErrArgs.WrapMsg("user is nil") } if req.User.Email == "" { if (req.User.AreaCode == "" && req.User.PhoneNumber != "") || (req.User.AreaCode != "" && req.User.PhoneNumber == "") { - return nil, errs.ErrArgs.Wrap("area code or phone number error, no email provide") + return nil, errs.ErrArgs.WrapMsg("area code or phone number error, no email provide") } } var usedInvitationCode bool if !isAdmin { if req.User.UserID != "" { - return nil, errs.ErrNoPermission.Wrap("only admin can set user id") + return nil, errs.ErrNoPermission.WrapMsg("only admin can set user id") } if err := o.Admin.CheckRegister(ctx, req.Ip); err != nil { return nil, err @@ -272,10 +267,10 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( if err != nil { return nil, err } - if val := conf[constant.NeedInvitationCodeRegisterConfigKey]; utils.Contain(strings.ToLower(val), "1", "true", "yes") { + if val := conf[constant.NeedInvitationCodeRegisterConfigKey]; datautil.Contain(strings.ToLower(val), "1", "true", "yes") { usedInvitationCode = true if req.InvitationCode == "" { - return nil, errs.ErrArgs.Wrap("invitation code is empty") + return nil, errs.ErrArgs.WrapMsg("invitation code is empty") } if err := o.Admin.CheckInvitationCode(ctx, req.InvitationCode); err != nil { return nil, err @@ -306,12 +301,12 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( } } if req.User.UserID == "" { - return nil, errs.ErrInternalServer.Wrap("gen user id failed") + return nil, errs.ErrInternalServer.WrapMsg("gen user id failed") } } else { _, err := o.Database.GetUser(ctx, req.User.UserID) if err == nil { - return nil, errs.ErrArgs.Wrap("appoint user id already register") + return nil, errs.ErrArgs.WrapMsg("appoint user id already register") } else if !dbutil.IsDBNotFound(err) { return nil, err } @@ -322,15 +317,15 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( req.User.AreaCode = "+" + req.User.AreaCode } if _, err := strconv.ParseUint(req.User.AreaCode[1:], 10, 64); err != nil { - return nil, errs.ErrArgs.Wrap("area code must be number") + return nil, errs.ErrArgs.WrapMsg("area code must be number") } if _, err := strconv.ParseUint(req.User.PhoneNumber, 10, 64); err != nil { - return nil, errs.ErrArgs.Wrap("phone number must be number") + return nil, errs.ErrArgs.WrapMsg("phone number must be number") } _, err := o.Database.TakeAttributeByPhone(ctx, req.User.AreaCode, req.User.PhoneNumber) if err == nil { return nil, eerrs.ErrPhoneAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return nil, err } registerType = constant.PhoneRegister @@ -340,7 +335,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( _, err := o.Database.TakeAttributeByAccount(ctx, req.User.Account) if err == nil { return nil, eerrs.ErrAccountAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return nil, err } } @@ -350,7 +345,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( registerType = constant.EmailRegister if err == nil { return nil, eerrs.ErrEmailAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return nil, err } } @@ -396,12 +391,11 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( } } if req.AutoLogin { - chatToken, adminErr := o.Admin.CreateToken(ctx, req.User.UserID, constant.NormalUser) - if err != nil { - log.ZError(ctx, "Admin CreateToken Failed", err, "userID", req.User.UserID, "platform", req.Platform) - } - if adminErr == nil { + chatToken, err := o.Admin.CreateToken(ctx, req.User.UserID, constant.NormalUser) + if err == nil { resp.ChatToken = chatToken.Token + } else { + log.ZError(ctx, "Admin CreateToken Failed", err, "userID", req.User.UserID, "platform", req.Platform) } } resp.UserID = req.User.UserID @@ -411,7 +405,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginResp, error) { resp := &chat.LoginResp{} if req.Password == "" && req.VerifyCode == "" { - return nil, errs.ErrArgs.Wrap("password or code must be set") + return nil, errs.ErrArgs.WrapMsg("password or code must be set") } var err error var attribute *chat2.Attribute @@ -419,23 +413,23 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes attribute, err = o.Database.GetAttributeByAccount(ctx, req.Account) } else if req.PhoneNumber != "" { if req.AreaCode == "" { - return nil, errs.ErrArgs.Wrap("area code must") + return nil, errs.ErrArgs.WrapMsg("area code must") } if req.AreaCode[0] != '+' { req.AreaCode = "+" + req.AreaCode } if _, err := strconv.ParseUint(req.AreaCode[1:], 10, 64); err != nil { - return nil, errs.ErrArgs.Wrap("area code must be number") + return nil, errs.ErrArgs.WrapMsg("area code must be number") } attribute, err = o.Database.GetAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) } else if req.Email != "" { attribute, err = o.Database.GetAttributeByEmail(ctx, req.Email) } else { - err = errs.ErrArgs.Wrap("account or phone number or email must be set") + err = errs.ErrArgs.WrapMsg("account or phone number or email must be set") } if err != nil { - if o.Database.IsNotFound(err) { - return nil, eerrs.ErrAccountNotFound.Wrap("user unregistered") + if dbutil.IsDBNotFound(err) { + return nil, eerrs.ErrAccountNotFound.WrapMsg("user unregistered") } return nil, err } @@ -444,18 +438,19 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes } var verifyCodeID *string if req.Password == "" { - var id string - var err error + var account string if req.Email == "" { - id, err = o.verifyCode(ctx, o.verifyCodeJoin(req.AreaCode, req.PhoneNumber), req.VerifyCode) + account = o.verifyCodeJoin(req.AreaCode, req.PhoneNumber) } else { - id, err = o.verifyCode(ctx, req.Email, req.VerifyCode) + account = req.Email } - + id, err := o.verifyCode(ctx, account, req.VerifyCode) if err != nil { return nil, err } - verifyCodeID = &id + if id != "" { + verifyCodeID = &id + } } else { account, err := o.Database.GetAccount(ctx, attribute.UserID) if err != nil { diff --git a/internal/rpc/chat/password.go b/internal/rpc/chat/password.go index dc1932b9a..e673d865b 100644 --- a/internal/rpc/chat/password.go +++ b/internal/rpc/chat/password.go @@ -16,16 +16,16 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/proto/chat" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/chat" ) func (o *chatSvr) ResetPassword(ctx context.Context, req *chat.ResetPasswordReq) (*chat.ResetPasswordResp, error) { if req.Password == "" { - return nil, errs.ErrArgs.Wrap("password must be set") + return nil, errs.ErrArgs.WrapMsg("password must be set") } var verifyCodeID string var err error @@ -61,10 +61,10 @@ func (o *chatSvr) ResetPassword(ctx context.Context, req *chat.ResetPasswordReq) func (o *chatSvr) ChangePassword(ctx context.Context, req *chat.ChangePasswordReq) (*chat.ChangePasswordResp, error) { if req.NewPassword == "" { - return nil, errs.ErrArgs.Wrap("new password must be set") + return nil, errs.ErrArgs.WrapMsg("new password must be set") } if req.NewPassword == req.CurrentPassword { - return nil, errs.ErrArgs.Wrap("new password == current password") + return nil, errs.ErrArgs.WrapMsg("new password == current password") } opUserID, userType, err := mctx.Check(ctx) if err != nil { @@ -76,14 +76,14 @@ func (o *chatSvr) ChangePassword(ctx context.Context, req *chat.ChangePasswordRe req.UserID = opUserID } if req.UserID != opUserID { - return nil, errs.ErrNoPermission.Wrap("no permission change other user password") + return nil, errs.ErrNoPermission.WrapMsg("no permission change other user password") } case constant.AdminUser: if req.UserID == "" { - return nil, errs.ErrArgs.Wrap("user id must be set") + return nil, errs.ErrArgs.WrapMsg("user id must be set") } default: - return nil, errs.ErrInternalServer.Wrap("invalid user type") + return nil, errs.ErrInternalServer.WrapMsg("invalid user type") } user, err := o.Database.GetUser(ctx, req.UserID) if err != nil { @@ -91,7 +91,7 @@ func (o *chatSvr) ChangePassword(ctx context.Context, req *chat.ChangePasswordRe } if userType != constant.AdminUser { if user.Password != req.CurrentPassword { - return nil, errs.ErrNoPermission.Wrap("current password is wrong") + return nil, errs.ErrNoPermission.WrapMsg("current password is wrong") } } if user.Password != req.NewPassword { @@ -99,16 +99,5 @@ func (o *chatSvr) ChangePassword(ctx context.Context, req *chat.ChangePasswordRe return nil, err } } - - //imToken, err := o.imApiCaller.UserToken(ctx, config.GetIMAdmin(mctx.GetOpUserID(ctx)), constant2.AdminPlatformID) - //if err != nil { - // return nil, err - //} - // - //err = o.imApiCaller.ForceOffLine(mctx.WithApiToken(ctx, imToken), req.UserID) - //if err != nil { - // return nil, err - //} - return &chat.ChangePasswordResp{}, nil } diff --git a/internal/rpc/chat/rtc.go b/internal/rpc/chat/rtc.go new file mode 100644 index 000000000..2e531f5a3 --- /dev/null +++ b/internal/rpc/chat/rtc.go @@ -0,0 +1,21 @@ +package chat + +import ( + "context" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/chat" +) + +func (o *chatSvr) GetTokenForVideoMeeting(ctx context.Context, req *chat.GetTokenForVideoMeetingReq) (*chat.GetTokenForVideoMeetingResp, error) { + if _, _, err := mctx.Check(ctx); err != nil { + return nil, err + } + token, err := o.Livekit.GetLiveKitToken(req.Room, req.Identity) + if err != nil { + return nil, err + } + return &chat.GetTokenForVideoMeetingResp{ + ServerUrl: o.Livekit.GetLiveKitURL(), + Token: token, + }, err +} diff --git a/internal/rpc/chat/start.go b/internal/rpc/chat/start.go new file mode 100644 index 000000000..7a4a3e7dc --- /dev/null +++ b/internal/rpc/chat/start.go @@ -0,0 +1,94 @@ +package chat + +import ( + "context" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/common/rtc" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "time" + + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/db/database" + "github.com/openimsdk/chat/pkg/email" + chatClient "github.com/openimsdk/chat/pkg/rpclient/chat" + "github.com/openimsdk/chat/pkg/sms" +) + +type Config struct { + RpcConfig config.Chat + RedisConfig config.Redis + MongodbConfig config.Mongo + ZookeeperConfig config.ZooKeeper + Share config.Share +} + +func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error { + if len(config.Share.ChatAdmin) == 0 { + return errs.New("share chat admin not configured") + } + mgocli, err := mongoutil.NewMongoDB(ctx, config.MongodbConfig.Build()) + if err != nil { + return err + } + var srv chatSvr + switch config.RpcConfig.VerifyCode.Phone.Use { + case "ali": + ali := config.RpcConfig.VerifyCode.Phone.Ali + srv.SMS, err = sms.NewAli(ali.Endpoint, ali.AccessKeyID, ali.AccessKeySecret, ali.SignName, ali.VerificationCodeTemplateCode) + if err != nil { + return err + } + } + if mail := config.RpcConfig.VerifyCode.Mail; mail.Enable { + srv.Mail = email.NewMail(mail.SMTPAddr, mail.SMTPPort, mail.SenderMail, mail.SenderAuthorizationCode, mail.Title) + } + srv.Database, err = database.NewChatDatabase(mgocli) + if err != nil { + return err + } + conn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Admin, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return err + } + srv.Admin = chatClient.NewAdminClient(admin.NewAdminClient(conn)) + srv.Code = verifyCode{ + UintTime: time.Duration(config.RpcConfig.VerifyCode.UintTime) * time.Second, + MaxCount: config.RpcConfig.VerifyCode.MaxCount, + ValidCount: config.RpcConfig.VerifyCode.ValidCount, + SuperCode: config.RpcConfig.VerifyCode.SuperCode, + ValidTime: time.Duration(config.RpcConfig.VerifyCode.ValidTime) * time.Second, + Len: config.RpcConfig.VerifyCode.Len, + } + srv.Livekit = rtc.NewLiveKit(config.RpcConfig.LiveKit.Key, config.RpcConfig.LiveKit.Secret, config.RpcConfig.LiveKit.URL) + chat.RegisterChatServer(server, &srv) + return nil +} + +type chatSvr struct { + Database database.ChatDatabaseInterface + Admin *chatClient.AdminClient + SMS sms.SMS + Mail email.Mail + Code verifyCode + Livekit *rtc.LiveKit + ChatAdminUserID string +} + +func (o *chatSvr) WithAdminUser(ctx context.Context) context.Context { + return mctx.WithAdminUser(ctx, o.ChatAdminUserID) +} + +type verifyCode struct { + UintTime time.Duration // sec + MaxCount int + ValidCount int + SuperCode string + ValidTime time.Duration + Len int +} diff --git a/internal/rpc/chat/statistic.go b/internal/rpc/chat/statistic.go index 9651ef041..ec7ff3ab4 100644 --- a/internal/rpc/chat/statistic.go +++ b/internal/rpc/chat/statistic.go @@ -18,14 +18,14 @@ import ( "context" "time" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/errs" ) func (o *chatSvr) UserLoginCount(ctx context.Context, req *chat.UserLoginCountReq) (*chat.UserLoginCountResp, error) { resp := &chat.UserLoginCountResp{} if req.Start > req.End { - return nil, errs.ErrArgs.Wrap("start > end") + return nil, errs.ErrArgs.WrapMsg("start > end") } total, err := o.Database.NewUserCountTotal(ctx, nil) if err != nil { diff --git a/internal/rpc/chat/update.go b/internal/rpc/chat/update.go index a76fe6777..169694fff 100644 --- a/internal/rpc/chat/update.go +++ b/internal/rpc/chat/update.go @@ -17,9 +17,9 @@ package chat import ( "time" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" - "github.com/OpenIMSDK/chat/pkg/proto/chat" + "github.com/openimsdk/chat/pkg/protocol/chat" ) func ToDBAttributeUpdate(req *chat.UpdateUserInfoReq) (map[string]any, error) { @@ -35,7 +35,7 @@ func ToDBAttributeUpdate(req *chat.UpdateUserInfoReq) (map[string]any, error) { } if req.Nickname != nil { if req.Nickname.Value == "" { - return nil, errs.ErrArgs.Wrap("nickname can not be empty") + return nil, errs.ErrArgs.WrapMsg("nickname can not be empty") } update["nickname"] = req.Nickname.Value } @@ -64,7 +64,7 @@ func ToDBAttributeUpdate(req *chat.UpdateUserInfoReq) (map[string]any, error) { update["global_recv_msg_opt"] = req.GlobalRecvMsgOpt.Value } if len(update) == 0 { - return nil, errs.ErrArgs.Wrap("no update info") + return nil, errs.ErrArgs.WrapMsg("no update info") } return update, nil } diff --git a/internal/rpc/chat/user.go b/internal/rpc/chat/user.go index 28624342b..61ac31ece 100644 --- a/internal/rpc/chat/user.go +++ b/internal/rpc/chat/user.go @@ -16,18 +16,17 @@ package chat import ( "context" - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - chat2 "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/chat/pkg/common/rtc" - constant2 "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/mcontext" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + chat2 "github.com/openimsdk/chat/pkg/common/db/table/chat" + constant2 "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/mcontext" "time" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/tools/errs" ) func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoReq) (*chat.UpdateUserInfoResp, error) { @@ -37,7 +36,7 @@ func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoRe return nil, err } if req.UserID == "" { - return nil, errs.ErrArgs.Wrap("user id is empty") + return nil, errs.ErrArgs.WrapMsg("user id is empty") } switch userType { case constant.NormalUser: @@ -45,23 +44,23 @@ func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoRe // req.UserID = opUserID //} if req.UserID != opUserID { - return nil, errs.ErrNoPermission.Wrap("only admin can update other user info") + return nil, errs.ErrNoPermission.WrapMsg("only admin can update other user info") } if req.AreaCode != nil { - return nil, errs.ErrNoPermission.Wrap("areaCode can not be updated") + return nil, errs.ErrNoPermission.WrapMsg("areaCode can not be updated") } if req.PhoneNumber != nil { - return nil, errs.ErrNoPermission.Wrap("phoneNumber can not be updated") + return nil, errs.ErrNoPermission.WrapMsg("phoneNumber can not be updated") } if req.Account != nil { - return nil, errs.ErrNoPermission.Wrap("account can not be updated") + return nil, errs.ErrNoPermission.WrapMsg("account can not be updated") } if req.Level != nil { - return nil, errs.ErrNoPermission.Wrap("level can not be updated") + return nil, errs.ErrNoPermission.WrapMsg("level can not be updated") } case constant.AdminUser: default: - return nil, errs.ErrNoPermission.Wrap("user type error") + return nil, errs.ErrNoPermission.WrapMsg("user type error") } update, err := ToDBAttributeUpdate(req) if err != nil { @@ -75,7 +74,7 @@ func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoRe _, err := o.Database.TakeAttributeByAccount(ctx, req.Account.Value) if err == nil { return nil, eerrs.ErrAccountAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return nil, err } } @@ -92,7 +91,7 @@ func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoRe _, err := o.Database.TakeAttributeByPhone(ctx, areaCode, phoneNumber) if err == nil { return nil, eerrs.ErrAccountAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return nil, err } } @@ -105,7 +104,7 @@ func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoRe func (o *chatSvr) FindUserPublicInfo(ctx context.Context, req *chat.FindUserPublicInfoReq) (*chat.FindUserPublicInfoResp, error) { if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("UserIDs is empty") + return nil, errs.ErrArgs.WrapMsg("UserIDs is empty") } attributes, err := o.Database.FindAttribute(ctx, req.UserIDs) if err != nil { @@ -139,7 +138,7 @@ func (o *chatSvr) AddUserAccount(ctx context.Context, req *chat.AddUserAccountRe } } if req.User.UserID == "" { - return nil, errs.ErrInternalServer.Wrap("gen user id failed") + return nil, errs.ErrInternalServer.WrapMsg("gen user id failed") } } @@ -202,7 +201,7 @@ func (o *chatSvr) FindUserFullInfo(ctx context.Context, req *chat.FindUserFullIn return nil, err } if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("UserIDs is empty") + return nil, errs.ErrArgs.WrapMsg("UserIDs is empty") } attributes, err := o.Database.FindAttribute(ctx, req.UserIDs) if err != nil { @@ -227,7 +226,7 @@ func (o *chatSvr) SearchUserFullInfo(ctx context.Context, req *chat.SearchUserFu func (o *chatSvr) FindUserAccount(ctx context.Context, req *chat.FindUserAccountReq) (*chat.FindUserAccountResp, error) { if len(req.UserIDs) == 0 { - return nil, errs.ErrArgs.Wrap("user id list must be set") + return nil, errs.ErrArgs.WrapMsg("user id list must be set") } if _, _, err := mctx.CheckAdminOrUser(ctx); err != nil { return nil, err @@ -245,7 +244,7 @@ func (o *chatSvr) FindUserAccount(ctx context.Context, req *chat.FindUserAccount func (o *chatSvr) FindAccountUser(ctx context.Context, req *chat.FindAccountUserReq) (*chat.FindAccountUserResp, error) { if len(req.Accounts) == 0 { - return nil, errs.ErrArgs.Wrap("account list must be set") + return nil, errs.ErrArgs.WrapMsg("account list must be set") } if _, _, err := mctx.CheckAdminOrUser(ctx); err != nil { return nil, err @@ -275,34 +274,19 @@ func (o *chatSvr) SearchUserInfo(ctx context.Context, req *chat.SearchUserInfoRe }, nil } -func (o *chatSvr) GetTokenForVideoMeeting(ctx context.Context, req *chat.GetTokenForVideoMeetingReq) (*chat.GetTokenForVideoMeetingResp, error) { - if _, _, err := mctx.Check(ctx); err != nil { - return nil, err - } - serverUrl := rtc.GetLiveKitServerUrl() - token, err := rtc.GetLiveKitToken(req.Room, req.Identity) - if err != nil { - return nil, err - } - return &chat.GetTokenForVideoMeetingResp{ - ServerUrl: serverUrl, - Token: token, - }, err -} - func (o *chatSvr) checkTheUniqueness(ctx context.Context, req *chat.AddUserAccountReq) error { if req.User.PhoneNumber != "" { _, err := o.Database.TakeAttributeByPhone(ctx, req.User.AreaCode, req.User.PhoneNumber) if err == nil { return eerrs.ErrPhoneAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return err } } else { _, err := o.Database.TakeAttributeByEmail(ctx, req.User.Email) if err == nil { return eerrs.ErrEmailAlreadyRegister.Wrap() - } else if !o.Database.IsNotFound(err) { + } else if !dbutil.IsDBNotFound(err) { return err } } diff --git a/internal/rpc/chat/utils.go b/internal/rpc/chat/utils.go index 45865c6ba..03a95d0df 100644 --- a/internal/rpc/chat/utils.go +++ b/internal/rpc/chat/utils.go @@ -15,10 +15,9 @@ package chat import ( - "github.com/OpenIMSDK/tools/utils" - - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/chat/pkg/proto/common" + "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/protocol/common" + "github.com/openimsdk/tools/utils/datautil" ) func DbToPbAttribute(attribute *chat.Attribute) *common.UserPublicInfo { @@ -37,7 +36,7 @@ func DbToPbAttribute(attribute *chat.Attribute) *common.UserPublicInfo { } func DbToPbAttributes(attributes []*chat.Attribute) []*common.UserPublicInfo { - return utils.Slice(attributes, DbToPbAttribute) + return datautil.Slice(attributes, DbToPbAttribute) } func DbToPbUserFullInfo(attribute *chat.Attribute) *common.UserFullInfo { @@ -62,23 +61,5 @@ func DbToPbUserFullInfo(attribute *chat.Attribute) *common.UserFullInfo { } func DbToPbUserFullInfos(attributes []*chat.Attribute) []*common.UserFullInfo { - return utils.Slice(attributes, DbToPbUserFullInfo) -} - -func DbToPbLogInfo(log *chat.Log) *common.LogInfo { - return &common.LogInfo{ - Filename: log.FileName, - UserID: log.UserID, - Platform: utils.StringToInt32(log.Platform), - Url: log.Url, - CreateTime: log.CreateTime.UnixMilli(), - LogID: log.LogID, - SystemType: log.SystemType, - Version: log.Version, - Ex: log.Ex, - } -} - -func DbToPbLogInfos(logs []*chat.Log) []*common.LogInfo { - return utils.Slice(logs, DbToPbLogInfo) + return datautil.Slice(attributes, DbToPbUserFullInfo) } diff --git a/magefile.go b/magefile.go new file mode 100644 index 000000000..98ffa48f3 --- /dev/null +++ b/magefile.go @@ -0,0 +1,43 @@ +//go:build mage +// +build mage + +package main + +import ( + "github.com/openimsdk/gomake/mageutil" + "os" + "strings" +) + +var Default = Build + +func Build() { + platforms := os.Getenv("PLATFORMS") + if platforms == "" { + platforms = mageutil.DetectPlatform() + } + + for _, platform := range strings.Split(platforms, " ") { + mageutil.CompileForPlatform(platform) + } + + mageutil.PrintGreen("All binaries under cmd and tools were successfully compiled.") +} + +func Start() { + mageutil.InitForSSC() + err := setMaxOpenFiles() + if err != nil { + mageutil.PrintRed("setMaxOpenFiles failed " + err.Error()) + os.Exit(1) + } + mageutil.StartToolsAndServices() +} + +func Stop() { + mageutil.StopAndCheckBinaries() +} + +func Check() { + mageutil.CheckAndReportBinariesStatus() +} diff --git a/magefile_unix.go b/magefile_unix.go new file mode 100644 index 000000000..ff6b6de4e --- /dev/null +++ b/magefile_unix.go @@ -0,0 +1,20 @@ +//go:build mage && !windows +// +build mage,!windows + +package main + +import ( + "github.com/openimsdk/gomake/mageutil" + "syscall" +) + +func setMaxOpenFiles() error { + var rLimit syscall.Rlimit + err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit) + if err != nil { + return err + } + rLimit.Max = uint64(mageutil.MaxFileDescriptors) + rLimit.Cur = uint64(mageutil.MaxFileDescriptors) + return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) +} diff --git a/magefile_windows.go b/magefile_windows.go new file mode 100644 index 000000000..7441bfd9c --- /dev/null +++ b/magefile_windows.go @@ -0,0 +1,8 @@ +//go:build mage +// +build mage + +package main + +func setMaxOpenFiles() error { + return nil +} diff --git a/pkg/common/apistruct/admin.go b/pkg/common/apistruct/admin.go index f910fb6c3..ff44181d5 100644 --- a/pkg/common/apistruct/admin.go +++ b/pkg/common/apistruct/admin.go @@ -14,7 +14,7 @@ package apistruct -import "github.com/OpenIMSDK/protocol/sdkws" +import "github.com/openimsdk/protocol/sdkws" type AdminLoginResp struct { AdminAccount string `json:"adminAccount"` diff --git a/pkg/common/apistruct/chat.go b/pkg/common/apistruct/chat.go index 4496c230a..ba6a2690e 100644 --- a/pkg/common/apistruct/chat.go +++ b/pkg/common/apistruct/chat.go @@ -14,7 +14,7 @@ package apistruct -import "github.com/OpenIMSDK/protocol/sdkws" +import "github.com/openimsdk/protocol/sdkws" type UserRegisterResp struct { ImToken string `json:"imToken"` @@ -130,4 +130,4 @@ type SendMsg struct { // OfflinePushInfo contains information for offline push notifications. OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"` -} \ No newline at end of file +} diff --git a/pkg/common/chatrpcstart/start.go b/pkg/common/chatrpcstart/start.go deleted file mode 100644 index 5d9c3aea8..000000000 --- a/pkg/common/chatrpcstart/start.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chatrpcstart - -import ( - "context" - "errors" - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "net" - "os" - "os/signal" - "strconv" - "sync" - "syscall" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - chatMw "github.com/OpenIMSDK/chat/pkg/common/mw" - "github.com/OpenIMSDK/chat/pkg/discovery_register" - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw" - "github.com/OpenIMSDK/tools/network" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" -) - -func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error { - fmt.Println("start", rpcRegisterName, "server, port: ", rpcPort, "prometheusPort:", prometheusPort, ", OpenIM version: ", config.Version) - - var zkClient discoveryregistry.SvcDiscoveryRegistry - zkClient, err := discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery) - if err != nil { - return errs.Wrap(err, fmt.Sprintf("zookeeper addr: %v", &config.Config.Zookeeper.ZkAddr)) - } - // defer zkClient.CloseZK() - defer zkClient.Close() - zkClient.AddOption(chatMw.AddUserType(), mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) - registerIP, err := network.GetRpcRegisterIP(config.Config.Rpc.RegisterIP) - if err != nil { - return errs.Wrap(err) - } - - rpcTcpAddr := net.JoinHostPort(network.GetListenIP(config.Config.Rpc.ListenIP), strconv.Itoa(rpcPort)) - listener, err := net.Listen("tcp", rpcTcpAddr) - if err != nil { - return errs.Wrap(err, fmt.Sprintf("Server address: %s", rpcTcpAddr)) - } - defer listener.Close() - - srv := grpc.NewServer(append(options, mw.GrpcServer())...) - once := sync.Once{} - defer func() { - once.Do(srv.GracefulStop) - }() - - err = rpcFn(zkClient, srv) - if err != nil { - return err - } - - err = zkClient.Register(rpcRegisterName, registerIP, rpcPort, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return errs.Wrap(err) - } - - var ( - netDone = make(chan struct{}, 1) - netErr error - ) - - go func() { - err := srv.Serve(listener) - if err != nil { - netErr = errs.Wrap(err, "rpc start err: ", rpcTcpAddr) - netDone <- struct{}{} - } - }() - - sigs := make(chan os.Signal, 1) - signal.Notify(sigs, syscall.SIGTERM) - select { - case <-sigs: - util.SIGTERMExit() - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - if err := gracefulStopWithCtx(ctx, srv.GracefulStop); err != nil { - return err - } - case <-netDone: - close(netDone) - return netErr - } - return nil -} - -func gracefulStopWithCtx(ctx context.Context, f func()) error { - done := make(chan struct{}, 1) - go func() { - f() - close(done) - }() - select { - case <-ctx.Done(): - return errs.Wrap(errors.New("timeout, ctx graceful stop")) - case <-done: - return nil - } -} diff --git a/pkg/common/cmd/admin_api.go b/pkg/common/cmd/admin_api.go new file mode 100644 index 000000000..92061096e --- /dev/null +++ b/pkg/common/cmd/admin_api.go @@ -0,0 +1,39 @@ +package cmd + +import ( + "context" + "github.com/openimsdk/chat/internal/api/admin" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" +) + +type AdminApiCmd struct { + *RootCmd + ctx context.Context + configMap map[string]any + apiConfig admin.Config +} + +func NewAdminApiCmd() *AdminApiCmd { + var ret AdminApiCmd + ret.configMap = map[string]any{ + ShareFileName: &ret.apiConfig.Share, + ChatAPIAdminCfgFileName: &ret.apiConfig.ApiConfig, + ZookeeperConfigFileName: &ret.apiConfig.ZookeeperConfig, + } + ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap)) + ret.ctx = context.WithValue(context.Background(), "version", config.Version) + ret.Command.RunE = func(cmd *cobra.Command, args []string) error { + return ret.preRunE() + } + return &ret +} + +func (a *AdminApiCmd) Exec() error { + return a.Execute() +} + +func (a *AdminApiCmd) preRunE() error { + return admin.Start(a.ctx, a.Index(), &a.apiConfig) +} diff --git a/pkg/common/cmd/admin_rpc.go b/pkg/common/cmd/admin_rpc.go new file mode 100644 index 000000000..fdaea8df1 --- /dev/null +++ b/pkg/common/cmd/admin_rpc.go @@ -0,0 +1,58 @@ +// 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 + +import ( + "context" + "github.com/openimsdk/chat/internal/rpc/admin" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/startrpc" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" +) + +type AdminRpcCmd struct { + *RootCmd + ctx context.Context + configMap map[string]any + adminConfig admin.Config +} + +func NewAdminRpcCmd() *AdminRpcCmd { + var ret AdminRpcCmd + ret.configMap = map[string]any{ + ChatRPCAdminCfgFileName: &ret.adminConfig.RpcConfig, + RedisConfigFileName: &ret.adminConfig.RedisConfig, + ZookeeperConfigFileName: &ret.adminConfig.ZookeeperConfig, + MongodbConfigFileName: &ret.adminConfig.MongodbConfig, + ShareFileName: &ret.adminConfig.Share, + } + ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap)) + ret.ctx = context.WithValue(context.Background(), "version", config.Version) + ret.Command.RunE = func(cmd *cobra.Command, args []string) error { + return ret.preRunE() + } + return &ret +} + +func (a *AdminRpcCmd) Exec() error { + return a.Execute() +} + +func (a *AdminRpcCmd) preRunE() error { + return startrpc.Start(a.ctx, &a.adminConfig.ZookeeperConfig, a.adminConfig.RpcConfig.RPC.ListenIP, + a.adminConfig.RpcConfig.RPC.RegisterIP, a.adminConfig.RpcConfig.RPC.Ports, + a.Index(), a.adminConfig.Share.RpcRegisterName.Admin, &a.adminConfig.Share, &a.adminConfig, admin.Start) +} diff --git a/pkg/common/cmd/chat_api.go b/pkg/common/cmd/chat_api.go new file mode 100644 index 000000000..7e500d70d --- /dev/null +++ b/pkg/common/cmd/chat_api.go @@ -0,0 +1,39 @@ +package cmd + +import ( + "context" + "github.com/openimsdk/chat/internal/api/chat" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" +) + +type ChatApiCmd struct { + *RootCmd + ctx context.Context + configMap map[string]any + apiConfig chat.Config +} + +func NewChatApiCmd() *ChatApiCmd { + var ret ChatApiCmd + ret.configMap = map[string]any{ + ShareFileName: &ret.apiConfig.Share, + ChatAPIChatCfgFileName: &ret.apiConfig.ApiConfig, + ZookeeperConfigFileName: &ret.apiConfig.ZookeeperConfig, + } + ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap)) + ret.ctx = context.WithValue(context.Background(), "version", config.Version) + ret.Command.RunE = func(cmd *cobra.Command, args []string) error { + return ret.preRunE() + } + return &ret +} + +func (a *ChatApiCmd) Exec() error { + return a.Execute() +} + +func (a *ChatApiCmd) preRunE() error { + return chat.Start(a.ctx, a.Index(), &a.apiConfig) +} diff --git a/pkg/common/cmd/chat_rpc.go b/pkg/common/cmd/chat_rpc.go new file mode 100644 index 000000000..7acf8dbff --- /dev/null +++ b/pkg/common/cmd/chat_rpc.go @@ -0,0 +1,58 @@ +// 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 + +import ( + "context" + "github.com/openimsdk/chat/internal/rpc/chat" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/startrpc" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" +) + +type ChatRpcCmd struct { + *RootCmd + ctx context.Context + configMap map[string]any + chatConfig chat.Config +} + +func NewChatRpcCmd() *ChatRpcCmd { + var ret ChatRpcCmd + ret.configMap = map[string]any{ + ChatRPCChatCfgFileName: &ret.chatConfig.RpcConfig, + RedisConfigFileName: &ret.chatConfig.RedisConfig, + ZookeeperConfigFileName: &ret.chatConfig.ZookeeperConfig, + MongodbConfigFileName: &ret.chatConfig.MongodbConfig, + ShareFileName: &ret.chatConfig.Share, + } + ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap)) + ret.ctx = context.WithValue(context.Background(), "version", config.Version) + ret.Command.RunE = func(cmd *cobra.Command, args []string) error { + return ret.preRunE() + } + return &ret +} + +func (a *ChatRpcCmd) Exec() error { + return a.Execute() +} + +func (a *ChatRpcCmd) preRunE() error { + return startrpc.Start(a.ctx, &a.chatConfig.ZookeeperConfig, a.chatConfig.RpcConfig.RPC.ListenIP, + a.chatConfig.RpcConfig.RPC.RegisterIP, a.chatConfig.RpcConfig.RPC.Ports, + a.Index(), a.chatConfig.Share.RpcRegisterName.Chat, &a.chatConfig.Share, &a.chatConfig, chat.Start) +} diff --git a/pkg/common/cmd/constant.go b/pkg/common/cmd/constant.go new file mode 100644 index 000000000..75115d642 --- /dev/null +++ b/pkg/common/cmd/constant.go @@ -0,0 +1,60 @@ +// 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 + +import ( + "strings" +) + +var ( + ShareFileName = "share.yml" + RedisConfigFileName = "redis.yml" + ZookeeperConfigFileName = "zookeeper.yml" + MongodbConfigFileName = "mongodb.yml" + LogConfigFileName = "log.yml" + ChatAPIAdminCfgFileName = "chat-api-admin.yml" + ChatAPIChatCfgFileName = "chat-api-chat.yml" + ChatRPCAdminCfgFileName = "chat-rpc-admin.yml" + ChatRPCChatCfgFileName = "chat-rpc-chat.yml" +) + +var ConfigEnvPrefixMap map[string]string + +func init() { + ConfigEnvPrefixMap = make(map[string]string) + fileNames := []string{ + ShareFileName, + RedisConfigFileName, + ZookeeperConfigFileName, + MongodbConfigFileName, + LogConfigFileName, + ChatAPIAdminCfgFileName, + ChatAPIChatCfgFileName, + ChatRPCAdminCfgFileName, + ChatRPCChatCfgFileName, + } + + for _, fileName := range fileNames { + envKey := strings.TrimSuffix(strings.TrimSuffix(fileName, ".yml"), ".yaml") + envKey = "CHATENV_" + envKey + envKey = strings.ToUpper(strings.ReplaceAll(envKey, "-", "_")) + ConfigEnvPrefixMap[fileName] = envKey + } +} + +const ( + FlagConf = "config_folder_path" + FlagTransferIndex = "index" +) diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go new file mode 100644 index 000000000..7c4a3075a --- /dev/null +++ b/pkg/common/cmd/root.go @@ -0,0 +1,159 @@ +// 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 + +import ( + "fmt" + "github.com/openimsdk/chat/pkg/common/config" + "path/filepath" + + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/spf13/cobra" +) + +type RootCmd struct { + Command cobra.Command + processName string + port int + prometheusPort int + log config.Log + index int +} + +func (r *RootCmd) Index() int { + return r.index +} + +func (r *RootCmd) Port() int { + return r.port +} + +type CmdOpts struct { + loggerPrefixName string + configMap map[string]any +} + +func WithLogName(logName string) func(*CmdOpts) { + return func(opts *CmdOpts) { + opts.loggerPrefixName = logName + } +} +func WithConfigMap(configMap map[string]any) func(*CmdOpts) { + return func(opts *CmdOpts) { + opts.configMap = configMap + } +} + +func NewRootCmd(processName string, opts ...func(*CmdOpts)) *RootCmd { + rootCmd := &RootCmd{processName: processName} + cmd := cobra.Command{ + Use: "Start openIM chat application", + Long: fmt.Sprintf(`Start %s `, processName), + PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + return rootCmd.persistentPreRun(cmd, opts...) + }, + SilenceUsage: true, + SilenceErrors: false, + } + cmd.Flags().StringP(FlagConf, "c", "", "path of config directory") + cmd.Flags().IntP(FlagTransferIndex, "i", 0, "process startup sequence number") + + rootCmd.Command = cmd + return rootCmd +} + +func (r *RootCmd) persistentPreRun(cmd *cobra.Command, opts ...func(*CmdOpts)) error { + cmdOpts := r.applyOptions(opts...) + if err := r.initializeConfiguration(cmd, cmdOpts); err != nil { + return err + } + + if err := r.initializeLogger(cmdOpts); err != nil { + return errs.WrapMsg(err, "failed to initialize logger") + } + + return nil +} + +func (r *RootCmd) initializeConfiguration(cmd *cobra.Command, opts *CmdOpts) error { + configDirectory, _, err := r.getFlag(cmd) + if err != nil { + return err + } + // Load common configuration file + //opts.configMap[ShareFileName] = StructEnvPrefix{EnvPrefix: shareEnvPrefix, ConfigStruct: &r.share} + for configFileName, configStruct := range opts.configMap { + err := config.LoadConfig(filepath.Join(configDirectory, configFileName), + ConfigEnvPrefixMap[configFileName], configStruct) + if err != nil { + return err + } + } + // Load common log configuration file + return config.LoadConfig(filepath.Join(configDirectory, LogConfigFileName), + ConfigEnvPrefixMap[LogConfigFileName], &r.log) +} + +func (r *RootCmd) applyOptions(opts ...func(*CmdOpts)) *CmdOpts { + cmdOpts := defaultCmdOpts() + for _, opt := range opts { + opt(cmdOpts) + } + + return cmdOpts +} + +func (r *RootCmd) initializeLogger(cmdOpts *CmdOpts) error { + err := log.InitFromConfig( + cmdOpts.loggerPrefixName, + r.processName, + r.log.RemainLogLevel, + r.log.IsStdout, + r.log.IsJson, + r.log.StorageLocation, + r.log.RemainRotationCount, + r.log.RotationTime, + config.Version, + ) + if err != nil { + return errs.Wrap(err) + } + return errs.Wrap(log.InitConsoleLogger(r.processName, r.log.RemainLogLevel, r.log.IsJson, config.Version)) + +} + +func defaultCmdOpts() *CmdOpts { + return &CmdOpts{ + loggerPrefixName: "openim-chat-log", + } +} + +func (r *RootCmd) getFlag(cmd *cobra.Command) (string, int, error) { + configDirectory, err := cmd.Flags().GetString(FlagConf) + if err != nil { + return "", 0, errs.Wrap(err) + } + index, err := cmd.Flags().GetInt(FlagTransferIndex) + if err != nil { + return "", 0, errs.Wrap(err) + } + r.index = index + return configDirectory, index, nil +} + +func (r *RootCmd) Execute() error { + return r.Command.Execute() +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 025ef8935..e543f166e 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -1,20 +1,10 @@ -// Copyright © 2023 OpenIM open source community. 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 config -import _ "embed" +import ( + _ "embed" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" +) var ( //go:embed version @@ -23,109 +13,143 @@ var ( ImportTemplate []byte ) -var Config struct { - Envs struct { - Discovery string `yaml:"discovery"` - } `yaml:"envs"` - Zookeeper struct { - Schema string `yaml:"schema"` - ZkAddr []string `yaml:"zkAddr"` - Username string `yaml:"username"` - Password string `yaml:"password"` - } `yaml:"zookeeper"` - ChatApi struct { - GinPort []int `yaml:"openImChatApiPort"` - ListenIP string `yaml:"listenIP"` - } `yaml:"chatApi"` - AdminApi struct { - GinPort []int `yaml:"openImAdminApiPort"` - ListenIP string `yaml:"listenIP"` - } `yaml:"adminApi"` - Rpc struct { - RegisterIP string `yaml:"registerIP"` - ListenIP string `yaml:"listenIP"` - } `yaml:"rpc"` - Redis struct { - Address *[]string `yaml:"address"` - Username string `yaml:"username"` - Password string `yaml:"password"` - } `yaml:"redis"` - LiveKit struct { - LiveKitUrl string `yaml:"liveKitUrl"` - Key string `yaml:"key"` - Secret string `yaml:"secret"` - } `yaml:"liveKit"` - RpcPort struct { - OpenImAdminPort []int `yaml:"openImAdminPort"` - OpenImChatPort []int `yaml:"openImChatPort"` - } `yaml:"rpcPort"` - RpcRegisterName struct { - OpenImAdminName string `yaml:"openImAdminName"` - OpenImChatName string `yaml:"openImChatName"` - } `yaml:"rpcRegisterName"` - Mysql *struct { - Address *[]string `yaml:"address"` - Username *string `yaml:"username"` - Password *string `yaml:"password"` - Database *string `yaml:"database"` - MaxOpenConn *int `yaml:"maxOpenConn"` - MaxIdleConn *int `yaml:"maxIdleConn"` - MaxLifeTime *int `yaml:"maxLifeTime"` - LogLevel *int `yaml:"logLevel"` - SlowThreshold *int `yaml:"slowThreshold"` - } `yaml:"mysql"` - Mongo struct { - Uri string `yaml:"uri"` - Address []string `yaml:"address"` - Database string `yaml:"database"` - Username string `yaml:"username"` - Password string `yaml:"password"` - MaxPoolSize int `yaml:"maxPoolSize"` - } `yaml:"mongo"` - Log struct { - StorageLocation *string `yaml:"storageLocation"` - RotationTime *uint `yaml:"rotationTime"` - RemainRotationCount *uint `yaml:"remainRotationCount"` - RemainLogLevel *int `yaml:"remainLogLevel"` - IsStdout *bool `yaml:"isStdout"` - IsJson *bool `yaml:"isJson"` - WithStack *bool `yaml:"withStack"` - } `yaml:"log"` - Secret *string `yaml:"secret"` - ChatSecret string `yaml:"chatSecret"` - OpenIMUrl string `yaml:"openIMUrl"` - TokenPolicy struct { - Expire *int64 `yaml:"expire"` - } `yaml:"tokenPolicy"` +type Share struct { + Env string `mapstructure:"env"` + RpcRegisterName RpcRegisterName `mapstructure:"rpcRegisterName"` + OpenIM struct { + ApiURL string `mapstructure:"apiURL"` + Secret string `mapstructure:"secret"` + AdminUserID string `mapstructure:"adminUserID"` + } `mapstructure:"openIM"` + ChatAdmin []AdminUser `mapstructure:"chatAdmin"` + ProxyHeader string `mapstructure:"proxyHeader"` +} + +type AdminUser struct { + AdminID string `mapstructure:"adminID"` + IMUserID string `mapstructure:"imUserID"` + Nickname string `mapstructure:"nickname"` +} + +type RpcRegisterName struct { + Chat string `mapstructure:"chat"` + Admin string `mapstructure:"admin"` +} + +type API struct { + Api struct { + ListenIP string `mapstructure:"listenIP"` + Ports []int `mapstructure:"ports"` + } `mapstructure:"api"` +} + +type Mongo struct { + URI string `mapstructure:"uri"` + Address []string `mapstructure:"address"` + Database string `mapstructure:"database"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + MaxPoolSize int `mapstructure:"maxPoolSize"` + MaxRetry int `mapstructure:"maxRetry"` +} + +func (m *Mongo) Build() *mongoutil.Config { + return &mongoutil.Config{ + Uri: m.URI, + Address: m.Address, + Database: m.Database, + Username: m.Username, + Password: m.Password, + MaxPoolSize: m.MaxPoolSize, + MaxRetry: m.MaxRetry, + } +} + +type Redis struct { + Address []string `mapstructure:"address"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + EnablePipeline bool `mapstructure:"enablePipeline"` + ClusterMode bool `mapstructure:"clusterMode"` + DB int `mapstructure:"db"` + MaxRetry int `mapstructure:"MaxRetry"` +} + +func (r *Redis) Build() *redisutil.Config { + return &redisutil.Config{ + ClusterMode: r.ClusterMode, + Address: r.Address, + Username: r.Username, + Password: r.Password, + DB: r.DB, + MaxRetry: r.MaxRetry, + } +} + +type ZooKeeper struct { + Schema string `mapstructure:"schema"` + Address []string `mapstructure:"address"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` +} + +type Chat struct { + RPC struct { + RegisterIP string `mapstructure:"registerIP"` + ListenIP string `mapstructure:"listenIP"` + Ports []int `mapstructure:"ports"` + } `mapstructure:"rpc"` VerifyCode struct { - ValidTime int `yaml:"validTime"` - UintTime int `yaml:"uintTime"` - MaxCount int `yaml:"maxCount"` - SuperCode string `yaml:"superCode"` - Len int `yaml:"len"` - Use string `yaml:"use"` - Ali struct { - Endpoint string `yaml:"endpoint"` - AccessKeyId string `yaml:"accessKeyId"` - AccessKeySecret string `yaml:"accessKeySecret"` - SignName string `yaml:"signName"` - VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"` - } `yaml:"ali"` + ValidTime int `mapstructure:"validTime"` + ValidCount int `mapstructure:"validCount"` + UintTime int `mapstructure:"uintTime"` + MaxCount int `mapstructure:"maxCount"` + SuperCode string `mapstructure:"superCode"` + Len int `mapstructure:"len"` + Phone struct { + Use string `mapstructure:"use"` + Ali struct { + Endpoint string `mapstructure:"endpoint"` + AccessKeyID string `mapstructure:"accessKeyId"` + AccessKeySecret string `mapstructure:"accessKeySecret"` + SignName string `mapstructure:"signName"` + VerificationCodeTemplateCode string `mapstructure:"verificationCodeTemplateCode"` + } `mapstructure:"ali"` + } `mapstructure:"phone"` Mail struct { - Title string `yaml:"title"` - SenderMail string `yaml:"senderMail"` - SenderAuthorizationCode string `yaml:"senderAuthorizationCode"` - SmtpAddr string `yaml:"smtpAddr"` - SmtpPort int `yaml:"smtpPort"` - } `yaml:"mail"` - } `yaml:"verifyCode"` - ProxyHeader string `yaml:"proxyHeader"` - AdminList []Admin `yaml:"adminList"` - ChatAdmin []Admin `yaml:"chatAdmin"` + Enable bool `mapstructure:"enable"` + Title string `mapstructure:"title"` + SenderMail string `mapstructure:"senderMail"` + SenderAuthorizationCode string `mapstructure:"senderAuthorizationCode"` + SMTPAddr string `mapstructure:"smtpAddr"` + SMTPPort int `mapstructure:"smtpPort"` + } `mapstructure:"mail"` + } `mapstructure:"verifyCode"` + LiveKit struct { + URL string `mapstructure:"url"` + Key string `mapstructure:"key"` + Secret string `mapstructure:"secret"` + } `mapstructure:"liveKit"` } type Admin struct { - AdminID string `yaml:"adminID"` - NickName string `yaml:"nickname"` - ImAdminID string `yaml:"imAdmin"` + RPC struct { + RegisterIP string `mapstructure:"registerIP"` + ListenIP string `mapstructure:"listenIP"` + Ports []int `mapstructure:"ports"` + } `mapstructure:"rpc"` + TokenPolicy struct { + Expire int `mapstructure:"expire"` + } `mapstructure:"tokenPolicy"` + Secret string `mapstructure:"secret"` +} + +type Log struct { + StorageLocation string `mapstructure:"storageLocation"` + RotationTime uint `mapstructure:"rotationTime"` + RemainRotationCount uint `mapstructure:"remainRotationCount"` + RemainLogLevel int `mapstructure:"remainLogLevel"` + IsStdout bool `mapstructure:"isStdout"` + IsJson bool `mapstructure:"isJson"` + WithStack bool `mapstructure:"withStack"` } diff --git a/pkg/common/config/im.go b/pkg/common/config/im.go deleted file mode 100644 index 3cc8257d3..000000000 --- a/pkg/common/config/im.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 config - -var imConfig struct { - Mysql struct { - Address []string `yaml:"address"` - Username string `yaml:"username"` - Password string `yaml:"password"` - Database string `yaml:"database"` - MaxOpenConn int `yaml:"maxOpenConn"` - MaxIdleConn int `yaml:"maxIdleConn"` - MaxLifeTime int `yaml:"maxLifeTime"` - LogLevel int `yaml:"logLevel"` - SlowThreshold int `yaml:"slowThreshold"` - } `yaml:"mysql"` - - Mongo struct { - Uri string `yaml:"uri"` - Address []string `yaml:"address"` - Database string `yaml:"database"` - Username string `yaml:"username"` - Password string `yaml:"password"` - MaxPoolSize int `yaml:"maxPoolSize"` - } `yaml:"mongo"` - - Redis struct { - Address []string `yaml:"address"` - Username string `yaml:"username"` - Password string `yaml:"password"` - } `yaml:"redis"` - - LiveKit struct { - LiveKitUrl string `yaml:"liveKitUrl"` - Key string `yaml:"key"` - Secret string `yaml:"secret"` - } `yaml:"liveKit"` - - Rpc struct { - RegisterIP string `yaml:"registerIP"` - ListenIP string `yaml:"listenIP"` - } `yaml:"rpc"` - - Log struct { - StorageLocation string `yaml:"storageLocation"` - RotationTime uint `yaml:"rotationTime"` - RemainRotationCount uint `yaml:"remainRotationCount"` - RemainLogLevel int `yaml:"remainLogLevel"` - IsStdout bool `yaml:"isStdout"` - IsJson bool `yaml:"isJson"` - WithStack bool `yaml:"withStack"` - } `yaml:"log"` - - Manager struct { - UserID []string `yaml:"userID"` - Nickname []string `yaml:"nickname"` - } `yaml:"manager"` - - Secret string `yaml:"secret"` - TokenPolicy struct { - Expire int64 `yaml:"expire"` - } `yaml:"tokenPolicy"` -} diff --git a/pkg/common/config/load.go b/pkg/common/config/load.go new file mode 100644 index 000000000..4101b0b25 --- /dev/null +++ b/pkg/common/config/load.go @@ -0,0 +1,28 @@ +package config + +import ( + "github.com/mitchellh/mapstructure" + "github.com/openimsdk/tools/errs" + "github.com/spf13/viper" + "strings" +) + +func LoadConfig(path string, envPrefix string, config any) error { + v := viper.New() + v.SetConfigFile(path) + v.SetEnvPrefix(envPrefix) + v.AutomaticEnv() + v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + + if err := v.ReadInConfig(); err != nil { + return errs.WrapMsg(err, "failed to read config file", "path", path, "envPrefix", envPrefix) + } + + if err := v.Unmarshal(config, func(config *mapstructure.DecoderConfig) { + config.TagName = "mapstructure" + }); err != nil { + return errs.WrapMsg(err, "failed to unmarshal config", "path", path, "envPrefix", envPrefix) + } + + return nil +} diff --git a/pkg/common/config/parse.go b/pkg/common/config/parse.go deleted file mode 100644 index ad7b41bac..000000000 --- a/pkg/common/config/parse.go +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 config - -import ( - "bytes" - "errors" - "flag" - "fmt" - "github.com/OpenIMSDK/tools/errs" - "os" - "path/filepath" - "runtime" - "strconv" - "strings" - "time" - - Constant "github.com/OpenIMSDK/chat/pkg/common/constant" - "gopkg.in/yaml.v3" -) - -var ( - _, b, _, _ = runtime.Caller(0) - // Root folder of this project. - Root = filepath.Join(filepath.Dir(b), "../..") -) - -func readConfig(configFile string) ([]byte, error) { - b, err := os.ReadFile(configFile) - if err != nil { // File exists and was read successfully - return nil, errs.Wrap(err, configFile) - } - return b, nil - - // //First, check the configFile argument - // if configFile != "" { - // b, err := os.ReadFile(configFile) - // if err == nil { // File exists and was read successfully - // return b, nil - // } - // } - // - // // Second, check for OPENIMCHATCONFIG environment variable - // envConfigPath := os.Getenv("OPENIMCHATCONFIG") - // if envConfigPath != "" { - // b, err := os.ReadFile(envConfigPath) - // if err == nil { // File exists and was read successfully - // return b, nil - // } - // // Again, if there was an error, you can either log it or ignore. - // } - // - // // If neither configFile nor environment variable provided a valid path, use default path - // defaultConfigPath := filepath.Join(Root, "config", "config.yaml") - // b, err := os.ReadFile(defaultConfigPath) - // if err != nil { - // return nil, errs.Wrap(err, defaultConfigPath) - // } - // return b, nil -} - -func InitConfig(configFile string) error { - data, err := readConfig(configFile) - if err != nil { - return errs.Wrap(fmt.Errorf("read loacl config file error: %w", err), "configFile:"+configFile) - } - - if err := yaml.NewDecoder(bytes.NewReader(data)).Decode(&Config); err != nil { - return fmt.Errorf("parse loacl openIMConfig file error: %w", err) - } - - if err := configGetEnv(); err != nil { - return fmt.Errorf("get env error:%w", err) - } - - configData, err := yaml.Marshal(&Config) - fmt.Printf("debug: %s\nconfig:\n%s\n", time.Now(), string(configData)) - - return nil -} - -func configFieldCopy[T any](local **T, remote T) { - if *local == nil { - *local = &remote - } -} - -func GetDefaultIMAdmin() string { - if Config.AdminList[0].AdminID != "" { - return Config.AdminList[0].ImAdminID - } - return Config.ChatAdmin[0].ImAdminID -} - -func GetIMAdmin(chatAdminID string) string { - for _, admin := range Config.AdminList { - if admin.ImAdminID == chatAdminID { - return admin.ImAdminID - } - } - for _, admin := range Config.AdminList { - if admin.AdminID == chatAdminID { - return admin.ImAdminID - } - } - if id := getChatAdmin(chatAdminID); id != "" { - return id - } - return "" -} - -func getChatAdmin(chatAdminID string) string { - for _, admin := range Config.ChatAdmin { - if admin.ImAdminID == chatAdminID { - return admin.ImAdminID - } - } - return "" -} - -type zkLogger struct{} - -func (l *zkLogger) Printf(format string, a ...interface{}) { - fmt.Printf("zk get config %s\n", fmt.Sprintf(format, a...)) -} - -func checkFileExists(filePath string) bool { - info, err := os.Stat(filePath) - if os.IsNotExist(err) { - return false - } - return !info.IsDir() -} - -func findConfigFile(paths []string) (string, error) { - for _, path := range paths { - if checkFileExists(path) { - return path, nil - } - } - return "", fmt.Errorf("configPath not found") -} - -func CreateCatalogPath(path string) []string { - - path1 := filepath.Dir(path) - path1 = filepath.Dir(path1) - // the parent of binary file - pa1 := filepath.Join(path1, Constant.ConfigPath) - path2 := filepath.Dir(path1) - path2 = filepath.Dir(path2) - path2 = filepath.Dir(path2) - // the parent is _output - pa2 := filepath.Join(path2, Constant.ConfigPath) - path3 := filepath.Dir(path2) - // the parent is project(default) - pa3 := filepath.Join(path3, Constant.ConfigPath) - - return []string{pa1, pa2, pa3} - -} - -func findConfigPath(configFile string) (string, error) { - path := make([]string, 10) - - // First, check the configFile argument - if configFile != "" { - if _, err := findConfigFile([]string{configFile}); err != nil { - return "", errs.Wrap(errors.New("the configFile argument path is error")) - } - return configFile, nil - } - - // Second, check for OPENIMCONFIG environment variable - //envConfigPath := os.Getenv(Constant.OpenIMConfig) - envConfigPath := os.Getenv(Constant.OpenIMConfig) - if envConfigPath != "" { - if _, err := findConfigFile([]string{envConfigPath}); err != nil { - return "", errs.Wrap(errors.New("the environment path config path is error")) - } - return envConfigPath, nil - } - // Third, check the catalog to find the config.yaml - - p1, err := os.Executable() - if err != nil { - return "", errs.Wrap(err) - } - - path = CreateCatalogPath(p1) - pathFind, err := findConfigFile(path) - if err == nil { - return pathFind, nil - } - - // Forth, use the Default path. - return "", errs.Wrap(errors.New("the config.yaml path not found")) -} - -func FlagParse() (string, int, bool, error) { - var configFile string - flag.StringVar(&configFile, "config_folder_path", "", "Config full path") - - var ginPort int - flag.IntVar(&ginPort, "port", 10009, "get ginServerPort from cmd") - - var hide bool - flag.BoolVar(&hide, "hide", false, "hide the ComponentCheck result") - - // Version flagqq - var showVersion bool - flag.BoolVar(&showVersion, "version", false, "show version and exit") - - flag.Parse() - - configFile, err := findConfigPath(configFile) - if err != nil { - return "", 0, false, err - } - return configFile, ginPort, showVersion, nil -} - -func configGetEnv() error { - Config.Envs.Discovery = getEnv("ENVS_DISCOVERY", Config.Envs.Discovery) - Config.Zookeeper.Schema = getEnv("ZOOKEEPER_SCHEMA", Config.Zookeeper.Schema) - Config.Zookeeper.Username = getEnv("ZOOKEEPER_USERNAME", Config.Zookeeper.Username) - Config.Zookeeper.Password = getEnv("ZOOKEEPER_PASSWORD", Config.Zookeeper.Password) - - Config.ChatApi.ListenIP = getEnv("CHAT_API_LISTEN_IP", Config.ChatApi.ListenIP) - Config.AdminApi.ListenIP = getEnv("ADMIN_API_LISTEN_IP", Config.AdminApi.ListenIP) - Config.Rpc.RegisterIP = getEnv("RPC_REGISTER_IP", Config.Rpc.RegisterIP) - Config.Rpc.ListenIP = getEnv("RPC_LISTEN_IP", Config.Rpc.ListenIP) - - Config.Log.StorageLocation = getEnvStringPoint("LOG_STORAGE_LOCATION", Config.Log.StorageLocation) - - Config.Secret = getEnvStringPoint("SECRET", Config.Secret) - Config.ProxyHeader = getEnv("PROXY_HEADER", Config.ProxyHeader) - Config.OpenIMUrl = getStringEnv("OPENIM_SERVER_ADDRESS", "API_OPENIM_PORT", Config.OpenIMUrl) - - Config.Redis.Username = getEnv("REDIS_USERNAME", Config.Redis.Username) - Config.Redis.Password = getEnv("REDIS_PASSWORD", Config.Redis.Password) - Config.Redis.Address = getArrPointEnv("REDIS_ADDRESS", "REDIS_PORT", *Config.Redis.Address) - - Config.LiveKit.LiveKitUrl = getEnv("LIVEKIT_URL", Config.LiveKit.LiveKitUrl) - Config.LiveKit.Key = getEnv("LIVEKIT_API_KEY", Config.LiveKit.Key) - Config.LiveKit.Secret = getEnv("LIVEKIT_API_SECRET", Config.LiveKit.Secret) - - var err error - Config.TokenPolicy.Expire, err = getEnvIntPoint("TOKEN_EXPIRE", Config.TokenPolicy.Expire) - if err != nil { - return err - } - Config.Zookeeper.ZkAddr = getArrEnv("ZOOKEEPER_ADDRESS", "ZOOKEEPER_PORT", Config.Zookeeper.ZkAddr) - return nil -} - -func getArrEnv(key1, key2 string, fallback []string) []string { - address, addrExists := os.LookupEnv(key1) - port, portExists := os.LookupEnv(key2) - - if addrExists && portExists { - addresses := strings.Split(address, ",") - for i, addr := range addresses { - addresses[i] = addr + ":" + port - } - return addresses - } - - if addrExists && !portExists { - addresses := strings.Split(address, ",") - for i, addr := range addresses { - addresses[i] = addr + ":" + "0" - } - return addresses - } - - if !addrExists && portExists { - result := make([]string, len(fallback)) - for i, addr := range fallback { - add := strings.Split(addr, ":") - result[i] = add[0] + ":" + port - } - return result - } - return fallback -} - -func getArrPointEnv(key1, key2 string, fallback []string) *[]string { - address, addrExists := os.LookupEnv(key1) - port, portExists := os.LookupEnv(key2) - - if addrExists && portExists { - addresses := strings.Split(address, ",") - for i, addr := range addresses { - addresses[i] = addr + ":" + port - } - return &addresses - } - - if addrExists && !portExists { - addresses := strings.Split(address, ",") - for i, addr := range addresses { - addresses[i] = addr + ":" + "0" - } - return &addresses - } - - if !addrExists && portExists { - result := make([]string, len(fallback)) - for i, addr := range fallback { - add := strings.Split(addr, ":") - result[i] = add[0] + ":" + port - } - return &result - } - return &fallback -} - -func getStringEnv(key1, key2 string, fallback string) string { - address, addrExists := os.LookupEnv(key1) - port, portExists := os.LookupEnv(key2) - - if addrExists && portExists { - return address + ":" + port - } - - if addrExists && !portExists { - addresses := address + ":" + "0" - return addresses - } - - if !addrExists && portExists { - result := "" - addr := strings.Split(fallback, ":") - result = addr[0] + ":" + port - return result - } - return fallback -} - -func getEnv(key, fallback string) string { - if value, exists := os.LookupEnv(key); exists { - return value - } - return fallback -} - -func getEnvStringPoint(key string, fallback *string) *string { - if value, exists := os.LookupEnv(key); exists { - return &value - } - return fallback -} - -func getEnvIntPoint(key string, fallback *int64) (*int64, error) { - if value, exists := os.LookupEnv(key); exists { - val, err := strconv.Atoi(value) - temp := int64(val) - if err != nil { - return nil, err - } - return &temp, nil - } - return fallback, nil -} diff --git a/pkg/common/config/version b/pkg/common/config/version index 7c7d607d3..b7c8e167d 100644 --- a/pkg/common/config/version +++ b/pkg/common/config/version @@ -1 +1 @@ -v3.3.5 \ No newline at end of file +v1.7.0 \ No newline at end of file diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 914385d59..ed2e77854 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -14,24 +14,13 @@ package constant -import "github.com/OpenIMSDK/protocol/constant" - -// config path -const ( - ConfigPath = "/config/config.yaml" - - OpenIMConfig = "OpenIMConfig" // environment variables -) +import "github.com/openimsdk/protocol/constant" const ( // verificationCode used for. VerificationCodeForRegister = 1 // Register VerificationCodeForResetPassword = 2 // Reset password VerificationCodeForLogin = 3 // Login - - VerificationCodeForRegisterSuffix = "_forRegister" - VerificationCodeForResetSuffix = "_forReset" - VerificationCodeForLoginSuffix = "_forLogin" ) const LogFileName = "chat.log" @@ -55,9 +44,10 @@ const ( AdminMode = "admin" ) +const DefaultAdminLevel = 100 + // user level. const ( - OrdinaryUserLevel = 1 NormalAdmin = 80 AdvancedUserLevel = 100 ) @@ -68,77 +58,17 @@ const ( OrdinaryUserAddFriendDisable = -1 // Do not allow ordinary users to add friends ) -// minioUpload. -const ( - OtherType = 1 - VideoType = 2 - ImageType = 3 -) - -// callback Action. -const ( - ActionAllow = 0 - ActionForbidden = 1 -) - -const ( - ScreenInvitationRegisterAll = 0 // All - ScreenInvitationRegisterUsed = 1 // Used - ScreenInvitationRegisterNotUsed = 2 // Unused -) - -// 1 block; 2 unblock. -const ( - UserBlock = 1 // Account ban - UserUnblock = 2 // Unban -) - const ( NormalUser = 1 AdminUser = 2 ) -const ( - DoNotDisturbModeDisable = 1 - DoNotDisturbModeEnable = 2 -) - -const ( - AllowAddFriend = 1 - NotAllowAddFriend = 2 -) - -const ( - AllowBeep = 1 - NotAllowBeep = 2 -) - -const ( - AllowVibration = 1 - NotAllowVibration = 2 -) - -const ( - AllowSendMsgNotFriend = 1 - NotAllowSendMsgNotFriend = 2 -) - -const ( - NotNeedInvitationCodeRegister = 0 // No invitation code required - NeedInvitationCodeRegister = 1 // Invitation code required -) - // mini-app const ( StatusOnShelf = 1 // OnShelf StatusUnShelf = 2 // UnShelf ) -const ( - LimitIP = 1 - NotLimitIP = 0 -) - const ( LimitNil = 0 // None LimitEmpty = 1 // Neither are restricted @@ -155,15 +85,9 @@ const ( InvitationCodeUnused = 2 // Unused ) -// Default discovery page -const DefaultDiscoverPageURL = "https://doc.rentsoft.cn/#/" - -// const OperationID = "operationID" -// const OpUserID = "opUserID". const ( - RpcOperationID = constant.OperationID - RpcOpUserID = constant.OpUserID - RpcOpUserType = "opUserType" + RpcOpUserID = constant.OpUserID + RpcOpUserType = "opUserType" ) const RpcCustomHeader = constant.RpcCustomHeader @@ -181,8 +105,6 @@ const ( FindNormalUser = 1 ) -const DefaultPlatform = 1 - const CtxApiToken = "api-token" const ( diff --git a/pkg/common/db/cache/init_redis.go b/pkg/common/db/cache/init_redis.go deleted file mode 100644 index e977c2101..000000000 --- a/pkg/common/db/cache/init_redis.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 cache - -import ( - "context" - "errors" - "fmt" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - - "github.com/redis/go-redis/v9" - - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw/specialerror" -) - -const ( - maxRetry = 10 // number of retries -) - -// NewRedis Initialize redis connection. -func NewRedis() (redis.UniversalClient, error) { - if len(*config.Config.Redis.Address) == 0 { - return nil, errs.Wrap(errors.New("redis address is empty")) - } - specialerror.AddReplace(redis.Nil, errs.ErrRecordNotFound) - var rdb redis.UniversalClient - if len(*config.Config.Redis.Address) > 1 { - rdb = redis.NewClusterClient(&redis.ClusterOptions{ - Addrs: *config.Config.Redis.Address, - Username: config.Config.Redis.Username, - Password: config.Config.Redis.Password, // no password set - PoolSize: 50, - MaxRetries: maxRetry, - }) - } else { - rdb = redis.NewClient(&redis.Options{ - Addr: (*config.Config.Redis.Address)[0], - Username: config.Config.Redis.Username, - Password: config.Config.Redis.Password, // no password set - DB: 0, // use default DB - PoolSize: 100, // connection pool size - MaxRetries: maxRetry, - }) - } - - var err error = nil - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - err = rdb.Ping(ctx).Err() - if err != nil { - return nil, fmt.Errorf("redis ping %w", err) - } - return rdb, err -} diff --git a/pkg/common/db/cache/token.go b/pkg/common/db/cache/token.go index 2cc3b3158..a8c09b45e 100644 --- a/pkg/common/db/cache/token.go +++ b/pkg/common/db/cache/token.go @@ -16,9 +16,9 @@ package cache import ( "context" + "github.com/openimsdk/tools/utils/stringutil" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/tools/errs" "github.com/redis/go-redis/v9" ) @@ -52,7 +52,7 @@ func (t *TokenCacheRedis) GetTokensWithoutError(ctx context.Context, userID stri } mm := make(map[string]int32) for k, v := range m { - mm[k] = utils.StringToInt32(v) + mm[k] = stringutil.StringToInt32(v) } return mm, nil } diff --git a/pkg/common/db/database/admin.go b/pkg/common/db/database/admin.go index 73b5e369b..6b076be78 100644 --- a/pkg/common/db/database/admin.go +++ b/pkg/common/db/database/admin.go @@ -16,21 +16,18 @@ package database import ( "context" - "github.com/OpenIMSDK/tools/pagination" - "go.mongodb.org/mongo-driver/mongo" - - "github.com/OpenIMSDK/chat/pkg/common/db/cache" - "github.com/OpenIMSDK/protocol/constant" + "github.com/openimsdk/chat/pkg/common/db/cache" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/db/tx" "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/tx" - - "github.com/OpenIMSDK/chat/pkg/common/db/model/admin" - table "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/db/model/admin" + table "github.com/openimsdk/chat/pkg/common/db/table/admin" ) type AdminDatabaseInterface interface { - InitAdmin(ctx context.Context) error GetAdmin(ctx context.Context, account string) (*table.Admin, error) GetAdminUserID(ctx context.Context, userID string) (*table.Admin, error) UpdateAdmin(ctx context.Context, userID string, update map[string]any) error @@ -80,46 +77,45 @@ type AdminDatabaseInterface interface { GetTokens(ctx context.Context, userID string) (map[string]int32, error) } -func NewAdminDatabase(db *mongo.Database, rdb redis.UniversalClient) (AdminDatabaseInterface, error) { - a, err := admin.NewAdmin(db) +func NewAdminDatabase(cli *mongoutil.Client, rdb redis.UniversalClient) (AdminDatabaseInterface, error) { + a, err := admin.NewAdmin(cli.GetDB()) if err != nil { return nil, err } - forbidden, err := admin.NewIPForbidden(db) + forbidden, err := admin.NewIPForbidden(cli.GetDB()) if err != nil { return nil, err } - forbiddenAccount, err := admin.NewForbiddenAccount(db) + forbiddenAccount, err := admin.NewForbiddenAccount(cli.GetDB()) if err != nil { return nil, err } - limitUserLoginIP, err := admin.NewLimitUserLoginIP(db) + limitUserLoginIP, err := admin.NewLimitUserLoginIP(cli.GetDB()) if err != nil { return nil, err } - invitationRegister, err := admin.NewInvitationRegister(db) + invitationRegister, err := admin.NewInvitationRegister(cli.GetDB()) if err != nil { return nil, err } - registerAddFriend, err := admin.NewRegisterAddFriend(db) + registerAddFriend, err := admin.NewRegisterAddFriend(cli.GetDB()) if err != nil { return nil, err } - registerAddGroup, err := admin.NewRegisterAddGroup(db) + registerAddGroup, err := admin.NewRegisterAddGroup(cli.GetDB()) if err != nil { return nil, err } - applet, err := admin.NewApplet(db) + applet, err := admin.NewApplet(cli.GetDB()) if err != nil { return nil, err } - clientConfig, err := admin.NewClientConfig(db) + clientConfig, err := admin.NewClientConfig(cli.GetDB()) if err != nil { return nil, err } - return &AdminDatabase{ - tx: tx.NewMongo(db.Client()), + tx: cli.GetTx(), admin: a, ipForbidden: forbidden, forbiddenAccount: forbiddenAccount, @@ -134,7 +130,7 @@ func NewAdminDatabase(db *mongo.Database, rdb redis.UniversalClient) (AdminDatab } type AdminDatabase struct { - tx tx.CtxTx + tx tx.Tx admin table.AdminInterface ipForbidden table.IPForbiddenInterface forbiddenAccount table.ForbiddenAccountInterface @@ -147,10 +143,6 @@ type AdminDatabase struct { cache cache.TokenInterface } -func (o *AdminDatabase) InitAdmin(ctx context.Context) error { - return o.admin.InitAdmin(ctx) -} - func (o *AdminDatabase) GetAdmin(ctx context.Context, account string) (*table.Admin, error) { return o.admin.Take(ctx, account) } diff --git a/pkg/common/db/database/chat.go b/pkg/common/db/database/chat.go index ce5c4bef4..3d83cfba9 100644 --- a/pkg/common/db/database/chat.go +++ b/pkg/common/db/database/chat.go @@ -16,21 +16,19 @@ package database import ( "context" - "github.com/OpenIMSDK/chat/pkg/common/db/dbutil" - "github.com/OpenIMSDK/tools/pagination" - "go.mongodb.org/mongo-driver/mongo" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/db/tx" "time" - constant2 "github.com/OpenIMSDK/chat/pkg/common/constant" - admin2 "github.com/OpenIMSDK/chat/pkg/common/db/model/admin" - "github.com/OpenIMSDK/chat/pkg/common/db/model/chat" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - table "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/tools/tx" + constant2 "github.com/openimsdk/chat/pkg/common/constant" + admin2 "github.com/openimsdk/chat/pkg/common/db/model/admin" + "github.com/openimsdk/chat/pkg/common/db/model/chat" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + table "github.com/openimsdk/chat/pkg/common/db/table/chat" ) type ChatDatabaseInterface interface { - IsNotFound(err error) bool GetUser(ctx context.Context, userID string) (account *table.Account, err error) UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any) (err error) FindAttribute(ctx context.Context, userIDs []string) ([]*table.Attribute, error) @@ -58,82 +56,52 @@ type ChatDatabaseInterface interface { NewUserCountTotal(ctx context.Context, before *time.Time) (int64, error) UserLoginCountTotal(ctx context.Context, before *time.Time) (int64, error) UserLoginCountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error) - UploadLogs(ctx context.Context, logs []*table.Log) error - DeleteLogs(ctx context.Context, logID []string, userID string) error - SearchLogs(ctx context.Context, keyword string, start time.Time, end time.Time, pagination pagination.Pagination) (int64, []*table.Log, error) - GetLogs(ctx context.Context, LogIDs []string, userID string) ([]*table.Log, error) } -func NewChatDatabase(db *mongo.Database) (ChatDatabaseInterface, error) { - register, err := chat.NewRegister(db) +func NewChatDatabase(cli *mongoutil.Client) (ChatDatabaseInterface, error) { + register, err := chat.NewRegister(cli.GetDB()) if err != nil { return nil, err } - account, err := chat.NewAccount(db) + account, err := chat.NewAccount(cli.GetDB()) if err != nil { return nil, err } - attribute, err := chat.NewAttribute(db) + attribute, err := chat.NewAttribute(cli.GetDB()) if err != nil { return nil, err } - userLoginRecord, err := chat.NewUserLoginRecord(db) + userLoginRecord, err := chat.NewUserLoginRecord(cli.GetDB()) if err != nil { return nil, err } - verifyCode, err := chat.NewVerifyCode(db) + verifyCode, err := chat.NewVerifyCode(cli.GetDB()) if err != nil { return nil, err } - forbiddenAccount, err := admin2.NewForbiddenAccount(db) - if err != nil { - return nil, err - } - log, err := chat.NewLogs(db) + forbiddenAccount, err := admin2.NewForbiddenAccount(cli.GetDB()) if err != nil { return nil, err } return &ChatDatabase{ - tx: tx.NewMongo(db.Client()), + tx: cli.GetTx(), register: register, account: account, attribute: attribute, userLoginRecord: userLoginRecord, verifyCode: verifyCode, forbiddenAccount: forbiddenAccount, - log: log, }, nil } type ChatDatabase struct { - tx tx.CtxTx + tx tx.Tx register table.RegisterInterface account table.AccountInterface attribute table.AttributeInterface userLoginRecord table.UserLoginRecordInterface verifyCode table.VerifyCodeInterface forbiddenAccount admin.ForbiddenAccountInterface - log table.LogInterface -} - -func (o *ChatDatabase) GetLogs(ctx context.Context, LogIDs []string, userID string) ([]*table.Log, error) { - return o.log.Get(ctx, LogIDs, userID) -} - -func (o *ChatDatabase) DeleteLogs(ctx context.Context, logID []string, userID string) error { - return o.log.Delete(ctx, logID, userID) -} - -func (o *ChatDatabase) SearchLogs(ctx context.Context, keyword string, start time.Time, end time.Time, pagination pagination.Pagination) (int64, []*table.Log, error) { - return o.log.Search(ctx, keyword, start, end, pagination) -} - -func (o *ChatDatabase) UploadLogs(ctx context.Context, logs []*table.Log) error { - return o.log.Create(ctx, logs) -} - -func (o *ChatDatabase) IsNotFound(err error) bool { - return dbutil.IsDBNotFound(err) } func (o *ChatDatabase) GetUser(ctx context.Context, userID string) (account *table.Account, err error) { diff --git a/pkg/common/db/dbutil/gorm.go b/pkg/common/db/dbutil/gorm.go index 7991a1ba2..1a6cd56e8 100644 --- a/pkg/common/db/dbutil/gorm.go +++ b/pkg/common/db/dbutil/gorm.go @@ -15,7 +15,7 @@ package dbutil import ( - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/mongo" ) diff --git a/pkg/common/db/model/admin/admin.go b/pkg/common/db/model/admin/admin.go index 92c72b0c8..edf87f7d6 100644 --- a/pkg/common/db/model/admin/admin.go +++ b/pkg/common/db/model/admin/admin.go @@ -16,19 +16,14 @@ package admin import ( "context" - "crypto/md5" - "encoding/hex" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" ) func NewAdmin(db *mongo.Database) (admin.AdminInterface, error) { @@ -52,26 +47,26 @@ type Admin struct { } func (o *Admin) Take(ctx context.Context, account string) (*admin.Admin, error) { - return mgoutil.FindOne[*admin.Admin](ctx, o.coll, bson.M{"account": account}) + return mongoutil.FindOne[*admin.Admin](ctx, o.coll, bson.M{"account": account}) } func (o *Admin) TakeUserID(ctx context.Context, userID string) (*admin.Admin, error) { - return mgoutil.FindOne[*admin.Admin](ctx, o.coll, bson.M{"user_id": userID}) + return mongoutil.FindOne[*admin.Admin](ctx, o.coll, bson.M{"user_id": userID}) } func (o *Admin) Update(ctx context.Context, account string, update map[string]any) error { if len(update) == 0 { return nil } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": account}, bson.M{"$set": update}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": account}, bson.M{"$set": update}, false) } func (o *Admin) Create(ctx context.Context, admins []*admin.Admin) error { - return mgoutil.InsertMany(ctx, o.coll, admins) + return mongoutil.InsertMany(ctx, o.coll, admins) } func (o *Admin) ChangePassword(ctx context.Context, userID string, newPassword string) error { - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": bson.M{"password": newPassword}}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": bson.M{"password": newPassword}}, false) } @@ -79,54 +74,11 @@ func (o *Admin) Delete(ctx context.Context, userIDs []string) error { if len(userIDs) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) } func (o *Admin) Search(ctx context.Context, pagination pagination.Pagination) (int64, []*admin.Admin, error) { opt := options.Find().SetSort(bson.D{{"create_time", -1}}) filter := bson.M{"level": constant.NormalAdmin} - return mgoutil.FindPage[*admin.Admin](ctx, o.coll, filter, pagination, opt) -} - -func (o *Admin) InitAdmin(ctx context.Context) error { - filter := bson.M{} - count, err := mgoutil.Count(ctx, o.coll, filter) - if err != nil { - return errs.Wrap(err) - } - if count > 0 { - return nil - } - if len(config.Config.ChatAdmin) == 0 { - return nil - } - - admins := make([]*admin.Admin, 0, len(config.Config.ChatAdmin)) - o.createAdmins(&admins, config.Config.ChatAdmin) - - return mgoutil.InsertMany(ctx, o.coll, admins) -} - -func (o *Admin) createAdmins(adminList *[]*admin.Admin, registerList []config.Admin) { - // chatAdmin set the level to 50, this account use for send notification. - for _, adminChat := range registerList { - table := admin.Admin{ - Account: adminChat.AdminID, - UserID: adminChat.ImAdminID, - Password: o.passwordEncryption(adminChat.AdminID), - Level: 100, - CreateTime: time.Now(), - } - if adminChat.NickName != "" { - table.Nickname = adminChat.NickName - } else { - table.Nickname = adminChat.AdminID - } - *adminList = append(*adminList, &table) - } -} - -func (o *Admin) passwordEncryption(password string) string { - paswd := md5.Sum([]byte(password)) - return hex.EncodeToString(paswd[:]) + return mongoutil.FindPage[*admin.Admin](ctx, o.coll, filter, pagination, opt) } diff --git a/pkg/common/db/model/admin/applet.go b/pkg/common/db/model/admin/applet.go index b5ec69322..57fa6c704 100644 --- a/pkg/common/db/model/admin/applet.go +++ b/pkg/common/db/model/admin/applet.go @@ -16,15 +16,15 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewApplet(db *mongo.Database) (admin.AppletInterface, error) { @@ -48,25 +48,25 @@ type Applet struct { } func (o *Applet) Create(ctx context.Context, applets []*admin.Applet) error { - return mgoutil.InsertMany(ctx, o.coll, applets) + return mongoutil.InsertMany(ctx, o.coll, applets) } func (o *Applet) Del(ctx context.Context, ids []string) error { if len(ids) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"id": bson.M{"$in": ids}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"id": bson.M{"$in": ids}}) } func (o *Applet) Update(ctx context.Context, id string, data map[string]any) error { if len(data) == 0 { return nil } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"id": id}, bson.M{"$set": data}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"id": id}, bson.M{"$set": data}, false) } func (o *Applet) Take(ctx context.Context, id string) (*admin.Applet, error) { - return mgoutil.FindOne[*admin.Applet](ctx, o.coll, bson.M{"id": id}) + return mongoutil.FindOne[*admin.Applet](ctx, o.coll, bson.M{"id": id}) } @@ -83,15 +83,15 @@ func (o *Applet) Search(ctx context.Context, keyword string, pagination paginati }, } } - return mgoutil.FindPage[*admin.Applet](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.Applet](ctx, o.coll, filter, pagination) } func (o *Applet) FindOnShelf(ctx context.Context) ([]*admin.Applet, error) { - return mgoutil.Find[*admin.Applet](ctx, o.coll, bson.M{"status": constant.StatusOnShelf}) + return mongoutil.Find[*admin.Applet](ctx, o.coll, bson.M{"status": constant.StatusOnShelf}) } func (o *Applet) FindID(ctx context.Context, ids []string) ([]*admin.Applet, error) { - return mgoutil.Find[*admin.Applet](ctx, o.coll, bson.M{"id": bson.M{"$in": ids}}) + return mongoutil.Find[*admin.Applet](ctx, o.coll, bson.M{"id": bson.M{"$in": ids}}) } diff --git a/pkg/common/db/model/admin/client_config.go b/pkg/common/db/model/admin/client_config.go index 7d75516dd..cd79759cf 100644 --- a/pkg/common/db/model/admin/client_config.go +++ b/pkg/common/db/model/admin/client_config.go @@ -16,13 +16,13 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewClientConfig(db *mongo.Database) (admin.ClientConfigInterface, error) { @@ -51,7 +51,7 @@ func (o *ClientConfig) Set(ctx context.Context, config map[string]string) error update := bson.M{ "value": value, } - err := mgoutil.UpdateOne(ctx, o.coll, filter, bson.M{"$set": update}, false, options.Update().SetUpsert(true)) + err := mongoutil.UpdateOne(ctx, o.coll, filter, bson.M{"$set": update}, false, options.Update().SetUpsert(true)) if err != nil { return err } @@ -61,11 +61,11 @@ func (o *ClientConfig) Set(ctx context.Context, config map[string]string) error } func (o *ClientConfig) Del(ctx context.Context, keys []string) error { - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"key": bson.M{"$in": keys}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"key": bson.M{"$in": keys}}) } func (o *ClientConfig) Get(ctx context.Context) (map[string]string, error) { - cs, err := mgoutil.Find[*admin.ClientConfig](ctx, o.coll, bson.M{}) + cs, err := mongoutil.Find[*admin.ClientConfig](ctx, o.coll, bson.M{}) if err != nil { return nil, err } diff --git a/pkg/common/db/model/admin/forbidden_account.go b/pkg/common/db/model/admin/forbidden_account.go index 96ce29a07..d1c8cb163 100644 --- a/pkg/common/db/model/admin/forbidden_account.go +++ b/pkg/common/db/model/admin/forbidden_account.go @@ -16,14 +16,14 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewForbiddenAccount(db *mongo.Database) (admin.ForbiddenAccountInterface, error) { @@ -47,22 +47,22 @@ type ForbiddenAccount struct { } func (o *ForbiddenAccount) Create(ctx context.Context, ms []*admin.ForbiddenAccount) error { - return mgoutil.InsertMany(ctx, o.coll, ms) + return mongoutil.InsertMany(ctx, o.coll, ms) } func (o *ForbiddenAccount) Take(ctx context.Context, userID string) (*admin.ForbiddenAccount, error) { - return mgoutil.FindOne[*admin.ForbiddenAccount](ctx, o.coll, bson.M{"user_id": userID}) + return mongoutil.FindOne[*admin.ForbiddenAccount](ctx, o.coll, bson.M{"user_id": userID}) } func (o *ForbiddenAccount) Delete(ctx context.Context, userIDs []string) error { if len(userIDs) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) } func (o *ForbiddenAccount) Find(ctx context.Context, userIDs []string) ([]*admin.ForbiddenAccount, error) { - return mgoutil.Find[*admin.ForbiddenAccount](ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) + return mongoutil.Find[*admin.ForbiddenAccount](ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) } func (o *ForbiddenAccount) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*admin.ForbiddenAccount, error) { @@ -77,9 +77,9 @@ func (o *ForbiddenAccount) Search(ctx context.Context, keyword string, paginatio }, } } - return mgoutil.FindPage[*admin.ForbiddenAccount](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.ForbiddenAccount](ctx, o.coll, filter, pagination) } func (o *ForbiddenAccount) FindAllIDs(ctx context.Context) ([]string, error) { - return mgoutil.Find[string](ctx, o.coll, bson.M{}, options.Find().SetProjection(bson.M{"_id": 0, "user_id": 1})) + return mongoutil.Find[string](ctx, o.coll, bson.M{}, options.Find().SetProjection(bson.M{"_id": 0, "user_id": 1})) } diff --git a/pkg/common/db/model/admin/invitation_register.go b/pkg/common/db/model/admin/invitation_register.go index 250af19f1..591102f5e 100644 --- a/pkg/common/db/model/admin/invitation_register.go +++ b/pkg/common/db/model/admin/invitation_register.go @@ -16,15 +16,15 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewInvitationRegister(db *mongo.Database) (admin.InvitationRegisterInterface, error) { @@ -48,29 +48,29 @@ type InvitationRegister struct { } func (o *InvitationRegister) Find(ctx context.Context, codes []string) ([]*admin.InvitationRegister, error) { - return mgoutil.Find[*admin.InvitationRegister](ctx, o.coll, bson.M{"invitation_code": bson.M{"$in": codes}}) + return mongoutil.Find[*admin.InvitationRegister](ctx, o.coll, bson.M{"invitation_code": bson.M{"$in": codes}}) } func (o *InvitationRegister) Del(ctx context.Context, codes []string) error { if len(codes) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"invitation_code": bson.M{"$in": codes}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"invitation_code": bson.M{"$in": codes}}) } func (o *InvitationRegister) Create(ctx context.Context, v []*admin.InvitationRegister) error { - return mgoutil.InsertMany(ctx, o.coll, v) + return mongoutil.InsertMany(ctx, o.coll, v) } func (o *InvitationRegister) Take(ctx context.Context, code string) (*admin.InvitationRegister, error) { - return mgoutil.FindOne[*admin.InvitationRegister](ctx, o.coll, bson.M{"code": code}) + return mongoutil.FindOne[*admin.InvitationRegister](ctx, o.coll, bson.M{"code": code}) } func (o *InvitationRegister) Update(ctx context.Context, code string, data map[string]any) error { if len(data) == 0 { return nil } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"invitation_code": code}, bson.M{"$set": data}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"invitation_code": code}, bson.M{"$set": data}, false) } func (o *InvitationRegister) Search(ctx context.Context, keyword string, state int32, userIDs []string, codes []string, pagination pagination.Pagination) (int64, []*admin.InvitationRegister, error) { @@ -94,6 +94,5 @@ func (o *InvitationRegister) Search(ctx context.Context, keyword string, state i {"user_id": bson.M{"$regex": keyword, "$options": "i"}}, } } - return mgoutil.FindPage[*admin.InvitationRegister](ctx, o.coll, filter, pagination) - + return mongoutil.FindPage[*admin.InvitationRegister](ctx, o.coll, filter, pagination) } diff --git a/pkg/common/db/model/admin/ip_forbidden.go b/pkg/common/db/model/admin/ip_forbidden.go index 29fe67561..97431e9c3 100644 --- a/pkg/common/db/model/admin/ip_forbidden.go +++ b/pkg/common/db/model/admin/ip_forbidden.go @@ -16,15 +16,15 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewIPForbidden(db *mongo.Database) (admin.IPForbiddenInterface, error) { @@ -48,12 +48,12 @@ type IPForbidden struct { } func (o *IPForbidden) Take(ctx context.Context, ip string) (*admin.IPForbidden, error) { - return mgoutil.FindOne[*admin.IPForbidden](ctx, o.coll, bson.M{"ip": ip}) + return mongoutil.FindOne[*admin.IPForbidden](ctx, o.coll, bson.M{"ip": ip}) } func (o *IPForbidden) Find(ctx context.Context, ips []string) ([]*admin.IPForbidden, error) { - return mgoutil.Find[*admin.IPForbidden](ctx, o.coll, bson.M{"ip": bson.M{"$in": ips}}) + return mongoutil.Find[*admin.IPForbidden](ctx, o.coll, bson.M{"ip": bson.M{"$in": ips}}) } @@ -82,16 +82,16 @@ func (o *IPForbidden) Search(ctx context.Context, keyword string, state int32, p {"ip": bson.M{"$regex": keyword, "$options": "i"}}, } } - return mgoutil.FindPage[*admin.IPForbidden](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.IPForbidden](ctx, o.coll, filter, pagination) } func (o *IPForbidden) Create(ctx context.Context, ms []*admin.IPForbidden) error { - return mgoutil.InsertMany(ctx, o.coll, ms) + return mongoutil.InsertMany(ctx, o.coll, ms) } func (o *IPForbidden) Delete(ctx context.Context, ips []string) error { if len(ips) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"ip": bson.M{"$in": ips}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"ip": bson.M{"$in": ips}}) } diff --git a/pkg/common/db/model/admin/limit_user_login_ip.go b/pkg/common/db/model/admin/limit_user_login_ip.go index 7b8962544..55f717ca3 100644 --- a/pkg/common/db/model/admin/limit_user_login_ip.go +++ b/pkg/common/db/model/admin/limit_user_login_ip.go @@ -16,14 +16,14 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewLimitUserLoginIP(db *mongo.Database) (admin.LimitUserLoginIPInterface, error) { @@ -48,15 +48,15 @@ type LimitUserLoginIP struct { } func (o *LimitUserLoginIP) Create(ctx context.Context, ms []*admin.LimitUserLoginIP) error { - return mgoutil.InsertMany(ctx, o.coll, ms) + return mongoutil.InsertMany(ctx, o.coll, ms) } func (o *LimitUserLoginIP) Delete(ctx context.Context, ms []*admin.LimitUserLoginIP) error { - return mgoutil.DeleteMany(ctx, o.coll, o.limitUserLoginIPFilter(ms)) + return mongoutil.DeleteMany(ctx, o.coll, o.limitUserLoginIPFilter(ms)) } func (o *LimitUserLoginIP) Count(ctx context.Context, userID string) (uint32, error) { - count, err := mgoutil.Count(ctx, o.coll, bson.M{"user_id": userID}) + count, err := mongoutil.Count(ctx, o.coll, bson.M{"user_id": userID}) if err != nil { return 0, err } @@ -64,7 +64,7 @@ func (o *LimitUserLoginIP) Count(ctx context.Context, userID string) (uint32, er } func (o *LimitUserLoginIP) Take(ctx context.Context, userID string, ip string) (*admin.LimitUserLoginIP, error) { - return mgoutil.FindOne[*admin.LimitUserLoginIP](ctx, o.coll, bson.M{"user_id": userID, "ip": ip}) + return mongoutil.FindOne[*admin.LimitUserLoginIP](ctx, o.coll, bson.M{"user_id": userID, "ip": ip}) } func (o *LimitUserLoginIP) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*admin.LimitUserLoginIP, error) { @@ -74,7 +74,7 @@ func (o *LimitUserLoginIP) Search(ctx context.Context, keyword string, paginatio {"ip": bson.M{"$regex": keyword, "$options": "i"}}, }, } - return mgoutil.FindPage[*admin.LimitUserLoginIP](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.LimitUserLoginIP](ctx, o.coll, filter, pagination) } diff --git a/pkg/common/db/model/admin/register_add_friend.go b/pkg/common/db/model/admin/register_add_friend.go index 9ed535d85..4810b7eb8 100644 --- a/pkg/common/db/model/admin/register_add_friend.go +++ b/pkg/common/db/model/admin/register_add_friend.go @@ -16,14 +16,14 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewRegisterAddFriend(db *mongo.Database) (admin.RegisterAddFriendInterface, error) { @@ -47,14 +47,14 @@ type RegisterAddFriend struct { } func (o *RegisterAddFriend) Add(ctx context.Context, registerAddFriends []*admin.RegisterAddFriend) error { - return mgoutil.InsertMany(ctx, o.coll, registerAddFriends) + return mongoutil.InsertMany(ctx, o.coll, registerAddFriends) } func (o *RegisterAddFriend) Del(ctx context.Context, userIDs []string) error { if len(userIDs) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) } func (o *RegisterAddFriend) FindUserID(ctx context.Context, userIDs []string) ([]string, error) { @@ -62,10 +62,10 @@ func (o *RegisterAddFriend) FindUserID(ctx context.Context, userIDs []string) ([ if len(userIDs) > 0 { filter["user_id"] = bson.M{"$in": userIDs} } - return mgoutil.Find[string](ctx, o.coll, filter, options.Find().SetProjection(bson.M{"_id": 0, "user_id": 1})) + return mongoutil.Find[string](ctx, o.coll, filter, options.Find().SetProjection(bson.M{"_id": 0, "user_id": 1})) } func (o *RegisterAddFriend) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*admin.RegisterAddFriend, error) { filter := bson.M{"user_id": bson.M{"$regex": keyword, "$options": "i"}} - return mgoutil.FindPage[*admin.RegisterAddFriend](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.RegisterAddFriend](ctx, o.coll, filter, pagination) } diff --git a/pkg/common/db/model/admin/register_add_group.go b/pkg/common/db/model/admin/register_add_group.go index 30378f576..4f7e404e4 100644 --- a/pkg/common/db/model/admin/register_add_group.go +++ b/pkg/common/db/model/admin/register_add_group.go @@ -16,14 +16,14 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/errs" ) func NewRegisterAddGroup(db *mongo.Database) (admin.RegisterAddGroupInterface, error) { @@ -47,14 +47,14 @@ type RegisterAddGroup struct { } func (o *RegisterAddGroup) Add(ctx context.Context, registerAddGroups []*admin.RegisterAddGroup) error { - return mgoutil.InsertMany(ctx, o.coll, registerAddGroups) + return mongoutil.InsertMany(ctx, o.coll, registerAddGroups) } func (o *RegisterAddGroup) Del(ctx context.Context, groupIDs []string) error { if len(groupIDs) == 0 { return nil } - return mgoutil.DeleteMany(ctx, o.coll, bson.M{"group_id": bson.M{"$in": groupIDs}}) + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"group_id": bson.M{"$in": groupIDs}}) } func (o *RegisterAddGroup) FindGroupID(ctx context.Context, groupIDs []string) ([]string, error) { @@ -62,10 +62,10 @@ func (o *RegisterAddGroup) FindGroupID(ctx context.Context, groupIDs []string) ( if len(groupIDs) > 0 { filter["group_id"] = bson.M{"$in": groupIDs} } - return mgoutil.Find[string](ctx, o.coll, filter, options.Find().SetProjection(bson.M{"_id": 0, "group_id": 1})) + return mongoutil.Find[string](ctx, o.coll, filter, options.Find().SetProjection(bson.M{"_id": 0, "group_id": 1})) } func (o *RegisterAddGroup) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*admin.RegisterAddGroup, error) { filter := bson.M{"group_id": bson.M{"$regex": keyword, "$options": "i"}} - return mgoutil.FindPage[*admin.RegisterAddGroup](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*admin.RegisterAddGroup](ctx, o.coll, filter, pagination) } diff --git a/pkg/common/db/model/chat/account.go b/pkg/common/db/model/chat/account.go index ad888850a..4ca37bf45 100644 --- a/pkg/common/db/model/chat/account.go +++ b/pkg/common/db/model/chat/account.go @@ -16,14 +16,14 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mgoutil" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "time" - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/common/db/table/chat" ) func NewAccount(db *mongo.Database) (chat.AccountInterface, error) { @@ -45,20 +45,20 @@ type Account struct { } func (o *Account) Create(ctx context.Context, accounts ...*chat.Account) error { - return mgoutil.InsertMany(ctx, o.coll, accounts) + return mongoutil.InsertMany(ctx, o.coll, accounts) } func (o *Account) Take(ctx context.Context, userId string) (*chat.Account, error) { - return mgoutil.FindOne[*chat.Account](ctx, o.coll, bson.M{"user_id": userId}) + return mongoutil.FindOne[*chat.Account](ctx, o.coll, bson.M{"user_id": userId}) } func (o *Account) Update(ctx context.Context, userID string, data map[string]any) error { if len(data) == 0 { return nil } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": data}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": data}, false) } func (o *Account) UpdatePassword(ctx context.Context, userId string, password string) error { - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userId}, bson.M{"$set": bson.M{"password": password, "change_time": time.Now()}}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userId}, bson.M{"$set": bson.M{"password": password, "change_time": time.Now()}}, false) } diff --git a/pkg/common/db/model/chat/attribute.go b/pkg/common/db/model/chat/attribute.go index c853c595b..f01549aa5 100644 --- a/pkg/common/db/model/chat/attribute.go +++ b/pkg/common/db/model/chat/attribute.go @@ -16,14 +16,14 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/common/db/table/chat" ) func NewAttribute(db *mongo.Database) (chat.AttributeInterface, error) { @@ -63,22 +63,22 @@ type Attribute struct { } func (o *Attribute) Create(ctx context.Context, attribute ...*chat.Attribute) error { - return mgoutil.InsertMany(ctx, o.coll, attribute) + return mongoutil.InsertMany(ctx, o.coll, attribute) } func (o *Attribute) Update(ctx context.Context, userID string, data map[string]any) error { if len(data) == 0 { return nil } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": data}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": data}, false) } func (o *Attribute) Find(ctx context.Context, userIds []string) ([]*chat.Attribute, error) { - return mgoutil.Find[*chat.Attribute](ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIds}}) + return mongoutil.Find[*chat.Attribute](ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIds}}) } func (o *Attribute) FindAccount(ctx context.Context, accounts []string) ([]*chat.Attribute, error) { - return mgoutil.Find[*chat.Attribute](ctx, o.coll, bson.M{"account": bson.M{"$in": accounts}}) + return mongoutil.Find[*chat.Attribute](ctx, o.coll, bson.M{"account": bson.M{"$in": accounts}}) } func (o *Attribute) Search(ctx context.Context, keyword string, genders []int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error) { @@ -96,23 +96,23 @@ func (o *Attribute) Search(ctx context.Context, keyword string, genders []int32, {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, } } - return mgoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) } func (o *Attribute) TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*chat.Attribute, error) { - return mgoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"area_code": areaCode, "phone_number": phoneNumber}) + return mongoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"area_code": areaCode, "phone_number": phoneNumber}) } func (o *Attribute) TakeEmail(ctx context.Context, email string) (*chat.Attribute, error) { - return mgoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"email": email}) + return mongoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"email": email}) } func (o *Attribute) TakeAccount(ctx context.Context, account string) (*chat.Attribute, error) { - return mgoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"account": account}) + return mongoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"account": account}) } func (o *Attribute) Take(ctx context.Context, userID string) (*chat.Attribute, error) { - return mgoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"user_id": userID}) + return mongoutil.FindOne[*chat.Attribute](ctx, o.coll, bson.M{"user_id": userID}) } func (o *Attribute) SearchNormalUser(ctx context.Context, keyword string, forbiddenIDs []string, gender int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error) { @@ -137,7 +137,7 @@ func (o *Attribute) SearchNormalUser(ctx context.Context, keyword string, forbid {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, } } - return mgoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) } func (o *Attribute) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error) { @@ -160,5 +160,5 @@ func (o *Attribute) SearchUser(ctx context.Context, keyword string, userIDs []st {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, } } - return mgoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) + return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) } diff --git a/pkg/common/db/model/chat/log.go b/pkg/common/db/model/chat/log.go deleted file mode 100644 index f6d77992c..000000000 --- a/pkg/common/db/model/chat/log.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mgoutil" - "github.com/OpenIMSDK/tools/pagination" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" -) - -func NewLogs(db *mongo.Database) (chat.LogInterface, error) { - coll := db.Collection("chat_logs") - _, err := coll.Indexes().CreateMany(context.Background(), []mongo.IndexModel{ - { - Keys: bson.D{ - {Key: "log_id", Value: 1}, - }, - Options: options.Index().SetUnique(true), - }, - { - Keys: bson.D{ - {Key: "user_id", Value: 1}, - }, - }, - }) - if err != nil { - return nil, errs.Wrap(err) - } - return &Logs{coll: coll}, nil -} - -type Logs struct { - coll *mongo.Collection -} - -func (l *Logs) Create(ctx context.Context, log []*chat.Log) error { - return mgoutil.InsertMany(ctx, l.coll, log) -} - -func (l *Logs) Search(ctx context.Context, keyword string, start time.Time, end time.Time, pagination pagination.Pagination) (int64, []*chat.Log, error) { - filter := bson.M{} - if end.UnixMilli() == 0 { - filter["create_time"] = bson.M{ - "$gte": start, - } - } else { - filter["create_time"] = bson.M{ - "$gte": start, - "$lte": end, - } - } - if keyword != "" { - filter["user_id"] = bson.M{"$regex": keyword, "$options": "i"} - } - return mgoutil.FindPage[*chat.Log](ctx, l.coll, filter, pagination) -} - -func (l *Logs) Delete(ctx context.Context, logIDs []string, userID string) error { - if len(logIDs) == 0 { - return nil - } - if userID == "" { - return mgoutil.DeleteMany(ctx, l.coll, bson.M{"log_id": bson.M{"$in": logIDs}}) - } - return mgoutil.DeleteMany(ctx, l.coll, bson.M{"log_id": bson.M{"$in": logIDs}, "user_id": userID}) -} - -func (l *Logs) Get(ctx context.Context, logIDs []string, userID string) ([]*chat.Log, error) { - if userID == "" { - return mgoutil.Find[*chat.Log](ctx, l.coll, bson.M{"log_id": bson.M{"$in": logIDs}}) - } - return mgoutil.Find[*chat.Log](ctx, l.coll, bson.M{"log_id": bson.M{"$in": logIDs}, "user_id": userID}) -} diff --git a/pkg/common/db/model/chat/register.go b/pkg/common/db/model/chat/register.go index b3ff0f6b5..38695b561 100644 --- a/pkg/common/db/model/chat/register.go +++ b/pkg/common/db/model/chat/register.go @@ -16,14 +16,14 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "time" - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/tools/errs" ) func NewRegister(db *mongo.Database) (chat.RegisterInterface, error) { @@ -47,7 +47,7 @@ type Register struct { } func (o *Register) Create(ctx context.Context, registers ...*chat.Register) error { - return mgoutil.InsertMany(ctx, o.coll, registers) + return mongoutil.InsertMany(ctx, o.coll, registers) } func (o *Register) CountTotal(ctx context.Context, before *time.Time) (int64, error) { @@ -55,5 +55,5 @@ func (o *Register) CountTotal(ctx context.Context, before *time.Time) (int64, er if before != nil { filter["create_time"] = bson.M{"$lt": before} } - return mgoutil.Count(ctx, o.coll, filter) + return mongoutil.Count(ctx, o.coll, filter) } diff --git a/pkg/common/db/model/chat/user_login_record.go b/pkg/common/db/model/chat/user_login_record.go index fc47f7537..c12352f43 100644 --- a/pkg/common/db/model/chat/user_login_record.go +++ b/pkg/common/db/model/chat/user_login_record.go @@ -16,12 +16,12 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "time" - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/common/db/table/chat" ) func NewUserLoginRecord(db *mongo.Database) (chat.UserLoginRecordInterface, error) { @@ -46,7 +46,7 @@ type UserLoginRecord struct { } func (o *UserLoginRecord) Create(ctx context.Context, records ...*chat.UserLoginRecord) error { - return mgoutil.InsertMany(ctx, o.coll, records) + return mongoutil.InsertMany(ctx, o.coll, records) } func (o *UserLoginRecord) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) { @@ -54,7 +54,7 @@ func (o *UserLoginRecord) CountTotal(ctx context.Context, before *time.Time) (co if before != nil { filter["create_time"] = bson.M{"$lt": before} } - return mgoutil.Count(ctx, o.coll, filter) + return mongoutil.Count(ctx, o.coll, filter) } func (o *UserLoginRecord) CountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error) { @@ -106,7 +106,7 @@ func (o *UserLoginRecord) CountRangeEverydayTotal(ctx context.Context, start *ti ID string `bson:"_id"` Count int64 `bson:"count"` } - res, err := mgoutil.Aggregate[Temp](ctx, o.coll, pipeline) + res, err := mongoutil.Aggregate[Temp](ctx, o.coll, pipeline) if err != nil { return nil, 0, err } diff --git a/pkg/common/db/model/chat/verify_code.go b/pkg/common/db/model/chat/verify_code.go index 756f75e16..55528abcb 100644 --- a/pkg/common/db/model/chat/verify_code.go +++ b/pkg/common/db/model/chat/verify_code.go @@ -16,15 +16,15 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/mgoutil" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "time" - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/tools/errs" ) type mongoVerifyCode struct { @@ -93,7 +93,7 @@ func (o *VerifyCode) Add(ctx context.Context, ms []*chat.VerifyCode) error { CreateTime: m.CreateTime, }) } - return mgoutil.InsertMany(ctx, o.coll, tmp) + return mongoutil.InsertMany(ctx, o.coll, tmp) } func (o *VerifyCode) RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (int64, error) { @@ -104,7 +104,7 @@ func (o *VerifyCode) RangeNum(ctx context.Context, account string, start time.Ti "$lte": end, }, } - return mgoutil.Count(ctx, o.coll, filter) + return mongoutil.Count(ctx, o.coll, filter) } func (o *VerifyCode) TakeLast(ctx context.Context, account string) (*chat.VerifyCode, error) { @@ -112,7 +112,7 @@ func (o *VerifyCode) TakeLast(ctx context.Context, account string) (*chat.Verify "account": account, } opt := options.FindOne().SetSort(bson.M{"_id": -1}) - last, err := mgoutil.FindOne[*mongoVerifyCode](ctx, o.coll, filter, opt) + last, err := mongoutil.FindOne[*mongoVerifyCode](ctx, o.coll, filter, opt) if err != nil { return nil, err } @@ -133,7 +133,7 @@ func (o *VerifyCode) Incr(ctx context.Context, id string) error { if err != nil { return err } - return mgoutil.UpdateOne(ctx, o.coll, bson.M{"_id": objID}, bson.M{"$inc": bson.M{"count": 1}}, false) + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"_id": objID}, bson.M{"$inc": bson.M{"count": 1}}, false) } func (o *VerifyCode) Delete(ctx context.Context, id string) error { @@ -141,5 +141,5 @@ func (o *VerifyCode) Delete(ctx context.Context, id string) error { if err != nil { return err } - return mgoutil.DeleteOne(ctx, o.coll, bson.M{"_id": objID}) + return mongoutil.DeleteOne(ctx, o.coll, bson.M{"_id": objID}) } diff --git a/pkg/common/db/table/admin/admin.go b/pkg/common/db/table/admin/admin.go index a32d522d5..059976b5f 100644 --- a/pkg/common/db/table/admin/admin.go +++ b/pkg/common/db/table/admin/admin.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) @@ -43,5 +43,4 @@ type AdminInterface interface { ChangePassword(ctx context.Context, userID string, newPassword string) error Delete(ctx context.Context, userIDs []string) error Search(ctx context.Context, pagination pagination.Pagination) (int64, []*Admin, error) - InitAdmin(ctx context.Context) error } diff --git a/pkg/common/db/table/admin/applet.go b/pkg/common/db/table/admin/applet.go index 6979fc177..f93a6ad6d 100644 --- a/pkg/common/db/table/admin/applet.go +++ b/pkg/common/db/table/admin/applet.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/forbidden_account.go b/pkg/common/db/table/admin/forbidden_account.go index df9f77091..2e0e5abfd 100644 --- a/pkg/common/db/table/admin/forbidden_account.go +++ b/pkg/common/db/table/admin/forbidden_account.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/invitation_register.go b/pkg/common/db/table/admin/invitation_register.go index 8362bfa3e..40155f453 100644 --- a/pkg/common/db/table/admin/invitation_register.go +++ b/pkg/common/db/table/admin/invitation_register.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/ip_forbidden.go b/pkg/common/db/table/admin/ip_forbidden.go index 02a0a1bb0..39577a9a6 100644 --- a/pkg/common/db/table/admin/ip_forbidden.go +++ b/pkg/common/db/table/admin/ip_forbidden.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/limit_user_login_ip.go b/pkg/common/db/table/admin/limit_user_login_ip.go index bbb81d908..e167f6334 100644 --- a/pkg/common/db/table/admin/limit_user_login_ip.go +++ b/pkg/common/db/table/admin/limit_user_login_ip.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/register_add_friend.go b/pkg/common/db/table/admin/register_add_friend.go index b00df718f..bd864805b 100644 --- a/pkg/common/db/table/admin/register_add_friend.go +++ b/pkg/common/db/table/admin/register_add_friend.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/admin/register_add_group.go b/pkg/common/db/table/admin/register_add_group.go index 93ce7475d..1b7f4d12b 100644 --- a/pkg/common/db/table/admin/register_add_group.go +++ b/pkg/common/db/table/admin/register_add_group.go @@ -16,7 +16,7 @@ package admin import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/chat/attribute.go b/pkg/common/db/table/chat/attribute.go index 19d55ea28..1b7ba29b4 100644 --- a/pkg/common/db/table/chat/attribute.go +++ b/pkg/common/db/table/chat/attribute.go @@ -16,7 +16,7 @@ package chat import ( "context" - "github.com/OpenIMSDK/tools/pagination" + "github.com/openimsdk/tools/db/pagination" "time" ) diff --git a/pkg/common/db/table/chat/log.go b/pkg/common/db/table/chat/log.go deleted file mode 100644 index fa94018b2..000000000 --- a/pkg/common/db/table/chat/log.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "github.com/OpenIMSDK/tools/pagination" - "time" -) - -type Log struct { - LogID string `bson:"log_id"` - Platform string `bson:"platform"` - UserID string `bson:"user_id"` - CreateTime time.Time `bson:"create_time"` - Url string `bson:"url"` - FileName string `bson:"file_name"` - SystemType string `bson:"system_type"` - Version string `bson:"version"` - Ex string `bson:"ex"` -} - -type LogInterface interface { - Create(ctx context.Context, log []*Log) error - Search(ctx context.Context, keyword string, start time.Time, end time.Time, pagination pagination.Pagination) (int64, []*Log, error) - Delete(ctx context.Context, logID []string, userID string) error - Get(ctx context.Context, logIDs []string, userID string) ([]*Log, error) -} diff --git a/pkg/common/db/table/chat/user_login_record.go b/pkg/common/db/table/chat/user_login_record.go index 1bae166e2..6c3a8eda9 100644 --- a/pkg/common/db/table/chat/user_login_record.go +++ b/pkg/common/db/table/chat/user_login_record.go @@ -33,7 +33,6 @@ func (UserLoginRecord) TableName() string { } type UserLoginRecordInterface interface { - //NewTx(tx any) UserLoginRecordInterface Create(ctx context.Context, records ...*UserLoginRecord) error CountTotal(ctx context.Context, before *time.Time) (int64, error) CountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error) diff --git a/pkg/common/db/table/chat/verify_code.go b/pkg/common/db/table/chat/verify_code.go index 08e1db2b8..5ae639451 100644 --- a/pkg/common/db/table/chat/verify_code.go +++ b/pkg/common/db/table/chat/verify_code.go @@ -20,7 +20,7 @@ import ( ) type VerifyCode struct { - ID string `bson:"id"` + ID string `bson:"_id"` Account string `bson:"account"` Platform string `bson:"platform"` Code string `bson:"code"` diff --git a/pkg/common/dbconn/mongo.go b/pkg/common/dbconn/mongo.go deleted file mode 100644 index fd6ab9a85..000000000 --- a/pkg/common/dbconn/mongo.go +++ /dev/null @@ -1,97 +0,0 @@ -package dbconn - -import ( - "context" - "fmt" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw/specialerror" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "os" - "strings" - "time" -) - -const ( - maxRetry = 10 // number of retries - mongoConnTimeout = 10 * time.Second -) - -// NewMongo Initialize MongoDB connection. -func NewMongo() (*mongo.Database, error) { - specialerror.AddReplace(mongo.ErrNoDocuments, errs.ErrRecordNotFound) - uri := buildMongoURI() - database := buildMongoDatabase() - var mongoClient *mongo.Client - var err error - - // Retry connecting to MongoDB - for i := 0; i <= maxRetry; i++ { - ctx, cancel := context.WithTimeout(context.Background(), mongoConnTimeout) - mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(uri)) - cancel() - if err == nil { - return mongoClient.Database(database), nil - } - if shouldRetry(err) { - fmt.Printf("Failed to connect to MongoDB, retrying: %s\n", err) - time.Sleep(time.Second) // exponential backoff could be implemented here - continue - } - return nil, errs.Wrap(err) - } - return nil, errs.Wrap(err) -} - -func buildMongoURI() string { - uri := os.Getenv("MONGO_URI") - if uri != "" { - return uri - } - - if config.Config.Mongo.Uri != "" { - return config.Config.Mongo.Uri - } - - username := os.Getenv("MONGO_OPENIM_USERNAME") - password := os.Getenv("MONGO_OPENIM_PASSWORD") - address := os.Getenv("MONGO_ADDRESS") - port := os.Getenv("MONGO_PORT") - database := os.Getenv("MONGO_DATABASE") - maxPoolSize := os.Getenv("MONGO_MAX_POOL_SIZE") - - if username == "" { - username = config.Config.Mongo.Username - } - if password == "" { - password = config.Config.Mongo.Password - } - if address == "" { - address = strings.Join(config.Config.Mongo.Address, ",") - } else if port != "" { - address = fmt.Sprintf("%s:%s", address, port) - } - if database == "" { - database = config.Config.Mongo.Database - } - if maxPoolSize == "" { - maxPoolSize = fmt.Sprint(config.Config.Mongo.MaxPoolSize) - } - - if username != "" && password != "" { - return fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%s", username, password, address, database, maxPoolSize) - } - return fmt.Sprintf("mongodb://%s/%s?maxPoolSize=%s", address, database, maxPoolSize) -} - -func buildMongoDatabase() string { - return config.Config.Mongo.Database -} - -func shouldRetry(err error) bool { - if cmdErr, ok := err.(mongo.CommandError); ok { - return cmdErr.Code != 13 && cmdErr.Code != 18 - } - return true -} diff --git a/pkg/common/apicall/api.go b/pkg/common/imapi/api.go similarity index 62% rename from pkg/common/apicall/api.go rename to pkg/common/imapi/api.go index 721d29621..d5c6cca1e 100644 --- a/pkg/common/apicall/api.go +++ b/pkg/common/imapi/api.go @@ -12,29 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -package apicall +package imapi import ( - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/protocol/auth" - "github.com/OpenIMSDK/protocol/friend" - "github.com/OpenIMSDK/protocol/group" - "github.com/OpenIMSDK/protocol/user" + "github.com/openimsdk/protocol/auth" + "github.com/openimsdk/protocol/friend" + "github.com/openimsdk/protocol/group" + "github.com/openimsdk/protocol/user" ) -func imApi() string { - return config.Config.OpenIMUrl -} - // im caller. var ( - importFriend = NewApiCaller[friend.ImportFriendReq, friend.ImportFriendResp]("/friend/import_friend", imApi) - userToken = NewApiCaller[auth.UserTokenReq, auth.UserTokenResp]("/auth/user_token", imApi) - inviteToGroup = NewApiCaller[group.InviteUserToGroupReq, group.InviteUserToGroupResp]("/group/invite_user_to_group", imApi) - updateUserInfo = NewApiCaller[user.UpdateUserInfoReq, user.UpdateUserInfoResp]("/user/update_user_info", imApi) - registerUser = NewApiCaller[user.UserRegisterReq, user.UserRegisterResp]("/user/user_register", imApi) - forceOffLine = NewApiCaller[auth.ForceLogoutReq, auth.ForceLogoutResp]("/auth/force_logout", imApi) - getGroupsInfo = NewApiCaller[group.GetGroupsInfoReq, group.GetGroupsInfoResp]("/group/get_groups_info", imApi) - registerUserCount = NewApiCaller[user.UserRegisterCountReq, user.UserRegisterCountResp]("/statistics/user/register", imApi) - friendUserIDs = NewApiCaller[friend.GetFriendIDsReq, friend.GetFriendIDsResp]("/friend/get_friend_id", imApi) + importFriend = NewApiCaller[friend.ImportFriendReq, friend.ImportFriendResp]("/friend/import_friend") + userToken = NewApiCaller[auth.UserTokenReq, auth.UserTokenResp]("/auth/user_token") + inviteToGroup = NewApiCaller[group.InviteUserToGroupReq, group.InviteUserToGroupResp]("/group/invite_user_to_group") + updateUserInfo = NewApiCaller[user.UpdateUserInfoReq, user.UpdateUserInfoResp]("/user/update_user_info") + registerUser = NewApiCaller[user.UserRegisterReq, user.UserRegisterResp]("/user/user_register") + forceOffLine = NewApiCaller[auth.ForceLogoutReq, auth.ForceLogoutResp]("/auth/force_logout") + getGroupsInfo = NewApiCaller[group.GetGroupsInfoReq, group.GetGroupsInfoResp]("/group/get_groups_info") + registerUserCount = NewApiCaller[user.UserRegisterCountReq, user.UserRegisterCountResp]("/statistics/user/register") + friendUserIDs = NewApiCaller[friend.GetFriendIDsReq, friend.GetFriendIDsResp]("/friend/get_friend_id") ) diff --git a/pkg/common/apicall/call.go b/pkg/common/imapi/call.go similarity index 56% rename from pkg/common/apicall/call.go rename to pkg/common/imapi/call.go index 4b8780d43..41f97b536 100644 --- a/pkg/common/apicall/call.go +++ b/pkg/common/imapi/call.go @@ -12,21 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -package apicall +package imapi import ( "bytes" "context" "encoding/json" - "errors" "io" "net/http" "time" - "github.com/OpenIMSDK/chat/pkg/common/constant" - constant2 "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" + "github.com/openimsdk/chat/pkg/common/constant" + pconstant "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" "gorm.io/gorm/utils" ) @@ -42,37 +41,32 @@ var client = &http.Client{ } type ApiCaller[Req, Resp any] interface { - Call(ctx context.Context, req *Req) (*Resp, error) + Call(ctx context.Context, apiPrefix string, req *Req) (*Resp, error) } -func NewApiCaller[Req, Resp any](api string, prefix func() string) ApiCaller[Req, Resp] { +func NewApiCaller[Req, Resp any](api string) ApiCaller[Req, Resp] { return &caller[Req, Resp]{ - api: api, - prefix: prefix, + api: api, } } type caller[Req, Resp any] struct { - api string - prefix func() string + api string } -func (a caller[Req, Resp]) Call(ctx context.Context, req *Req) (*Resp, error) { - resp, err := a.call(ctx, req) +func (a caller[Req, Resp]) Call(ctx context.Context, apiPrefix string, req *Req) (*Resp, error) { + start := time.Now() + resp, err := a.call(ctx, apiPrefix, req) if err != nil { - log.ZError(ctx, "caller resp", err) + log.ZError(ctx, "api caller failed", err, "api", a.api, "duration", time.Since(start), "req", req) return nil, err } - log.ZInfo(ctx, "resp", resp) + log.ZInfo(ctx, "api caller success resp", "api", a.api, "duration", time.Since(start), "req", req, "resp", resp) return resp, nil } -func (a caller[Req, Resp]) call(ctx context.Context, req *Req) (*Resp, error) { - url := a.prefix() + a.api - defer func(start time.Time) { - log.ZDebug(ctx, "api call caller time", "api", a.api, "cost", time.Since(start).String()) - }(time.Now()) - log.ZInfo(ctx, "caller req", "addr", url, "req", req) +func (a caller[Req, Resp]) call(ctx context.Context, apiPrefix string, req *Req) (*Resp, error) { + url := apiPrefix + a.api reqBody, err := json.Marshal(req) if err != nil { return nil, err @@ -81,32 +75,26 @@ func (a caller[Req, Resp]) call(ctx context.Context, req *Req) (*Resp, error) { if err != nil { return nil, err } - operationID := utils.ToString(ctx.Value(constant2.OperationID)) - request.Header.Set(constant2.OperationID, operationID) + operationID := utils.ToString(ctx.Value(pconstant.OperationID)) + request.Header.Set(pconstant.OperationID, operationID) if token, _ := ctx.Value(constant.CtxApiToken).(string); token != "" { - request.Header.Set(constant2.Token, token) - log.ZDebug(ctx, "req token", "token", token) + request.Header.Set(pconstant.Token, token) } response, err := client.Do(request) if err != nil { return nil, err } - log.ZDebug(ctx, "call caller successfully", "code", response.Status) defer response.Body.Close() - if response.StatusCode != http.StatusOK { - return nil, errs.Wrap(errors.New(response.Status)) - } data, err := io.ReadAll(response.Body) if err != nil { - return nil, err + return nil, errs.WrapMsg(err, "read http response body", "url", url, "code", response.StatusCode) } - log.ZDebug(ctx, "read respBody successfully", "body", string(data)) var resp baseApiResponse[Resp] if err := json.Unmarshal(data, &resp); err != nil { - return nil, err + return nil, errs.WrapMsg(err, string(data)) } if resp.ErrCode != 0 { - return nil, errs.NewCodeError(resp.ErrCode, resp.ErrMsg).WithDetail(resp.ErrDlt) + return nil, errs.NewCodeError(resp.ErrCode, resp.ErrMsg).WithDetail(resp.ErrDlt).Wrap() } return resp.Data, nil } diff --git a/pkg/common/apicall/caller.go b/pkg/common/imapi/caller.go similarity index 71% rename from pkg/common/apicall/caller.go rename to pkg/common/imapi/caller.go index f60fbb6d7..22ee431bc 100644 --- a/pkg/common/apicall/caller.go +++ b/pkg/common/imapi/caller.go @@ -12,21 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -package apicall +package imapi import ( "context" - "github.com/OpenIMSDK/tools/log" + "github.com/openimsdk/tools/log" "sync" "time" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/protocol/auth" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/protocol/friend" - "github.com/OpenIMSDK/protocol/group" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/protocol/user" + "github.com/openimsdk/protocol/auth" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/friend" + "github.com/openimsdk/protocol/group" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/protocol/user" ) type CallerInterface interface { @@ -43,20 +42,27 @@ type CallerInterface interface { } type Caller struct { - token string - timeout time.Time - lock sync.Mutex + imApi string + imSecret string + defaultIMUserID string + token string + timeout time.Time + lock sync.Mutex } -func NewCallerInterface() CallerInterface { - return &Caller{} +func New(imApi string, imSecret string, defaultIMUserID string) CallerInterface { + return &Caller{ + imApi: imApi, + imSecret: imSecret, + defaultIMUserID: defaultIMUserID, + } } func (c *Caller) ImportFriend(ctx context.Context, ownerUserID string, friendUserIDs []string) error { if len(friendUserIDs) == 0 { return nil } - _, err := importFriend.Call(ctx, &friend.ImportFriendReq{ + _, err := importFriend.Call(ctx, c.imApi, &friend.ImportFriendReq{ OwnerUserID: ownerUserID, FriendUserIDs: friendUserIDs, }) @@ -67,8 +73,8 @@ func (c *Caller) ImAdminTokenWithDefaultAdmin(ctx context.Context) (string, erro c.lock.Lock() defer c.lock.Unlock() if c.token == "" || c.timeout.Before(time.Now()) { - userID := config.GetDefaultIMAdmin() - token, err := c.UserToken(ctx, config.GetDefaultIMAdmin(), constant.AdminPlatformID) + userID := c.defaultIMUserID + token, err := c.UserToken(ctx, userID, constant.AdminPlatformID) if err != nil { log.ZError(ctx, "get im admin token", err, "userID", userID) return "", err @@ -81,8 +87,8 @@ func (c *Caller) ImAdminTokenWithDefaultAdmin(ctx context.Context) (string, erro } func (c *Caller) UserToken(ctx context.Context, userID string, platformID int32) (string, error) { - resp, err := userToken.Call(ctx, &auth.UserTokenReq{ - Secret: *config.Config.Secret, + resp, err := userToken.Call(ctx, c.imApi, &auth.UserTokenReq{ + Secret: c.imSecret, PlatformID: platformID, UserID: userID, }) @@ -94,7 +100,7 @@ func (c *Caller) UserToken(ctx context.Context, userID string, platformID int32) func (c *Caller) InviteToGroup(ctx context.Context, userID string, groupIDs []string) error { for _, groupID := range groupIDs { - _, _ = inviteToGroup.Call(ctx, &group.InviteUserToGroupReq{ + _, _ = inviteToGroup.Call(ctx, c.imApi, &group.InviteUserToGroupReq{ GroupID: groupID, Reason: "", InvitedUserIDs: []string{userID}, @@ -104,7 +110,7 @@ func (c *Caller) InviteToGroup(ctx context.Context, userID string, groupIDs []st } func (c *Caller) UpdateUserInfo(ctx context.Context, userID string, nickName string, faceURL string) error { - _, err := updateUserInfo.Call(ctx, &user.UpdateUserInfoReq{UserInfo: &sdkws.UserInfo{ + _, err := updateUserInfo.Call(ctx, c.imApi, &user.UpdateUserInfoReq{UserInfo: &sdkws.UserInfo{ UserID: userID, Nickname: nickName, FaceURL: faceURL, @@ -113,8 +119,8 @@ func (c *Caller) UpdateUserInfo(ctx context.Context, userID string, nickName str } func (c *Caller) RegisterUser(ctx context.Context, users []*sdkws.UserInfo) error { - _, err := registerUser.Call(ctx, &user.UserRegisterReq{ - Secret: *config.Config.Secret, + _, err := registerUser.Call(ctx, c.imApi, &user.UserRegisterReq{ + Secret: c.imSecret, Users: users, }) return err @@ -122,7 +128,7 @@ func (c *Caller) RegisterUser(ctx context.Context, users []*sdkws.UserInfo) erro func (c *Caller) ForceOffLine(ctx context.Context, userID string) error { for id := range constant.PlatformID2Name { - _, _ = forceOffLine.Call(ctx, &auth.ForceLogoutReq{ + _, _ = forceOffLine.Call(ctx, c.imApi, &auth.ForceLogoutReq{ PlatformID: int32(id), UserID: userID, }) @@ -131,7 +137,7 @@ func (c *Caller) ForceOffLine(ctx context.Context, userID string) error { } func (c *Caller) FindGroupInfo(ctx context.Context, groupIDs []string) ([]*sdkws.GroupInfo, error) { - resp, err := getGroupsInfo.Call(ctx, &group.GetGroupsInfoReq{ + resp, err := getGroupsInfo.Call(ctx, c.imApi, &group.GetGroupsInfoReq{ GroupIDs: groupIDs, }) if err != nil { @@ -141,7 +147,7 @@ func (c *Caller) FindGroupInfo(ctx context.Context, groupIDs []string) ([]*sdkws } func (c *Caller) UserRegisterCount(ctx context.Context, start int64, end int64) (map[string]int64, int64, error) { - resp, err := registerUserCount.Call(ctx, &user.UserRegisterCountReq{ + resp, err := registerUserCount.Call(ctx, c.imApi, &user.UserRegisterCountReq{ Start: start, End: end, }) @@ -152,7 +158,7 @@ func (c *Caller) UserRegisterCount(ctx context.Context, start int64, end int64) } func (c *Caller) FriendUserIDs(ctx context.Context, userID string) ([]string, error) { - resp, err := friendUserIDs.Call(ctx, &friend.GetFriendIDsReq{UserID: userID}) + resp, err := friendUserIDs.Call(ctx, c.imApi, &friend.GetFriendIDsReq{UserID: userID}) if err != nil { return nil, err } diff --git a/pkg/common/kdisc/direct/direct_resolver.go b/pkg/common/kdisc/direct/direct_resolver.go new file mode 100644 index 000000000..821378277 --- /dev/null +++ b/pkg/common/kdisc/direct/direct_resolver.go @@ -0,0 +1,96 @@ +// Copyright © 2024 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 direct + +import ( + "context" + "math/rand" + "strings" + + "github.com/openimsdk/tools/log" + "google.golang.org/grpc/resolver" +) + +const ( + slashSeparator = "/" + // EndpointSepChar is the separator char in endpoints. + EndpointSepChar = ',' + + subsetSize = 32 + scheme = "direct" +) + +type ResolverDirect struct { +} + +func NewResolverDirect() *ResolverDirect { + return &ResolverDirect{} +} + +func (rd *ResolverDirect) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) ( + resolver.Resolver, error) { + log.ZDebug(context.Background(), "Build", "target", target) + endpoints := strings.FieldsFunc(GetEndpoints(target), func(r rune) bool { + return r == EndpointSepChar + }) + endpoints = subset(endpoints, subsetSize) + addrs := make([]resolver.Address, 0, len(endpoints)) + + for _, val := range endpoints { + addrs = append(addrs, resolver.Address{ + Addr: val, + }) + } + if err := cc.UpdateState(resolver.State{ + Addresses: addrs, + }); err != nil { + return nil, err + } + + return &nopResolver{cc: cc}, nil +} +func init() { + resolver.Register(&ResolverDirect{}) +} +func (rd *ResolverDirect) Scheme() string { + return scheme // return your custom scheme name +} + +// GetEndpoints returns the endpoints from the given target. +func GetEndpoints(target resolver.Target) string { + return strings.Trim(target.URL.Path, slashSeparator) +} +func subset(set []string, sub int) []string { + rand.Shuffle(len(set), func(i, j int) { + set[i], set[j] = set[j], set[i] + }) + if len(set) <= sub { + return set + } + + return set[:sub] +} + +type nopResolver struct { + cc resolver.ClientConn +} + +func (n nopResolver) ResolveNow(options resolver.ResolveNowOptions) { + +} + +func (n nopResolver) Close() { + +} diff --git a/pkg/common/kdisc/direct/directconn.go b/pkg/common/kdisc/direct/directconn.go new file mode 100644 index 000000000..1cbe56dd5 --- /dev/null +++ b/pkg/common/kdisc/direct/directconn.go @@ -0,0 +1,174 @@ +// Copyright © 2024 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 direct + +//import ( +// "context" +// "fmt" +// +// config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" +// "github.com/openimsdk/tools/errs" +// "google.golang.org/grpc" +// "google.golang.org/grpc/credentials/insecure" +//) +// +//type ServiceAddresses map[string][]int +// +//func getServiceAddresses(rpcRegisterName *config2.RpcRegisterName, +// rpcPort *config2.RpcPort, longConnSvrPort []int) ServiceAddresses { +// return ServiceAddresses{ +// rpcRegisterName.OpenImUserName: rpcPort.OpenImUserPort, +// rpcRegisterName.OpenImFriendName: rpcPort.OpenImFriendPort, +// rpcRegisterName.OpenImMsgName: rpcPort.OpenImMessagePort, +// rpcRegisterName.OpenImMessageGatewayName: longConnSvrPort, +// rpcRegisterName.OpenImGroupName: rpcPort.OpenImGroupPort, +// rpcRegisterName.OpenImAuthName: rpcPort.OpenImAuthPort, +// rpcRegisterName.OpenImPushName: rpcPort.OpenImPushPort, +// rpcRegisterName.OpenImConversationName: rpcPort.OpenImConversationPort, +// rpcRegisterName.OpenImThirdName: rpcPort.OpenImThirdPort, +// } +//} +// +//type ConnDirect struct { +// additionalOpts []grpc.DialOption +// currentServiceAddress string +// conns map[string][]*grpc.ClientConn +// resolverDirect *ResolverDirect +// config *config2.GlobalConfig +//} +// +//func (cd *ConnDirect) GetClientLocalConns() map[string][]*grpc.ClientConn { +// return nil +//} +// +//func (cd *ConnDirect) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error) { +// return "", nil +//} +// +//func (cd *ConnDirect) Register(serviceName, host string, port int, opts ...grpc.DialOption) error { +// return nil +//} +// +//func (cd *ConnDirect) UnRegister() error { +// return nil +//} +// +//func (cd *ConnDirect) CreateRpcRootNodes(serviceNames []string) error { +// return nil +//} +// +//func (cd *ConnDirect) RegisterConf2Registry(key string, conf []byte) error { +// return nil +//} +// +//func (cd *ConnDirect) GetConfFromRegistry(key string) ([]byte, error) { +// return nil, nil +//} +// +//func (cd *ConnDirect) Close() { +// +//} +// +//func NewConnDirect(config *config2.GlobalConfig) (*ConnDirect, error) { +// return &ConnDirect{ +// conns: make(map[string][]*grpc.ClientConn), +// resolverDirect: NewResolverDirect(), +// config: config, +// }, nil +//} +// +//func (cd *ConnDirect) GetConns(ctx context.Context, +// serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) { +// +// if conns, exists := cd.conns[serviceName]; exists { +// return conns, nil +// } +// ports := getServiceAddresses(&cd.config.RpcRegisterName, +// &cd.config.RpcPort, cd.config.LongConnSvr.OpenImMessageGatewayPort)[serviceName] +// var connections []*grpc.ClientConn +// for _, port := range ports { +// conn, err := cd.dialServiceWithoutResolver(ctx, fmt.Sprintf(cd.config.Rpc.ListenIP+":%d", port), append(cd.additionalOpts, opts...)...) +// if err != nil { +// return nil, errs.Wrap(fmt.Errorf("connect to port %d failed,serviceName %s, IP %s", port, serviceName, cd.config.Rpc.ListenIP)) +// } +// connections = append(connections, conn) +// } +// +// if len(connections) == 0 { +// return nil, errs.New("no connections found for service", "serviceName", serviceName).Wrap() +// } +// return connections, nil +//} +// +//func (cd *ConnDirect) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { +// // Get service addresses +// addresses := getServiceAddresses(&cd.config.RpcRegisterName, +// &cd.config.RpcPort, cd.config.LongConnSvr.OpenImMessageGatewayPort) +// address, ok := addresses[serviceName] +// if !ok { +// return nil, errs.New("unknown service name", "serviceName", serviceName).Wrap() +// } +// var result string +// for _, addr := range address { +// if result != "" { +// result = result + "," + fmt.Sprintf(cd.config.Rpc.ListenIP+":%d", addr) +// } else { +// result = fmt.Sprintf(cd.config.Rpc.ListenIP+":%d", addr) +// } +// } +// // Try to dial a new connection +// conn, err := cd.dialService(ctx, result, append(cd.additionalOpts, opts...)...) +// if err != nil { +// return nil, errs.WrapMsg(err, "address", result) +// } +// +// // Store the new connection +// cd.conns[serviceName] = append(cd.conns[serviceName], conn) +// return conn, nil +//} +// +//func (cd *ConnDirect) GetSelfConnTarget() string { +// return cd.currentServiceAddress +//} +// +//func (cd *ConnDirect) AddOption(opts ...grpc.DialOption) { +// cd.additionalOpts = append(cd.additionalOpts, opts...) +//} +// +//func (cd *ConnDirect) CloseConn(conn *grpc.ClientConn) { +// if conn != nil { +// conn.Close() +// } +//} +// +//func (cd *ConnDirect) dialService(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { +// options := append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) +// conn, err := grpc.DialContext(ctx, cd.resolverDirect.Scheme()+":///"+address, options...) +// +// if err != nil { +// return nil, errs.WrapMsg(err, "address", address) +// } +// return conn, nil +//} +// +//func (cd *ConnDirect) dialServiceWithoutResolver(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { +// options := append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) +// conn, err := grpc.DialContext(ctx, address, options...) +// +// if err != nil { +// return nil, errs.Wrap(err) +// } +// return conn, nil +//} diff --git a/internal/rpc/chat/signal.go b/pkg/common/kdisc/direct/doc.go similarity index 52% rename from internal/rpc/chat/signal.go rename to pkg/common/kdisc/direct/doc.go index 8513087ad..b3cd0f804 100644 --- a/internal/rpc/chat/signal.go +++ b/pkg/common/kdisc/direct/doc.go @@ -1,4 +1,4 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. +// Copyright © 2024 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. @@ -12,19 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package chat - -import ( - "context" - "errors" - - "github.com/OpenIMSDK/chat/pkg/proto/chat" -) - -func (*chatSvr) AddSignalRecord(ctx context.Context, req *chat.AddSignalRecordReq) (*chat.AddSignalRecordResp, error) { - return nil, errors.New("todo AddSignalRecord") -} - -func (*chatSvr) GetSignalRecords(ctx context.Context, req *chat.GetSignalRecordsReq) (*chat.GetSignalRecordsResp, error) { - return nil, errors.New("todo GetSignalRecords") -} +package direct // import "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct" diff --git a/pkg/common/kdisc/discoveryregister.go b/pkg/common/kdisc/discoveryregister.go new file mode 100644 index 000000000..eb5bbdcc0 --- /dev/null +++ b/pkg/common/kdisc/discoveryregister.go @@ -0,0 +1,48 @@ +// 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 kdisc + +import ( + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/discovery/zookeeper" + "github.com/openimsdk/tools/errs" + "time" +) + +const ( + zookeeperConst = "zookeeper" + kubenetesConst = "k8s" + directConst = "direct" +) + +// NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. +func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry, error) { + switch share.Env { + case zookeeperConst: + return zookeeper.NewZkClient( + zookeeperConfig.Address, + zookeeperConfig.Schema, + zookeeper.WithFreq(time.Hour), + zookeeper.WithUserNameAndPassword(zookeeperConfig.Username, zookeeperConfig.Password), + zookeeper.WithRoundRobin(), + zookeeper.WithTimeout(10), + ) + //case directConst: + // return direct.NewConnDirect(config) + default: + return nil, errs.New("unsupported discovery type", "type", share.Env).Wrap() + } +} diff --git a/pkg/common/kdisc/zookeeper/doc.go b/pkg/common/kdisc/zookeeper/doc.go new file mode 100644 index 000000000..1c24d77ac --- /dev/null +++ b/pkg/common/kdisc/zookeeper/doc.go @@ -0,0 +1,15 @@ +// Copyright © 2024 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 // import "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper" diff --git a/pkg/common/kdisc/zookeeper/zookeeper.go b/pkg/common/kdisc/zookeeper/zookeeper.go new file mode 100644 index 000000000..1d11414b6 --- /dev/null +++ b/pkg/common/kdisc/zookeeper/zookeeper.go @@ -0,0 +1,44 @@ +// 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 + +import ( + "os" + "strings" +) + +// getEnv returns the value of an environment variable if it exists, otherwise it returns the fallback value. +func getEnv(key, fallback string) string { + if value, exists := os.LookupEnv(key); exists { + return value + } + return fallback +} + +// getZkAddrFromEnv returns the Zookeeper addresses combined from the ZOOKEEPER_ADDRESS and ZOOKEEPER_PORT environment variables. +// If the environment variables are not set, it returns the fallback value. +func getZkAddrFromEnv(fallback []string) []string { + address, addrExists := os.LookupEnv("ZOOKEEPER_ADDRESS") + port, portExists := os.LookupEnv("ZOOKEEPER_PORT") + + if addrExists && portExists { + addresses := strings.Split(address, ",") + for i, addr := range addresses { + addresses[i] = addr + ":" + port + } + return addresses + } + return fallback +} diff --git a/pkg/common/mctx/get.go b/pkg/common/mctx/get.go index 3fc4884a4..6ff3fc115 100644 --- a/pkg/common/mctx/get.go +++ b/pkg/common/mctx/get.go @@ -16,16 +16,14 @@ package mctx import ( "context" + "github.com/openimsdk/tools/utils/datautil" "strconv" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/utils" + constant2 "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" - constant2 "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" - - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/chat/pkg/common/tokenverify" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/chat/pkg/common/tokenverify" ) func HaveOpUser(ctx context.Context) bool { @@ -36,24 +34,24 @@ func Check(ctx context.Context) (string, int32, error) { opUserIDVal := ctx.Value(constant.RpcOpUserID) opUserID, ok := opUserIDVal.(string) if !ok { - return "", 0, errs.ErrNoPermission.Wrap("no opUserID") + return "", 0, errs.ErrNoPermission.WrapMsg("no opUserID") } if opUserID == "" { - return "", 0, errs.ErrNoPermission.Wrap("opUserID empty") + return "", 0, errs.ErrNoPermission.WrapMsg("opUserID empty") } opUserTypeArr, ok := ctx.Value(constant.RpcOpUserType).([]string) if !ok { - return "", 0, errs.ErrNoPermission.Wrap("missing user type") + return "", 0, errs.ErrNoPermission.WrapMsg("missing user type") } if len(opUserTypeArr) == 0 { - return "", 0, errs.ErrNoPermission.Wrap("user type empty") + return "", 0, errs.ErrNoPermission.WrapMsg("user type empty") } userType, err := strconv.Atoi(opUserTypeArr[0]) if err != nil { - return "", 0, errs.ErrNoPermission.Wrap("user type invalid " + err.Error()) + return "", 0, errs.ErrNoPermission.WrapMsg("user type invalid " + err.Error()) } if !(userType == constant.AdminUser || userType == constant.NormalUser) { - return "", 0, errs.ErrNoPermission.Wrap("user type invalid") + return "", 0, errs.ErrNoPermission.WrapMsg("user type invalid") } return opUserID, int32(userType), nil } @@ -64,7 +62,7 @@ func CheckAdmin(ctx context.Context) (string, error) { return "", err } if userType != constant.AdminUser { - return "", errs.ErrNoPermission.Wrap("not admin") + return "", errs.ErrNoPermission.WrapMsg("not admin") } return userID, nil } @@ -75,7 +73,7 @@ func CheckUser(ctx context.Context) (string, error) { return "", err } if userType != constant.NormalUser { - return "", errs.ErrNoPermission.Wrap("not user") + return "", errs.ErrNoPermission.WrapMsg("not user") } return userID, nil } @@ -101,7 +99,7 @@ func CheckAdminOr(ctx context.Context, userIDs ...string) error { return nil } } - return errs.ErrNoPermission.Wrap("not admin or not in userIDs") + return errs.ErrNoPermission.WrapMsg("not admin or not in userIDs") } func GetOpUserID(ctx context.Context) string { @@ -113,7 +111,7 @@ func GetUserType(ctx context.Context) (int, error) { userTypeArr, _ := ctx.Value(constant.RpcOpUserType).([]string) userType, err := strconv.Atoi(userTypeArr[0]) if err != nil { - return 0, errs.ErrNoPermission.Wrap("user type invalid " + err.Error()) + return 0, errs.ErrNoPermission.WrapMsg("user type invalid " + err.Error()) } return userType, nil } @@ -122,20 +120,14 @@ func WithOpUserID(ctx context.Context, opUserID string, userType int) context.Co headers, _ := ctx.Value(constant.RpcCustomHeader).([]string) ctx = context.WithValue(ctx, constant.RpcOpUserID, opUserID) ctx = context.WithValue(ctx, constant.RpcOpUserType, []string{strconv.Itoa(userType)}) - if utils.IndexOf(constant.RpcOpUserType, headers...) < 0 { + if datautil.IndexOf(constant.RpcOpUserType, headers...) < 0 { ctx = context.WithValue(ctx, constant.RpcCustomHeader, append(headers, constant.RpcOpUserType)) } return ctx } -func WithAdminUser(ctx context.Context) context.Context { - if config.Config.AdminList[0].AdminID != "" { - ctx = WithOpUserID(ctx, config.Config.AdminList[0].AdminID, constant.AdminUser) - } - if config.Config.AdminList[0].AdminID != "" && len(config.Config.ChatAdmin) > 0 { - ctx = WithOpUserID(ctx, config.Config.ChatAdmin[0].AdminID, constant.AdminUser) - } - return ctx +func WithAdminUser(ctx context.Context, userID string) context.Context { + return WithOpUserID(ctx, userID, constant.AdminUser) } func WithApiToken(ctx context.Context, token string) context.Context { diff --git a/pkg/common/mw/gin_log.go b/pkg/common/mw/gin_log.go index ed96a6086..13d19a35b 100644 --- a/pkg/common/mw/gin_log.go +++ b/pkg/common/mw/gin_log.go @@ -20,8 +20,8 @@ import ( "net/http" "time" - "github.com/OpenIMSDK/tools/log" "github.com/gin-gonic/gin" + "github.com/openimsdk/tools/log" ) type responseWriter struct { diff --git a/pkg/common/mw/user.go b/pkg/common/mw/user.go index bfa7bf59c..9c2b765fc 100644 --- a/pkg/common/mw/user.go +++ b/pkg/common/mw/user.go @@ -17,8 +17,8 @@ package mw import ( "context" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/tools/log" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/tools/log" "google.golang.org/grpc" ) diff --git a/pkg/common/rtc/gene_token.go b/pkg/common/rtc/gene_token.go deleted file mode 100644 index efa9e721c..000000000 --- a/pkg/common/rtc/gene_token.go +++ /dev/null @@ -1,42 +0,0 @@ -package rtc - -import ( - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/livekit/protocol/auth" -) - -func GetLiveKitToken(room string, identity string) (string, error) { - apiKey := config.Config.LiveKit.Key - apiSecret := config.Config.LiveKit.Secret - - //fmt.Printf("livekit apiKey=%s\n", apiKey) - //fmt.Printf("livekit apiSecret=%s\n", apiSecret) - // - //fmt.Printf("room=%s\n", room) - //fmt.Printf("identity=%s\n", identity) - - token, err := geneLiveKitToken(apiKey, apiSecret, room, identity) - - //fmt.Printf("livekit token=%s\n", token) - - return token, err -} - -func geneLiveKitToken(key string, secret string, room string, identity string) (string, error) { - at := auth.NewAccessToken(key, secret) - grant := &auth.VideoGrant{ - RoomJoin: true, - Room: room, - } - at.AddGrant(grant). - SetIdentity(identity). - SetValidFor(time.Hour) - - return at.ToJWT() -} - -func GetLiveKitServerUrl() string { - return config.Config.LiveKit.LiveKitUrl -} diff --git a/pkg/common/rtc/gene_token_test.go b/pkg/common/rtc/gene_token_test.go deleted file mode 100644 index b36f8a64d..000000000 --- a/pkg/common/rtc/gene_token_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package rtc - -import ( - "fmt" - "testing" -) - -func TestGetLiveKitToken(t *testing.T) { - apiKey := "APIDXJxJeCL8haY" - apiSecret := "ak1qulJ3nfXeflQHWBdmQDc4js4ueMc5OnxoORVJC2xA" - - token, err := geneLiveKitToken(apiKey, apiSecret, "testRoom", "testUser001") - if err == nil { - fmt.Printf("Livekit token: %s\n", token) - } else { - t.Errorf("geneLiveKitToken failed! err=%s\n", err.Error()) - } -} diff --git a/pkg/common/rtc/rtc.go b/pkg/common/rtc/rtc.go new file mode 100644 index 000000000..7feca7ee9 --- /dev/null +++ b/pkg/common/rtc/rtc.go @@ -0,0 +1,30 @@ +package rtc + +import ( + "github.com/livekit/protocol/auth" + "time" +) + +func NewLiveKit(key, secret, url string) *LiveKit { + return &LiveKit{ + token: auth.NewAccessToken(key, secret), + url: url, + } +} + +type LiveKit struct { + token *auth.AccessToken + url string +} + +func (l *LiveKit) GetLiveKitURL() string { + return l.url +} + +func (l *LiveKit) GetLiveKitToken(room string, identity string) (string, error) { + grant := &auth.VideoGrant{ + RoomJoin: true, + Room: room, + } + return l.token.AddGrant(grant).SetIdentity(identity).SetValidFor(time.Hour).ToJWT() +} diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go new file mode 100644 index 000000000..6556f89ce --- /dev/null +++ b/pkg/common/startrpc/start.go @@ -0,0 +1,132 @@ +// 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 startrpc + +import ( + "context" + "fmt" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/kdisc" + "github.com/openimsdk/tools/utils/datautil" + "net" + "os" + "os/signal" + "strconv" + "sync" + "syscall" + "time" + + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mw" + "github.com/openimsdk/tools/system/program" + "github.com/openimsdk/tools/utils/network" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +// Start rpc server. +func Start[T any](ctx context.Context, zookeeperConfig *config.ZooKeeper, listenIP, + registerIP string, rpcPorts []int, index int, rpcRegisterName string, share *config.Share, config T, rpcFn func(ctx context.Context, + config T, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error { + + rpcPort, err := datautil.GetElemByIndex(rpcPorts, index) + if err != nil { + return err + } + log.CInfo(ctx, "RPC server is initializing", "rpcRegisterName", rpcRegisterName, "rpcPort", rpcPort) + rpcTcpAddr := net.JoinHostPort(network.GetListenIP(listenIP), strconv.Itoa(rpcPort)) + listener, err := net.Listen( + "tcp", + rpcTcpAddr, + ) + if err != nil { + return errs.WrapMsg(err, "listen err", "rpcTcpAddr", rpcTcpAddr) + } + + defer listener.Close() + client, err := kdisc.NewDiscoveryRegister(zookeeperConfig, share) + if err != nil { + return err + } + defer client.Close() + client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, "round_robin"))) + registerIP, err = network.GetRpcRegisterIP(registerIP) + if err != nil { + return err + } + + options = append(options, mw.GrpcServer()) + srv := grpc.NewServer(options...) + once := sync.Once{} + defer func() { + once.Do(srv.GracefulStop) + }() + + err = rpcFn(ctx, config, client, srv) + if err != nil { + return err + } + + if err := client.Register(rpcRegisterName, registerIP, rpcPort, grpc.WithTransportCredentials(insecure.NewCredentials())); err != nil { + return err + } + + var ( + netDone = make(chan struct{}, 2) + netErr error + ) + + go func() { + err := srv.Serve(listener) + if err != nil { + netErr = errs.WrapMsg(err, "rpc start err: ", rpcTcpAddr) + netDone <- struct{}{} + } + }() + + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGTERM) + select { + case <-sigs: + program.SIGTERMExit() + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + if err := gracefulStopWithCtx(ctx, srv.GracefulStop); err != nil { + return err + } + ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + return nil + case <-netDone: + close(netDone) + return netErr + } +} + +func gracefulStopWithCtx(ctx context.Context, f func()) error { + done := make(chan struct{}, 1) + go func() { + f() + close(done) + }() + select { + case <-ctx.Done(): + return errs.New("timeout, ctx graceful stop") + case <-done: + return nil + } +} diff --git a/pkg/common/tokenverify/token_verify.go b/pkg/common/tokenverify/token_verify.go index 1cad470a3..9fdfbac54 100644 --- a/pkg/common/tokenverify/token_verify.go +++ b/pkg/common/tokenverify/token_verify.go @@ -17,10 +17,9 @@ package tokenverify import ( "time" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/tools/errs" "github.com/golang-jwt/jwt/v4" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/tools/errs" ) const ( @@ -35,41 +34,32 @@ type claims struct { jwt.RegisteredClaims } -func buildClaims(userID string, userType int32, ttl int64) claims { +type Token struct { + Expires time.Duration + Secret string +} + +func (t *Token) secret() jwt.Keyfunc { + return func(token *jwt.Token) (any, error) { + return []byte(t.Secret), nil + } +} + +func (t *Token) buildClaims(userID string, userType int32) claims { now := time.Now() - before := now.Add(-time.Minute * 5) return claims{ UserID: userID, UserType: userType, RegisteredClaims: jwt.RegisteredClaims{ - ExpiresAt: jwt.NewNumericDate(now.Add(time.Duration(ttl*24) * time.Hour)), // Expiration time - IssuedAt: jwt.NewNumericDate(now), // Issuing time - NotBefore: jwt.NewNumericDate(before), // Begin Effective time + ExpiresAt: jwt.NewNumericDate(now.Add(t.Expires)), // Expiration time + IssuedAt: jwt.NewNumericDate(now), // Issuing time + NotBefore: jwt.NewNumericDate(now.Add(-time.Minute)), // Begin Effective time }, } } -func CreateToken(UserID string, userType int32, ttl int64) (string, error) { - if !(userType == TokenUser || userType == TokenAdmin) { - return "", errs.ErrTokenUnknown.Wrap("token type unknown") - } - claims := buildClaims(UserID, userType, ttl) - token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - tokenString, err := token.SignedString([]byte(*config.Config.Secret)) - if err != nil { - return "", errs.Wrap(err, "") - } - return tokenString, nil -} - -func secret() jwt.Keyfunc { - return func(token *jwt.Token) (interface{}, error) { - return []byte(*config.Config.Secret), nil - } -} - -func getToken(t string) (string, int32, error) { - token, err := jwt.ParseWithClaims(t, &claims{}, secret()) +func (t *Token) getToken(str string) (string, int32, error) { + token, err := jwt.ParseWithClaims(str, &claims{}, t.secret()) if err != nil { if ve, ok := err.(*jwt.ValidationError); ok { if ve.Errors&jwt.ValidationErrorMalformed != 0 { @@ -87,7 +77,7 @@ func getToken(t string) (string, int32, error) { } else { claims, ok := token.Claims.(*claims) if claims.PlatformID != 0 { - return "", 0, errs.ErrTokenNotExist.Wrap() + return "", 0, errs.ErrTokenExpired.Wrap() } if ok && token.Valid { return claims.UserID, claims.UserType, nil @@ -96,35 +86,47 @@ func getToken(t string) (string, int32, error) { } } -func GetToken(token string) (string, int32, error) { - userID, userType, err := getToken(token) - if err != nil { - return "", 0, err - } +func (t *Token) CreateToken(UserID string, userType int32) (string, error) { if !(userType == TokenUser || userType == TokenAdmin) { - return "", 0, errs.ErrTokenUnknown.Wrap("token type unknown") + return "", errs.ErrTokenUnknown.WrapMsg("token type unknown") } - return userID, userType, nil -} - -func GetAdminToken(token string) (string, error) { - userID, userType, err := getToken(token) + token := jwt.NewWithClaims(jwt.SigningMethodHS256, t.buildClaims(UserID, userType)) + str, err := token.SignedString([]byte(t.Secret)) if err != nil { - return "", err + return "", errs.Wrap(err) } - if userType != TokenAdmin { - return "", errs.ErrTokenInvalid.Wrap("token type error") - } - return userID, nil + return str, nil } -func GetUserToken(token string) (string, error) { - userID, userType, err := getToken(token) +func (t *Token) GetToken(token string) (string, int32, error) { + userID, userType, err := t.getToken(token) if err != nil { - return "", err + return "", 0, err } - if userType != TokenUser { - return "", errs.ErrTokenInvalid.Wrap("token type error") + if !(userType == TokenUser || userType == TokenAdmin) { + return "", 0, errs.ErrTokenUnknown.WrapMsg("token type unknown") } - return userID, nil + return userID, userType, nil } + +//func (t *Token) GetAdminToken(token string) (string, error) { +// userID, userType, err := getToken(token) +// if err != nil { +// return "", err +// } +// if userType != TokenAdmin { +// return "", errs.ErrTokenUnknown.WrapMsg("token type error") +// } +// return userID, nil +//} +// +//func (t *Token) GetUserToken(token string) (string, error) { +// userID, userType, err := getToken(token) +// if err != nil { +// return "", err +// } +// if userType != TokenUser { +// return "", errs.ErrTokenUnknown.WrapMsg("token type error") +// } +// return userID, nil +//} diff --git a/pkg/discovery_register/k8s_discovery_register.go b/pkg/discovery_register/k8s_discovery_register.go deleted file mode 100644 index 248beff2a..000000000 --- a/pkg/discovery_register/k8s_discovery_register.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 discovery_register - -import ( - "context" - "errors" - "fmt" - "github.com/OpenIMSDK/tools/errs" - "strings" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/discoveryregistry" - openkeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper" - "github.com/OpenIMSDK/tools/log" - "google.golang.org/grpc" -) - -func NewDiscoveryRegister(envType string) (discoveryregistry.SvcDiscoveryRegistry, error) { - var client discoveryregistry.SvcDiscoveryRegistry - var err error - switch envType { - case "zookeeper": - client, err = openkeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema, - openkeeper.WithFreq(time.Hour), openkeeper.WithUserNameAndPassword( - config.Config.Zookeeper.Username, - config.Config.Zookeeper.Password, - ), openkeeper.WithRoundRobin(), openkeeper.WithTimeout(10), openkeeper.WithLogger(log.NewZkLogger())) - err = errs.Wrap(err, - "Zookeeper ZkAddr: "+strings.Join(config.Config.Zookeeper.ZkAddr, ",")+ - ", Zookeeper Schema: "+config.Config.Zookeeper.Schema+ - ", Zookeeper Username: "+config.Config.Zookeeper.Username+ - ", Zookeeper Password: "+config.Config.Zookeeper.Password) - case "k8s": - client, err = NewK8sDiscoveryRegister() - err = errs.Wrap(err, - "envType: "+"k8s") - default: - client = nil - err = errs.Wrap(errors.New("envType not correct")) - } - return client, err -} - -type K8sDR struct { - options []grpc.DialOption - rpcRegisterAddr string -} - -func (cli *K8sDR) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error) { - //TODO implement me - panic("implement me") -} - -func NewK8sDiscoveryRegister() (discoveryregistry.SvcDiscoveryRegistry, error) { - return &K8sDR{}, nil -} - -func (cli *K8sDR) Register(serviceName, host string, port int, opts ...grpc.DialOption) error { - cli.rpcRegisterAddr = serviceName - return nil -} - -func (cli *K8sDR) UnRegister() error { - return nil -} - -func (cli *K8sDR) CreateRpcRootNodes(serviceNames []string) error { - return nil -} - -func (cli *K8sDR) RegisterConf2Registry(key string, conf []byte) error { - return nil -} - -func (cli *K8sDR) GetConfFromRegistry(key string) ([]byte, error) { - return nil, nil -} - -func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) { - conn, err := grpc.DialContext(ctx, serviceName, append(cli.options, opts...)...) - return []*grpc.ClientConn{conn}, err -} - -func (cli *K8sDR) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { - return grpc.DialContext(ctx, serviceName, append(cli.options, opts...)...) -} - -func (cli *K8sDR) GetSelfConnTarget() string { - return cli.rpcRegisterAddr -} - -func (cli *K8sDR) AddOption(opts ...grpc.DialOption) { - cli.options = append(cli.options, opts...) -} - -func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) { - conn.Close() -} - -// do not use this method for call rpc. -func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn { - fmt.Println("should not call this function!!!!!!!!!!!!!!!!!!!!!!!!!") - return nil -} - -func (cli *K8sDR) Close() { - return -} diff --git a/pkg/eerrs/predefine.go b/pkg/eerrs/predefine.go index 2d4a51ca6..621cba723 100644 --- a/pkg/eerrs/predefine.go +++ b/pkg/eerrs/predefine.go @@ -14,7 +14,7 @@ package eerrs -import "github.com/OpenIMSDK/tools/errs" +import "github.com/openimsdk/tools/errs" var ( ErrPassword = errs.NewCodeError(20001, "PasswordError") // 密码错误 diff --git a/pkg/email/mail.go b/pkg/email/mail.go index 9c15296e3..42194b6c0 100644 --- a/pkg/email/mail.go +++ b/pkg/email/mail.go @@ -17,42 +17,39 @@ package email import ( "context" "fmt" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/tools/errs" "gopkg.in/gomail.v2" ) -func NewMail() Mail { - dail := gomail.NewDialer( - config.Config.VerifyCode.Mail.SmtpAddr, - config.Config.VerifyCode.Mail.SmtpPort, - config.Config.VerifyCode.Mail.SenderMail, - config.Config.VerifyCode.Mail.SenderAuthorizationCode) - - return &mail{dail: dail} -} - type Mail interface { Name() string SendMail(ctx context.Context, mail string, verifyCode string) error } +func NewMail(smtpAddr string, smtpPort int, senderMail, senderAuthorizationCode, title string) Mail { + dail := gomail.NewDialer(smtpAddr, smtpPort, senderMail, senderAuthorizationCode) + return &mail{ + title: title, + senderMail: senderMail, + dail: dail, + } +} + type mail struct { - dail *gomail.Dialer + senderMail string + title string + dail *gomail.Dialer } -func (a *mail) Name() string { +func (m *mail) Name() string { return "mail" } -func (a *mail) SendMail(ctx context.Context, mail string, verifyCode string) error { - m := gomail.NewMessage() - m.SetHeader(`From`, config.Config.VerifyCode.Mail.SenderMail) - m.SetHeader(`To`, []string{mail}...) - m.SetHeader(`Subject`, config.Config.VerifyCode.Mail.Title) - m.SetBody(`text/html`, fmt.Sprintf("您的验证码为:%s,该验证码5分钟内有效,请勿泄露于他人。", verifyCode)) - - // Send - err := a.dail.DialAndSend(m) - return errs.Wrap(err) +func (m *mail) SendMail(ctx context.Context, mail string, verifyCode string) error { + msg := gomail.NewMessage() + msg.SetHeader(`From`, m.senderMail) + msg.SetHeader(`To`, []string{mail}...) + msg.SetHeader(`Subject`, m.title) + msg.SetBody(`text/html`, fmt.Sprintf("您的验证码为:%s,该验证码5分钟内有效,请勿泄露于他人。", verifyCode)) + return errs.Wrap(m.dail.DialAndSend(msg)) } diff --git a/pkg/email/mail_test.go b/pkg/email/mail_test.go index cee179bf9..c6824510a 100644 --- a/pkg/email/mail_test.go +++ b/pkg/email/mail_test.go @@ -22,7 +22,7 @@ import ( "os" "testing" - "github.com/OpenIMSDK/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/config" "gopkg.in/yaml.v3" ) diff --git a/pkg/proto/gen.cmd b/pkg/proto/gen.cmd deleted file mode 100644 index 0e44397a4..000000000 --- a/pkg/proto/gen.cmd +++ /dev/null @@ -1,3 +0,0 @@ -protoc --go_out=plugins=grpc:./common --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/common common/common.proto -protoc --go_out=plugins=grpc:./admin --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/admin admin/admin.proto -protoc --go_out=plugins=grpc:./chat --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/chat chat/chat.proto \ No newline at end of file diff --git a/pkg/proto/gen.sh b/pkg/proto/gen.sh deleted file mode 100644 index 4755e0e48..000000000 --- a/pkg/proto/gen.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright © 2023 OpenIM open source community. 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. - -protoc --go_out=plugins=grpc:./common --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/common common/common.proto -protoc --go_out=plugins=grpc:./admin --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/admin admin/admin.proto -protoc --go_out=plugins=grpc:./chat --go_opt=module=github.com/OpenIMSDK/chat/pkg/proto/chat chat/chat.proto \ No newline at end of file diff --git a/pkg/proto/admin/admin.go b/pkg/protocol/admin/admin.go similarity index 55% rename from pkg/proto/admin/admin.go rename to pkg/protocol/admin/admin.go index 2e6ff898d..06dcb5e47 100644 --- a/pkg/proto/admin/admin.go +++ b/pkg/protocol/admin/admin.go @@ -15,375 +15,375 @@ package admin import ( - "github.com/OpenIMSDK/chat/pkg/common/constant" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/chat/pkg/common/constant" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/datautil" ) func (x *LoginReq) Check() error { if x.Account == "" { - return errs.ErrArgs.Wrap("account is empty") + return errs.ErrArgs.WrapMsg("account is empty") } if x.Password == "" { - return errs.ErrArgs.Wrap("password is empty") + return errs.ErrArgs.WrapMsg("password is empty") } return nil } func (x *ChangePasswordReq) Check() error { if x.Password == "" { - return errs.ErrArgs.Wrap("password is empty") + return errs.ErrArgs.WrapMsg("password is empty") } return nil } func (x *AddDefaultFriendReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } - if utils.Duplicate(x.UserIDs) { - return errs.ErrArgs.Wrap("userIDs has duplicate") + if datautil.Duplicate(x.UserIDs) { + return errs.ErrArgs.WrapMsg("userIDs has duplicate") } return nil } func (x *DelDefaultFriendReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *SearchDefaultFriendReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *AddDefaultGroupReq) Check() error { if x.GroupIDs == nil { - return errs.ErrArgs.Wrap("GroupIDs is empty") + return errs.ErrArgs.WrapMsg("GroupIDs is empty") } - if utils.Duplicate(x.GroupIDs) { - return errs.ErrArgs.Wrap("GroupIDs has duplicate") + if datautil.Duplicate(x.GroupIDs) { + return errs.ErrArgs.WrapMsg("GroupIDs has duplicate") } return nil } func (x *DelDefaultGroupReq) Check() error { if x.GroupIDs == nil { - return errs.ErrArgs.Wrap("GroupIDs is empty") + return errs.ErrArgs.WrapMsg("GroupIDs is empty") } return nil } func (x *SearchDefaultGroupReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *AddInvitationCodeReq) Check() error { if x.Codes == nil { - return errs.ErrArgs.Wrap("codes is invalid") + return errs.ErrArgs.WrapMsg("codes is invalid") } return nil } func (x *GenInvitationCodeReq) Check() error { if x.Len < 1 { - return errs.ErrArgs.Wrap("len is invalid") + return errs.ErrArgs.WrapMsg("len is invalid") } if x.Num < 1 { - return errs.ErrArgs.Wrap("num is invalid") + return errs.ErrArgs.WrapMsg("num is invalid") } if x.Chars == "" { - return errs.ErrArgs.Wrap("chars is in invalid") + return errs.ErrArgs.WrapMsg("chars is in invalid") } return nil } func (x *FindInvitationCodeReq) Check() error { if x.Codes == nil { - return errs.ErrArgs.Wrap("codes is empty") + return errs.ErrArgs.WrapMsg("codes is empty") } return nil } func (x *UseInvitationCodeReq) Check() error { if x.Code == "" { - return errs.ErrArgs.Wrap("code is empty") + return errs.ErrArgs.WrapMsg("code is empty") } if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } return nil } func (x *DelInvitationCodeReq) Check() error { if x.Codes == nil { - return errs.ErrArgs.Wrap("codes is empty") + return errs.ErrArgs.WrapMsg("codes is empty") } return nil } func (x *SearchInvitationCodeReq) Check() error { - if !utils.Contain(x.Status, constant.InvitationCodeUnused, constant.InvitationCodeUsed, constant.InvitationCodeAll) { - return errs.ErrArgs.Wrap("state invalid") + if !datautil.Contain(x.Status, constant.InvitationCodeUnused, constant.InvitationCodeUsed, constant.InvitationCodeAll) { + return errs.ErrArgs.WrapMsg("state invalid") } if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *SearchUserIPLimitLoginReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *AddUserIPLimitLoginReq) Check() error { if x.Limits == nil { - return errs.ErrArgs.Wrap("limits is empty") + return errs.ErrArgs.WrapMsg("limits is empty") } return nil } func (x *DelUserIPLimitLoginReq) Check() error { if x.Limits == nil { - return errs.ErrArgs.Wrap("limits is empty") + return errs.ErrArgs.WrapMsg("limits is empty") } return nil } func (x *SearchIPForbiddenReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *AddIPForbiddenReq) Check() error { if x.Forbiddens == nil { - return errs.ErrArgs.Wrap("forbiddens is empty") + return errs.ErrArgs.WrapMsg("forbiddens is empty") } return nil } func (x *DelIPForbiddenReq) Check() error { if x.Ips == nil { - return errs.ErrArgs.Wrap("ips is empty") + return errs.ErrArgs.WrapMsg("ips is empty") } return nil } func (x *CheckRegisterForbiddenReq) Check() error { if x.Ip == "" { - return errs.ErrArgs.Wrap("ip is empty") + return errs.ErrArgs.WrapMsg("ip is empty") } return nil } func (x *CheckLoginForbiddenReq) Check() error { if x.Ip == "" && x.UserID == "" { - return errs.ErrArgs.Wrap("ip and userID is empty") + return errs.ErrArgs.WrapMsg("ip and userID is empty") } return nil } func (x *CancellationUserReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } return nil } func (x *BlockUserReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } return nil } func (x *UnblockUserReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *SearchBlockUserReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *FindUserBlockInfoReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *CreateTokenReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } if x.UserType > constant.AdminUser || x.UserType < constant.NormalUser { - return errs.ErrArgs.Wrap("userType is invalid") + return errs.ErrArgs.WrapMsg("userType is invalid") } return nil } func (x *ParseTokenReq) Check() error { if x.Token == "" { - return errs.ErrArgs.Wrap("token is empty") + return errs.ErrArgs.WrapMsg("token is empty") } return nil } func (x *AddAppletReq) Check() error { if x.Name == "" { - return errs.ErrArgs.Wrap("name is empty") + return errs.ErrArgs.WrapMsg("name is empty") } if x.AppID == "" { - return errs.ErrArgs.Wrap("appID is empty") + return errs.ErrArgs.WrapMsg("appID is empty") } if x.Icon == "" { - return errs.ErrArgs.Wrap("icon is empty") + return errs.ErrArgs.WrapMsg("icon is empty") } if x.Url == "" { - return errs.ErrArgs.Wrap("url is empty") + return errs.ErrArgs.WrapMsg("url is empty") } if x.Md5 == "" { - return errs.ErrArgs.Wrap("md5 is empty") + return errs.ErrArgs.WrapMsg("md5 is empty") } if x.Size <= 0 { - return errs.ErrArgs.Wrap("size is invalid") + return errs.ErrArgs.WrapMsg("size is invalid") } if x.Version == "" { - return errs.ErrArgs.Wrap("version is empty") + return errs.ErrArgs.WrapMsg("version is empty") } if x.Status < constant.StatusOnShelf || x.Status > constant.StatusUnShelf { - return errs.ErrArgs.Wrap("status is invalid") + return errs.ErrArgs.WrapMsg("status is invalid") } return nil } func (x *DelAppletReq) Check() error { if x.AppletIds == nil { - return errs.ErrArgs.Wrap("appletIds is empty") + return errs.ErrArgs.WrapMsg("appletIds is empty") } return nil } func (x *UpdateAppletReq) Check() error { if x.Id == "" { - return errs.ErrArgs.Wrap("id is empty") + return errs.ErrArgs.WrapMsg("id is empty") } return nil } func (x *SearchAppletReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *SetClientConfigReq) Check() error { if x.Config == nil { - return errs.ErrArgs.Wrap("config is empty") + return errs.ErrArgs.WrapMsg("config is empty") } return nil } func (x *ChangeAdminPasswordReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } if x.CurrentPassword == "" { - return errs.ErrArgs.Wrap("currentPassword is empty") + return errs.ErrArgs.WrapMsg("currentPassword is empty") } if x.NewPassword == "" { - return errs.ErrArgs.Wrap("newPassword is empty") + return errs.ErrArgs.WrapMsg("newPassword is empty") } if x.CurrentPassword == x.NewPassword { - return errs.ErrArgs.Wrap("currentPassword is equal to newPassword") + return errs.ErrArgs.WrapMsg("currentPassword is equal to newPassword") } return nil } func (x *AddAdminAccountReq) Check() error { if x.Account == "" { - return errs.ErrArgs.Wrap("account is empty") + return errs.ErrArgs.WrapMsg("account is empty") } if x.Password == "" { - return errs.ErrArgs.Wrap("password is empty") + return errs.ErrArgs.WrapMsg("password is empty") } return nil } func (x *DelAdminAccountReq) Check() error { if len(x.UserIDs) == 0 { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *SearchAdminAccountReq) Check() error { if x.Pagination.ShowNumber == 0 { - return errs.ErrArgs.Wrap("showNumber is empty") + return errs.ErrArgs.WrapMsg("showNumber is empty") } if x.Pagination.PageNumber == 0 { - return errs.ErrArgs.Wrap("pageNumber is empty") + return errs.ErrArgs.WrapMsg("pageNumber is empty") } return nil } diff --git a/pkg/proto/admin/admin.pb.go b/pkg/protocol/admin/admin.pb.go similarity index 71% rename from pkg/proto/admin/admin.pb.go rename to pkg/protocol/admin/admin.pb.go index 201ebf480..b2b7b48a2 100644 --- a/pkg/proto/admin/admin.pb.go +++ b/pkg/protocol/admin/admin.pb.go @@ -14,17 +14,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 -// protoc v4.22.0 +// protoc-gen-go v1.33.0 +// protoc v5.26.0 // source: admin/admin.proto package admin import ( context "context" - common "github.com/OpenIMSDK/chat/pkg/proto/common" - sdkws "github.com/OpenIMSDK/protocol/sdkws" - wrapperspb "github.com/OpenIMSDK/protocol/wrapperspb" + common "github.com/openimsdk/chat/pkg/protocol/common" + sdkws "github.com/openimsdk/protocol/sdkws" + wrapperspb "github.com/openimsdk/protocol/wrapperspb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -4969,7 +4969,7 @@ type SetClientConfigReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *SetClientConfigReq) Reset() { @@ -5177,7 +5177,7 @@ type GetClientConfigResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Config map[string]string `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *GetClientConfigResp) Reset() { @@ -5271,7 +5271,7 @@ type GetUserTokenResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TokensMap map[string]int32 `protobuf:"bytes,1,rep,name=tokensMap,proto3" json:"tokensMap" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + TokensMap map[string]int32 `protobuf:"bytes,1,rep,name=tokensMap,proto3" json:"tokensMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } func (x *GetUserTokenResp) Reset() { @@ -5317,818 +5317,783 @@ var File_admin_admin_proto protoreflect.FileDescriptor var file_admin_admin_proto_rawDesc = []byte{ 0x0a, 0x11, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x1a, 0x14, 0x70, 0x75, 0x62, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x73, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x70, 0x75, 0x62, - 0x2f, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x40, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x22, 0x80, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xc9, 0x02, - 0x0a, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, - 0x12, 0x3e, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x37, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x63, 0x0a, 0x13, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x22, 0x2f, - 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, - 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0x7c, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5e, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x48, 0x0a, 0x0d, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x52, 0x0d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x22, 0x2f, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2f, 0x0a, 0x13, 0x44, 0x65, - 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x44, - 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x16, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x22, 0x31, 0x0a, 0x15, 0x46, - 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x79, - 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, - 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x1a, 0x1b, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x70, 0x62, 0x2f, 0x77, 0x72, + 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, + 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, + 0x4c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x80, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, + 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x41, + 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0xab, 0x02, 0x0a, 0x12, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x66, + 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, + 0x55, 0x52, 0x4c, 0x12, 0x38, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x22, 0x63, 0x0a, 0x13, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, + 0x63, 0x65, 0x55, 0x52, 0x4c, 0x22, 0x2f, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x11, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, + 0x7c, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, + 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x19, 0x0a, + 0x17, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x58, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x87, 0x01, 0x0a, 0x16, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x22, 0x6f, 0x0a, 0x17, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x05, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x22, 0x30, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x30, 0x0a, - 0x12, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x22, - 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, - 0x14, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, - 0x73, 0x22, 0x78, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, - 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, - 0x77, 0x6f, 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7f, 0x0a, 0x0e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x4a, 0x0a, 0x16, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x22, 0x2c, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x50, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x68, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x72, - 0x73, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2d, 0x0a, 0x15, 0x46, 0x69, - 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x54, 0x0a, 0x16, 0x46, 0x69, 0x6e, - 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, - 0x42, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2c, 0x0a, 0x14, - 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, - 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x22, 0xbb, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x12, 0x3d, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6a, 0x0a, 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, - 0x73, 0x74, 0x22, 0x7c, 0x0a, 0x19, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, - 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x74, 0x0a, 0x16, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x44, 0x0a, 0x0d, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x52, 0x0d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, + 0xcc, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, + 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, + 0x65, 0x55, 0x52, 0x4c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x2f, + 0x0a, 0x13, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, + 0x16, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x16, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x22, 0x31, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x73, 0x0a, 0x16, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x91, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x49, 0x50, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1e, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x1a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x3a, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x50, 0x52, 0x06, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x22, 0x3a, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, - 0x22, 0x54, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x06, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x06, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x54, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x06, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x0e, 0x49, 0x50, 0x46, 0x6f, - 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, - 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, - 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x6c, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, - 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x12, 0x3d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x73, - 0x22, 0x55, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x40, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x50, 0x46, - 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x0a, 0x66, 0x6f, 0x72, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x49, 0x50, - 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x25, 0x0a, - 0x11, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x03, 0x69, 0x70, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2b, 0x0a, 0x19, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x40, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, + 0x22, 0x88, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x6b, 0x0a, 0x17, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x3a, 0x0a, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x30, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x41, 0x64, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x30, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x44, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x46, 0x69, + 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x22, 0x32, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x44, 0x73, 0x22, 0x72, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x0e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, + 0x6b, 0x77, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x22, 0x4a, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x73, + 0x22, 0x2c, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x17, + 0x0a, 0x15, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x50, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x10, 0x0a, 0x03, 0x6c, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x65, + 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x72, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x2d, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, + 0x73, 0x22, 0x50, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x05, 0x63, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x05, 0x63, 0x6f, + 0x64, 0x65, 0x73, 0x22, 0x42, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x45, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x3e, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x22, 0x0f, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x2a, 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x11, - 0x0a, 0x0f, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x75, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb7, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x2c, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x17, + 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xbc, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, + 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x3e, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x22, 0xbc, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, + 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, + 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x66, 0x0a, 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x76, 0x0a, + 0x19, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, + 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, + 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x50, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, - 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, - 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, - 0x35, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x30, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x77, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x1a, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x36, + 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x50, 0x52, 0x06, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x3a, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x70, 0x22, 0x50, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x06, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x50, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x06, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x73, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x83, 0x01, 0x0a, + 0x0b, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x24, 0x0a, 0x0d, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x0e, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x41, 0x64, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x68, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x73, + 0x22, 0x51, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3c, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, + 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x25, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x10, + 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73, + 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2b, 0x0a, 0x19, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x70, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x40, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, + 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x45, + 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x22, 0x4c, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x06, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, - 0x44, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x27, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x25, - 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, - 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0c, 0x41, 0x64, - 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, - 0x70, 0x70, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, - 0x35, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, - 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, - 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x0f, - 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x2c, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, - 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x64, 0x73, 0x22, 0x0f, 0x0a, - 0x0d, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xeb, - 0x04, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x61, - 0x70, 0x70, 0x49, 0x44, 0x12, 0x36, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x03, 0x6d, 0x64, 0x35, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3e, 0x0a, + 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x0f, 0x0a, + 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2a, + 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x6e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6f, 0x0a, + 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb7, + 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, + 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x30, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x77, 0x0a, 0x09, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x22, 0x48, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x06, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x44, 0x0a, + 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x22, 0x27, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x25, 0x0a, 0x0d, + 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x41, + 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, + 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x0f, 0x0a, 0x0d, + 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2c, 0x0a, + 0x0c, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x64, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x44, + 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xaf, 0x04, 0x0a, + 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x12, 0x30, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x03, 0x6d, 0x64, 0x35, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x35, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, - 0x3c, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, - 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x0f, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x22, 0x49, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x22, 0x72, 0x0a, 0x0f, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, - 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, - 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x61, 0x0a, 0x10, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x07, 0x61, 0x70, - 0x70, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x6c, - 0x65, 0x74, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x48, 0x0a, 0x06, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, - 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x15, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, - 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, - 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x22, 0x9b, 0x01, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x29, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0xa1, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x09, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x3c, 0x0a, 0x0e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xd6, 0x22, 0x0a, 0x05, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5b, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x41, 0x64, - 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x65, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x12, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x0f, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x22, 0x4a, 0x0a, 0x0e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, + 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x22, + 0x6c, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x62, 0x0a, + 0x10, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x70, + 0x70, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x74, + 0x73, 0x22, 0x95, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x44, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, + 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x65, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x22, 0x97, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x45, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x29, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x9d, 0x01, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x4b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x3c, + 0x0a, 0x0e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xe6, 0x1f, 0x0a, + 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x38, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x53, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, + 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, + 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6a, 0x0a, 0x13, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x67, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x61, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, - 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x61, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x64, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6a, 0x0a, 0x13, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, - 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, - 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x24, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x59, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, + 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x22, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x24, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, 0x64, 0x64, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x21, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x44, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x67, 0x0a, 0x12, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x64, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x64, 0x0a, 0x11, 0x47, 0x65, 0x6e, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x26, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x67, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x28, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x64, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x64, - 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, - 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x6d, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, - 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x29, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x73, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x2c, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6a, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x55, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x46, 0x69, 0x6e, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x21, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, + 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, + 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x5c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x65, + 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, - 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, + 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, + 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, + 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x6a, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x28, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, - 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x64, 0x0a, 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, - 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5b, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, - 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, - 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x5b, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, - 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, - 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x61, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x1a, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x52, 0x0a, 0x0b, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x25, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, + 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x49, + 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, + 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x50, + 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, + 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, + 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, + 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, + 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x56, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x64, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x73, 0x0a, 0x16, 0x43, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, + 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x2b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x1a, 0x2c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x6a, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, - 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, - 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, - 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a, 0x0b, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x4f, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, - 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x4c, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1e, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x4c, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1e, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, - 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x21, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, - 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, - 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, - 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, + 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x09, 0x41, + 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x44, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1a, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, + 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, + 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, + 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, + 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, - 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5e, 0x0a, 0x0f, - 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, + 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, 0x0c, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, - 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x63, 0x68, 0x61, 0x74, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x68, + 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6145,255 +6110,255 @@ func file_admin_admin_proto_rawDescGZIP() []byte { var file_admin_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 104) var file_admin_admin_proto_goTypes = []interface{}{ - (*LoginReq)(nil), // 0: OpenIMChat.admin.LoginReq - (*LoginResp)(nil), // 1: OpenIMChat.admin.LoginResp - (*AddAdminAccountReq)(nil), // 2: OpenIMChat.admin.AddAdminAccountReq - (*AddAdminAccountResp)(nil), // 3: OpenIMChat.admin.AddAdminAccountResp - (*AdminUpdateInfoReq)(nil), // 4: OpenIMChat.admin.AdminUpdateInfoReq - (*AdminUpdateInfoResp)(nil), // 5: OpenIMChat.admin.AdminUpdateInfoResp - (*ChangePasswordReq)(nil), // 6: OpenIMChat.admin.ChangePasswordReq - (*ChangePasswordResp)(nil), // 7: OpenIMChat.admin.ChangePasswordResp - (*GetAdminInfoReq)(nil), // 8: OpenIMChat.admin.GetAdminInfoReq - (*ChangeAdminPasswordReq)(nil), // 9: OpenIMChat.admin.ChangeAdminPasswordReq - (*ChangeAdminPasswordResp)(nil), // 10: OpenIMChat.admin.ChangeAdminPasswordResp - (*DelAdminAccountReq)(nil), // 11: OpenIMChat.admin.DelAdminAccountReq - (*DelAdminAccountResp)(nil), // 12: OpenIMChat.admin.DelAdminAccountResp - (*SearchAdminAccountReq)(nil), // 13: OpenIMChat.admin.SearchAdminAccountReq - (*SearchAdminAccountResp)(nil), // 14: OpenIMChat.admin.SearchAdminAccountResp - (*GetAdminInfoResp)(nil), // 15: OpenIMChat.admin.GetAdminInfoResp - (*AddDefaultFriendReq)(nil), // 16: OpenIMChat.admin.AddDefaultFriendReq - (*AddDefaultFriendResp)(nil), // 17: OpenIMChat.admin.AddDefaultFriendResp - (*DelDefaultFriendReq)(nil), // 18: OpenIMChat.admin.DelDefaultFriendReq - (*DelDefaultFriendResp)(nil), // 19: OpenIMChat.admin.DelDefaultFriendResp - (*FindDefaultFriendReq)(nil), // 20: OpenIMChat.admin.FindDefaultFriendReq - (*FindDefaultFriendResp)(nil), // 21: OpenIMChat.admin.FindDefaultFriendResp - (*SearchDefaultFriendReq)(nil), // 22: OpenIMChat.admin.SearchDefaultFriendReq - (*DefaultFriendAttribute)(nil), // 23: OpenIMChat.admin.DefaultFriendAttribute - (*SearchDefaultFriendResp)(nil), // 24: OpenIMChat.admin.SearchDefaultFriendResp - (*AddDefaultGroupReq)(nil), // 25: OpenIMChat.admin.AddDefaultGroupReq - (*AddDefaultGroupResp)(nil), // 26: OpenIMChat.admin.AddDefaultGroupResp - (*DelDefaultGroupReq)(nil), // 27: OpenIMChat.admin.DelDefaultGroupReq - (*DelDefaultGroupResp)(nil), // 28: OpenIMChat.admin.DelDefaultGroupResp - (*FindDefaultGroupReq)(nil), // 29: OpenIMChat.admin.FindDefaultGroupReq - (*FindDefaultGroupResp)(nil), // 30: OpenIMChat.admin.FindDefaultGroupResp - (*SearchDefaultGroupReq)(nil), // 31: OpenIMChat.admin.SearchDefaultGroupReq - (*GroupAttribute)(nil), // 32: OpenIMChat.admin.GroupAttribute - (*SearchDefaultGroupResp)(nil), // 33: OpenIMChat.admin.SearchDefaultGroupResp - (*AddInvitationCodeReq)(nil), // 34: OpenIMChat.admin.AddInvitationCodeReq - (*AddInvitationCodeResp)(nil), // 35: OpenIMChat.admin.AddInvitationCodeResp - (*GenInvitationCodeReq)(nil), // 36: OpenIMChat.admin.GenInvitationCodeReq - (*GenInvitationCodeResp)(nil), // 37: OpenIMChat.admin.GenInvitationCodeResp - (*FindInvitationCodeReq)(nil), // 38: OpenIMChat.admin.FindInvitationCodeReq - (*FindInvitationCodeResp)(nil), // 39: OpenIMChat.admin.FindInvitationCodeResp - (*UseInvitationCodeReq)(nil), // 40: OpenIMChat.admin.UseInvitationCodeReq - (*UseInvitationCodeResp)(nil), // 41: OpenIMChat.admin.UseInvitationCodeResp - (*DelInvitationCodeReq)(nil), // 42: OpenIMChat.admin.DelInvitationCodeReq - (*DelInvitationCodeResp)(nil), // 43: OpenIMChat.admin.DelInvitationCodeResp - (*InvitationRegister)(nil), // 44: OpenIMChat.admin.InvitationRegister - (*SearchInvitationCodeReq)(nil), // 45: OpenIMChat.admin.SearchInvitationCodeReq - (*SearchInvitationCodeResp)(nil), // 46: OpenIMChat.admin.SearchInvitationCodeResp - (*SearchUserIPLimitLoginReq)(nil), // 47: OpenIMChat.admin.SearchUserIPLimitLoginReq - (*LimitUserLoginIP)(nil), // 48: OpenIMChat.admin.LimitUserLoginIP - (*SearchUserIPLimitLoginResp)(nil), // 49: OpenIMChat.admin.SearchUserIPLimitLoginResp - (*UserIPLimitLogin)(nil), // 50: OpenIMChat.admin.UserIPLimitLogin - (*AddUserIPLimitLoginReq)(nil), // 51: OpenIMChat.admin.AddUserIPLimitLoginReq - (*AddUserIPLimitLoginResp)(nil), // 52: OpenIMChat.admin.AddUserIPLimitLoginResp - (*DelUserIPLimitLoginReq)(nil), // 53: OpenIMChat.admin.DelUserIPLimitLoginReq - (*DelUserIPLimitLoginResp)(nil), // 54: OpenIMChat.admin.DelUserIPLimitLoginResp - (*IPForbidden)(nil), // 55: OpenIMChat.admin.IPForbidden - (*IPForbiddenAdd)(nil), // 56: OpenIMChat.admin.IPForbiddenAdd - (*SearchIPForbiddenReq)(nil), // 57: OpenIMChat.admin.SearchIPForbiddenReq - (*SearchIPForbiddenResp)(nil), // 58: OpenIMChat.admin.SearchIPForbiddenResp - (*AddIPForbiddenReq)(nil), // 59: OpenIMChat.admin.AddIPForbiddenReq - (*AddIPForbiddenResp)(nil), // 60: OpenIMChat.admin.AddIPForbiddenResp - (*DelIPForbiddenReq)(nil), // 61: OpenIMChat.admin.DelIPForbiddenReq - (*DelIPForbiddenResp)(nil), // 62: OpenIMChat.admin.DelIPForbiddenResp - (*CheckRegisterForbiddenReq)(nil), // 63: OpenIMChat.admin.CheckRegisterForbiddenReq - (*CheckRegisterForbiddenResp)(nil), // 64: OpenIMChat.admin.CheckRegisterForbiddenResp - (*CheckLoginForbiddenReq)(nil), // 65: OpenIMChat.admin.CheckLoginForbiddenReq - (*CheckLoginForbiddenResp)(nil), // 66: OpenIMChat.admin.CheckLoginForbiddenResp - (*CancellationUserReq)(nil), // 67: OpenIMChat.admin.CancellationUserReq - (*CancellationUserResp)(nil), // 68: OpenIMChat.admin.CancellationUserResp - (*BlockUserReq)(nil), // 69: OpenIMChat.admin.BlockUserReq - (*BlockUserResp)(nil), // 70: OpenIMChat.admin.BlockUserResp - (*UnblockUserReq)(nil), // 71: OpenIMChat.admin.UnblockUserReq - (*UnblockUserResp)(nil), // 72: OpenIMChat.admin.UnblockUserResp - (*SearchBlockUserReq)(nil), // 73: OpenIMChat.admin.SearchBlockUserReq - (*BlockUserInfo)(nil), // 74: OpenIMChat.admin.BlockUserInfo - (*SearchBlockUserResp)(nil), // 75: OpenIMChat.admin.SearchBlockUserResp - (*FindUserBlockInfoReq)(nil), // 76: OpenIMChat.admin.FindUserBlockInfoReq - (*BlockInfo)(nil), // 77: OpenIMChat.admin.BlockInfo - (*FindUserBlockInfoResp)(nil), // 78: OpenIMChat.admin.FindUserBlockInfoResp - (*CreateTokenReq)(nil), // 79: OpenIMChat.admin.CreateTokenReq - (*CreateTokenResp)(nil), // 80: OpenIMChat.admin.CreateTokenResp - (*ParseTokenReq)(nil), // 81: OpenIMChat.admin.ParseTokenReq - (*ParseTokenResp)(nil), // 82: OpenIMChat.admin.ParseTokenResp - (*AddAppletReq)(nil), // 83: OpenIMChat.admin.AddAppletReq - (*AddAppletResp)(nil), // 84: OpenIMChat.admin.AddAppletResp - (*DelAppletReq)(nil), // 85: OpenIMChat.admin.DelAppletReq - (*DelAppletResp)(nil), // 86: OpenIMChat.admin.DelAppletResp - (*UpdateAppletReq)(nil), // 87: OpenIMChat.admin.UpdateAppletReq - (*UpdateAppletResp)(nil), // 88: OpenIMChat.admin.UpdateAppletResp - (*FindAppletReq)(nil), // 89: OpenIMChat.admin.FindAppletReq - (*FindAppletResp)(nil), // 90: OpenIMChat.admin.FindAppletResp - (*SearchAppletReq)(nil), // 91: OpenIMChat.admin.SearchAppletReq - (*SearchAppletResp)(nil), // 92: OpenIMChat.admin.SearchAppletResp - (*SetClientConfigReq)(nil), // 93: OpenIMChat.admin.SetClientConfigReq - (*SetClientConfigResp)(nil), // 94: OpenIMChat.admin.SetClientConfigResp - (*DelClientConfigReq)(nil), // 95: OpenIMChat.admin.DelClientConfigReq - (*DelClientConfigResp)(nil), // 96: OpenIMChat.admin.DelClientConfigResp - (*GetClientConfigReq)(nil), // 97: OpenIMChat.admin.GetClientConfigReq - (*GetClientConfigResp)(nil), // 98: OpenIMChat.admin.GetClientConfigResp - (*GetUserTokenReq)(nil), // 99: OpenIMChat.admin.GetUserTokenReq - (*GetUserTokenResp)(nil), // 100: OpenIMChat.admin.GetUserTokenResp - nil, // 101: OpenIMChat.admin.SetClientConfigReq.ConfigEntry - nil, // 102: OpenIMChat.admin.GetClientConfigResp.ConfigEntry - nil, // 103: OpenIMChat.admin.GetUserTokenResp.TokensMapEntry - (*wrapperspb.StringValue)(nil), // 104: OpenIMServer.protobuf.StringValue - (*wrapperspb.Int32Value)(nil), // 105: OpenIMServer.protobuf.Int32Value - (*sdkws.RequestPagination)(nil), // 106: OpenIMServer.sdkws.RequestPagination - (*common.UserPublicInfo)(nil), // 107: OpenIMChat.common.UserPublicInfo - (*sdkws.GroupInfo)(nil), // 108: OpenIMServer.sdkws.GroupInfo - (*wrapperspb.Int64Value)(nil), // 109: OpenIMServer.protobuf.Int64Value - (*wrapperspb.UInt32Value)(nil), // 110: OpenIMServer.protobuf.UInt32Value - (*common.AppletInfo)(nil), // 111: OpenIMChat.common.AppletInfo + (*LoginReq)(nil), // 0: openim.admin.LoginReq + (*LoginResp)(nil), // 1: openim.admin.LoginResp + (*AddAdminAccountReq)(nil), // 2: openim.admin.AddAdminAccountReq + (*AddAdminAccountResp)(nil), // 3: openim.admin.AddAdminAccountResp + (*AdminUpdateInfoReq)(nil), // 4: openim.admin.AdminUpdateInfoReq + (*AdminUpdateInfoResp)(nil), // 5: openim.admin.AdminUpdateInfoResp + (*ChangePasswordReq)(nil), // 6: openim.admin.ChangePasswordReq + (*ChangePasswordResp)(nil), // 7: openim.admin.ChangePasswordResp + (*GetAdminInfoReq)(nil), // 8: openim.admin.GetAdminInfoReq + (*ChangeAdminPasswordReq)(nil), // 9: openim.admin.ChangeAdminPasswordReq + (*ChangeAdminPasswordResp)(nil), // 10: openim.admin.ChangeAdminPasswordResp + (*DelAdminAccountReq)(nil), // 11: openim.admin.DelAdminAccountReq + (*DelAdminAccountResp)(nil), // 12: openim.admin.DelAdminAccountResp + (*SearchAdminAccountReq)(nil), // 13: openim.admin.SearchAdminAccountReq + (*SearchAdminAccountResp)(nil), // 14: openim.admin.SearchAdminAccountResp + (*GetAdminInfoResp)(nil), // 15: openim.admin.GetAdminInfoResp + (*AddDefaultFriendReq)(nil), // 16: openim.admin.AddDefaultFriendReq + (*AddDefaultFriendResp)(nil), // 17: openim.admin.AddDefaultFriendResp + (*DelDefaultFriendReq)(nil), // 18: openim.admin.DelDefaultFriendReq + (*DelDefaultFriendResp)(nil), // 19: openim.admin.DelDefaultFriendResp + (*FindDefaultFriendReq)(nil), // 20: openim.admin.FindDefaultFriendReq + (*FindDefaultFriendResp)(nil), // 21: openim.admin.FindDefaultFriendResp + (*SearchDefaultFriendReq)(nil), // 22: openim.admin.SearchDefaultFriendReq + (*DefaultFriendAttribute)(nil), // 23: openim.admin.DefaultFriendAttribute + (*SearchDefaultFriendResp)(nil), // 24: openim.admin.SearchDefaultFriendResp + (*AddDefaultGroupReq)(nil), // 25: openim.admin.AddDefaultGroupReq + (*AddDefaultGroupResp)(nil), // 26: openim.admin.AddDefaultGroupResp + (*DelDefaultGroupReq)(nil), // 27: openim.admin.DelDefaultGroupReq + (*DelDefaultGroupResp)(nil), // 28: openim.admin.DelDefaultGroupResp + (*FindDefaultGroupReq)(nil), // 29: openim.admin.FindDefaultGroupReq + (*FindDefaultGroupResp)(nil), // 30: openim.admin.FindDefaultGroupResp + (*SearchDefaultGroupReq)(nil), // 31: openim.admin.SearchDefaultGroupReq + (*GroupAttribute)(nil), // 32: openim.admin.GroupAttribute + (*SearchDefaultGroupResp)(nil), // 33: openim.admin.SearchDefaultGroupResp + (*AddInvitationCodeReq)(nil), // 34: openim.admin.AddInvitationCodeReq + (*AddInvitationCodeResp)(nil), // 35: openim.admin.AddInvitationCodeResp + (*GenInvitationCodeReq)(nil), // 36: openim.admin.GenInvitationCodeReq + (*GenInvitationCodeResp)(nil), // 37: openim.admin.GenInvitationCodeResp + (*FindInvitationCodeReq)(nil), // 38: openim.admin.FindInvitationCodeReq + (*FindInvitationCodeResp)(nil), // 39: openim.admin.FindInvitationCodeResp + (*UseInvitationCodeReq)(nil), // 40: openim.admin.UseInvitationCodeReq + (*UseInvitationCodeResp)(nil), // 41: openim.admin.UseInvitationCodeResp + (*DelInvitationCodeReq)(nil), // 42: openim.admin.DelInvitationCodeReq + (*DelInvitationCodeResp)(nil), // 43: openim.admin.DelInvitationCodeResp + (*InvitationRegister)(nil), // 44: openim.admin.InvitationRegister + (*SearchInvitationCodeReq)(nil), // 45: openim.admin.SearchInvitationCodeReq + (*SearchInvitationCodeResp)(nil), // 46: openim.admin.SearchInvitationCodeResp + (*SearchUserIPLimitLoginReq)(nil), // 47: openim.admin.SearchUserIPLimitLoginReq + (*LimitUserLoginIP)(nil), // 48: openim.admin.LimitUserLoginIP + (*SearchUserIPLimitLoginResp)(nil), // 49: openim.admin.SearchUserIPLimitLoginResp + (*UserIPLimitLogin)(nil), // 50: openim.admin.UserIPLimitLogin + (*AddUserIPLimitLoginReq)(nil), // 51: openim.admin.AddUserIPLimitLoginReq + (*AddUserIPLimitLoginResp)(nil), // 52: openim.admin.AddUserIPLimitLoginResp + (*DelUserIPLimitLoginReq)(nil), // 53: openim.admin.DelUserIPLimitLoginReq + (*DelUserIPLimitLoginResp)(nil), // 54: openim.admin.DelUserIPLimitLoginResp + (*IPForbidden)(nil), // 55: openim.admin.IPForbidden + (*IPForbiddenAdd)(nil), // 56: openim.admin.IPForbiddenAdd + (*SearchIPForbiddenReq)(nil), // 57: openim.admin.SearchIPForbiddenReq + (*SearchIPForbiddenResp)(nil), // 58: openim.admin.SearchIPForbiddenResp + (*AddIPForbiddenReq)(nil), // 59: openim.admin.AddIPForbiddenReq + (*AddIPForbiddenResp)(nil), // 60: openim.admin.AddIPForbiddenResp + (*DelIPForbiddenReq)(nil), // 61: openim.admin.DelIPForbiddenReq + (*DelIPForbiddenResp)(nil), // 62: openim.admin.DelIPForbiddenResp + (*CheckRegisterForbiddenReq)(nil), // 63: openim.admin.CheckRegisterForbiddenReq + (*CheckRegisterForbiddenResp)(nil), // 64: openim.admin.CheckRegisterForbiddenResp + (*CheckLoginForbiddenReq)(nil), // 65: openim.admin.CheckLoginForbiddenReq + (*CheckLoginForbiddenResp)(nil), // 66: openim.admin.CheckLoginForbiddenResp + (*CancellationUserReq)(nil), // 67: openim.admin.CancellationUserReq + (*CancellationUserResp)(nil), // 68: openim.admin.CancellationUserResp + (*BlockUserReq)(nil), // 69: openim.admin.BlockUserReq + (*BlockUserResp)(nil), // 70: openim.admin.BlockUserResp + (*UnblockUserReq)(nil), // 71: openim.admin.UnblockUserReq + (*UnblockUserResp)(nil), // 72: openim.admin.UnblockUserResp + (*SearchBlockUserReq)(nil), // 73: openim.admin.SearchBlockUserReq + (*BlockUserInfo)(nil), // 74: openim.admin.BlockUserInfo + (*SearchBlockUserResp)(nil), // 75: openim.admin.SearchBlockUserResp + (*FindUserBlockInfoReq)(nil), // 76: openim.admin.FindUserBlockInfoReq + (*BlockInfo)(nil), // 77: openim.admin.BlockInfo + (*FindUserBlockInfoResp)(nil), // 78: openim.admin.FindUserBlockInfoResp + (*CreateTokenReq)(nil), // 79: openim.admin.CreateTokenReq + (*CreateTokenResp)(nil), // 80: openim.admin.CreateTokenResp + (*ParseTokenReq)(nil), // 81: openim.admin.ParseTokenReq + (*ParseTokenResp)(nil), // 82: openim.admin.ParseTokenResp + (*AddAppletReq)(nil), // 83: openim.admin.AddAppletReq + (*AddAppletResp)(nil), // 84: openim.admin.AddAppletResp + (*DelAppletReq)(nil), // 85: openim.admin.DelAppletReq + (*DelAppletResp)(nil), // 86: openim.admin.DelAppletResp + (*UpdateAppletReq)(nil), // 87: openim.admin.UpdateAppletReq + (*UpdateAppletResp)(nil), // 88: openim.admin.UpdateAppletResp + (*FindAppletReq)(nil), // 89: openim.admin.FindAppletReq + (*FindAppletResp)(nil), // 90: openim.admin.FindAppletResp + (*SearchAppletReq)(nil), // 91: openim.admin.SearchAppletReq + (*SearchAppletResp)(nil), // 92: openim.admin.SearchAppletResp + (*SetClientConfigReq)(nil), // 93: openim.admin.SetClientConfigReq + (*SetClientConfigResp)(nil), // 94: openim.admin.SetClientConfigResp + (*DelClientConfigReq)(nil), // 95: openim.admin.DelClientConfigReq + (*DelClientConfigResp)(nil), // 96: openim.admin.DelClientConfigResp + (*GetClientConfigReq)(nil), // 97: openim.admin.GetClientConfigReq + (*GetClientConfigResp)(nil), // 98: openim.admin.GetClientConfigResp + (*GetUserTokenReq)(nil), // 99: openim.admin.GetUserTokenReq + (*GetUserTokenResp)(nil), // 100: openim.admin.GetUserTokenResp + nil, // 101: openim.admin.SetClientConfigReq.ConfigEntry + nil, // 102: openim.admin.GetClientConfigResp.ConfigEntry + nil, // 103: openim.admin.GetUserTokenResp.TokensMapEntry + (*wrapperspb.StringValue)(nil), // 104: openim.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 105: openim.protobuf.Int32Value + (*sdkws.RequestPagination)(nil), // 106: openim.sdkws.RequestPagination + (*common.UserPublicInfo)(nil), // 107: openim.chat.common.UserPublicInfo + (*sdkws.GroupInfo)(nil), // 108: openim.sdkws.GroupInfo + (*wrapperspb.Int64Value)(nil), // 109: openim.protobuf.Int64Value + (*wrapperspb.UInt32Value)(nil), // 110: openim.protobuf.UInt32Value + (*common.AppletInfo)(nil), // 111: openim.chat.common.AppletInfo } var file_admin_admin_proto_depIdxs = []int32{ - 104, // 0: OpenIMChat.admin.AdminUpdateInfoReq.account:type_name -> OpenIMServer.protobuf.StringValue - 104, // 1: OpenIMChat.admin.AdminUpdateInfoReq.password:type_name -> OpenIMServer.protobuf.StringValue - 104, // 2: OpenIMChat.admin.AdminUpdateInfoReq.faceURL:type_name -> OpenIMServer.protobuf.StringValue - 104, // 3: OpenIMChat.admin.AdminUpdateInfoReq.nickname:type_name -> OpenIMServer.protobuf.StringValue - 105, // 4: OpenIMChat.admin.AdminUpdateInfoReq.level:type_name -> OpenIMServer.protobuf.Int32Value - 106, // 5: OpenIMChat.admin.SearchAdminAccountReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 15, // 6: OpenIMChat.admin.SearchAdminAccountResp.adminAccounts:type_name -> OpenIMChat.admin.GetAdminInfoResp - 106, // 7: OpenIMChat.admin.SearchDefaultFriendReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 107, // 8: OpenIMChat.admin.DefaultFriendAttribute.user:type_name -> OpenIMChat.common.UserPublicInfo - 23, // 9: OpenIMChat.admin.SearchDefaultFriendResp.users:type_name -> OpenIMChat.admin.DefaultFriendAttribute - 106, // 10: OpenIMChat.admin.SearchDefaultGroupReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 108, // 11: OpenIMChat.admin.GroupAttribute.group:type_name -> OpenIMServer.sdkws.GroupInfo - 44, // 12: OpenIMChat.admin.FindInvitationCodeResp.codes:type_name -> OpenIMChat.admin.InvitationRegister - 107, // 13: OpenIMChat.admin.InvitationRegister.usedUser:type_name -> OpenIMChat.common.UserPublicInfo - 106, // 14: OpenIMChat.admin.SearchInvitationCodeReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 44, // 15: OpenIMChat.admin.SearchInvitationCodeResp.list:type_name -> OpenIMChat.admin.InvitationRegister - 106, // 16: OpenIMChat.admin.SearchUserIPLimitLoginReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 107, // 17: OpenIMChat.admin.LimitUserLoginIP.user:type_name -> OpenIMChat.common.UserPublicInfo - 48, // 18: OpenIMChat.admin.SearchUserIPLimitLoginResp.limits:type_name -> OpenIMChat.admin.LimitUserLoginIP - 50, // 19: OpenIMChat.admin.AddUserIPLimitLoginReq.limits:type_name -> OpenIMChat.admin.UserIPLimitLogin - 50, // 20: OpenIMChat.admin.DelUserIPLimitLoginReq.limits:type_name -> OpenIMChat.admin.UserIPLimitLogin - 106, // 21: OpenIMChat.admin.SearchIPForbiddenReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 55, // 22: OpenIMChat.admin.SearchIPForbiddenResp.forbiddens:type_name -> OpenIMChat.admin.IPForbidden - 56, // 23: OpenIMChat.admin.AddIPForbiddenReq.forbiddens:type_name -> OpenIMChat.admin.IPForbiddenAdd - 106, // 24: OpenIMChat.admin.SearchBlockUserReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 74, // 25: OpenIMChat.admin.SearchBlockUserResp.users:type_name -> OpenIMChat.admin.BlockUserInfo - 77, // 26: OpenIMChat.admin.FindUserBlockInfoResp.blocks:type_name -> OpenIMChat.admin.BlockInfo - 104, // 27: OpenIMChat.admin.UpdateAppletReq.name:type_name -> OpenIMServer.protobuf.StringValue - 104, // 28: OpenIMChat.admin.UpdateAppletReq.appID:type_name -> OpenIMServer.protobuf.StringValue - 104, // 29: OpenIMChat.admin.UpdateAppletReq.icon:type_name -> OpenIMServer.protobuf.StringValue - 104, // 30: OpenIMChat.admin.UpdateAppletReq.url:type_name -> OpenIMServer.protobuf.StringValue - 104, // 31: OpenIMChat.admin.UpdateAppletReq.md5:type_name -> OpenIMServer.protobuf.StringValue - 109, // 32: OpenIMChat.admin.UpdateAppletReq.size:type_name -> OpenIMServer.protobuf.Int64Value - 104, // 33: OpenIMChat.admin.UpdateAppletReq.version:type_name -> OpenIMServer.protobuf.StringValue - 110, // 34: OpenIMChat.admin.UpdateAppletReq.priority:type_name -> OpenIMServer.protobuf.UInt32Value - 110, // 35: OpenIMChat.admin.UpdateAppletReq.status:type_name -> OpenIMServer.protobuf.UInt32Value - 109, // 36: OpenIMChat.admin.UpdateAppletReq.createTime:type_name -> OpenIMServer.protobuf.Int64Value - 111, // 37: OpenIMChat.admin.FindAppletResp.applets:type_name -> OpenIMChat.common.AppletInfo - 106, // 38: OpenIMChat.admin.SearchAppletReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 111, // 39: OpenIMChat.admin.SearchAppletResp.applets:type_name -> OpenIMChat.common.AppletInfo - 101, // 40: OpenIMChat.admin.SetClientConfigReq.config:type_name -> OpenIMChat.admin.SetClientConfigReq.ConfigEntry - 102, // 41: OpenIMChat.admin.GetClientConfigResp.config:type_name -> OpenIMChat.admin.GetClientConfigResp.ConfigEntry - 103, // 42: OpenIMChat.admin.GetUserTokenResp.tokensMap:type_name -> OpenIMChat.admin.GetUserTokenResp.TokensMapEntry - 0, // 43: OpenIMChat.admin.admin.Login:input_type -> OpenIMChat.admin.LoginReq - 6, // 44: OpenIMChat.admin.admin.ChangePassword:input_type -> OpenIMChat.admin.ChangePasswordReq - 4, // 45: OpenIMChat.admin.admin.AdminUpdateInfo:input_type -> OpenIMChat.admin.AdminUpdateInfoReq - 8, // 46: OpenIMChat.admin.admin.GetAdminInfo:input_type -> OpenIMChat.admin.GetAdminInfoReq - 2, // 47: OpenIMChat.admin.admin.AddAdminAccount:input_type -> OpenIMChat.admin.AddAdminAccountReq - 9, // 48: OpenIMChat.admin.admin.ChangeAdminPassword:input_type -> OpenIMChat.admin.ChangeAdminPasswordReq - 11, // 49: OpenIMChat.admin.admin.DelAdminAccount:input_type -> OpenIMChat.admin.DelAdminAccountReq - 13, // 50: OpenIMChat.admin.admin.SearchAdminAccount:input_type -> OpenIMChat.admin.SearchAdminAccountReq - 16, // 51: OpenIMChat.admin.admin.AddDefaultFriend:input_type -> OpenIMChat.admin.AddDefaultFriendReq - 18, // 52: OpenIMChat.admin.admin.DelDefaultFriend:input_type -> OpenIMChat.admin.DelDefaultFriendReq - 20, // 53: OpenIMChat.admin.admin.FindDefaultFriend:input_type -> OpenIMChat.admin.FindDefaultFriendReq - 22, // 54: OpenIMChat.admin.admin.SearchDefaultFriend:input_type -> OpenIMChat.admin.SearchDefaultFriendReq - 25, // 55: OpenIMChat.admin.admin.AddDefaultGroup:input_type -> OpenIMChat.admin.AddDefaultGroupReq - 27, // 56: OpenIMChat.admin.admin.DelDefaultGroup:input_type -> OpenIMChat.admin.DelDefaultGroupReq - 29, // 57: OpenIMChat.admin.admin.FindDefaultGroup:input_type -> OpenIMChat.admin.FindDefaultGroupReq - 31, // 58: OpenIMChat.admin.admin.SearchDefaultGroup:input_type -> OpenIMChat.admin.SearchDefaultGroupReq - 34, // 59: OpenIMChat.admin.admin.AddInvitationCode:input_type -> OpenIMChat.admin.AddInvitationCodeReq - 36, // 60: OpenIMChat.admin.admin.GenInvitationCode:input_type -> OpenIMChat.admin.GenInvitationCodeReq - 38, // 61: OpenIMChat.admin.admin.FindInvitationCode:input_type -> OpenIMChat.admin.FindInvitationCodeReq - 40, // 62: OpenIMChat.admin.admin.UseInvitationCode:input_type -> OpenIMChat.admin.UseInvitationCodeReq - 42, // 63: OpenIMChat.admin.admin.DelInvitationCode:input_type -> OpenIMChat.admin.DelInvitationCodeReq - 45, // 64: OpenIMChat.admin.admin.SearchInvitationCode:input_type -> OpenIMChat.admin.SearchInvitationCodeReq - 47, // 65: OpenIMChat.admin.admin.SearchUserIPLimitLogin:input_type -> OpenIMChat.admin.SearchUserIPLimitLoginReq - 51, // 66: OpenIMChat.admin.admin.AddUserIPLimitLogin:input_type -> OpenIMChat.admin.AddUserIPLimitLoginReq - 53, // 67: OpenIMChat.admin.admin.DelUserIPLimitLogin:input_type -> OpenIMChat.admin.DelUserIPLimitLoginReq - 57, // 68: OpenIMChat.admin.admin.SearchIPForbidden:input_type -> OpenIMChat.admin.SearchIPForbiddenReq - 59, // 69: OpenIMChat.admin.admin.AddIPForbidden:input_type -> OpenIMChat.admin.AddIPForbiddenReq - 61, // 70: OpenIMChat.admin.admin.DelIPForbidden:input_type -> OpenIMChat.admin.DelIPForbiddenReq - 67, // 71: OpenIMChat.admin.admin.CancellationUser:input_type -> OpenIMChat.admin.CancellationUserReq - 69, // 72: OpenIMChat.admin.admin.BlockUser:input_type -> OpenIMChat.admin.BlockUserReq - 71, // 73: OpenIMChat.admin.admin.UnblockUser:input_type -> OpenIMChat.admin.UnblockUserReq - 73, // 74: OpenIMChat.admin.admin.SearchBlockUser:input_type -> OpenIMChat.admin.SearchBlockUserReq - 76, // 75: OpenIMChat.admin.admin.FindUserBlockInfo:input_type -> OpenIMChat.admin.FindUserBlockInfoReq - 63, // 76: OpenIMChat.admin.admin.CheckRegisterForbidden:input_type -> OpenIMChat.admin.CheckRegisterForbiddenReq - 65, // 77: OpenIMChat.admin.admin.CheckLoginForbidden:input_type -> OpenIMChat.admin.CheckLoginForbiddenReq - 79, // 78: OpenIMChat.admin.admin.CreateToken:input_type -> OpenIMChat.admin.CreateTokenReq - 81, // 79: OpenIMChat.admin.admin.ParseToken:input_type -> OpenIMChat.admin.ParseTokenReq - 83, // 80: OpenIMChat.admin.admin.AddApplet:input_type -> OpenIMChat.admin.AddAppletReq - 85, // 81: OpenIMChat.admin.admin.DelApplet:input_type -> OpenIMChat.admin.DelAppletReq - 87, // 82: OpenIMChat.admin.admin.UpdateApplet:input_type -> OpenIMChat.admin.UpdateAppletReq - 89, // 83: OpenIMChat.admin.admin.FindApplet:input_type -> OpenIMChat.admin.FindAppletReq - 91, // 84: OpenIMChat.admin.admin.SearchApplet:input_type -> OpenIMChat.admin.SearchAppletReq - 97, // 85: OpenIMChat.admin.admin.GetClientConfig:input_type -> OpenIMChat.admin.GetClientConfigReq - 93, // 86: OpenIMChat.admin.admin.SetClientConfig:input_type -> OpenIMChat.admin.SetClientConfigReq - 95, // 87: OpenIMChat.admin.admin.DelClientConfig:input_type -> OpenIMChat.admin.DelClientConfigReq - 99, // 88: OpenIMChat.admin.admin.GetUserToken:input_type -> OpenIMChat.admin.GetUserTokenReq - 1, // 89: OpenIMChat.admin.admin.Login:output_type -> OpenIMChat.admin.LoginResp - 7, // 90: OpenIMChat.admin.admin.ChangePassword:output_type -> OpenIMChat.admin.ChangePasswordResp - 5, // 91: OpenIMChat.admin.admin.AdminUpdateInfo:output_type -> OpenIMChat.admin.AdminUpdateInfoResp - 15, // 92: OpenIMChat.admin.admin.GetAdminInfo:output_type -> OpenIMChat.admin.GetAdminInfoResp - 3, // 93: OpenIMChat.admin.admin.AddAdminAccount:output_type -> OpenIMChat.admin.AddAdminAccountResp - 10, // 94: OpenIMChat.admin.admin.ChangeAdminPassword:output_type -> OpenIMChat.admin.ChangeAdminPasswordResp - 12, // 95: OpenIMChat.admin.admin.DelAdminAccount:output_type -> OpenIMChat.admin.DelAdminAccountResp - 14, // 96: OpenIMChat.admin.admin.SearchAdminAccount:output_type -> OpenIMChat.admin.SearchAdminAccountResp - 17, // 97: OpenIMChat.admin.admin.AddDefaultFriend:output_type -> OpenIMChat.admin.AddDefaultFriendResp - 19, // 98: OpenIMChat.admin.admin.DelDefaultFriend:output_type -> OpenIMChat.admin.DelDefaultFriendResp - 21, // 99: OpenIMChat.admin.admin.FindDefaultFriend:output_type -> OpenIMChat.admin.FindDefaultFriendResp - 24, // 100: OpenIMChat.admin.admin.SearchDefaultFriend:output_type -> OpenIMChat.admin.SearchDefaultFriendResp - 26, // 101: OpenIMChat.admin.admin.AddDefaultGroup:output_type -> OpenIMChat.admin.AddDefaultGroupResp - 28, // 102: OpenIMChat.admin.admin.DelDefaultGroup:output_type -> OpenIMChat.admin.DelDefaultGroupResp - 30, // 103: OpenIMChat.admin.admin.FindDefaultGroup:output_type -> OpenIMChat.admin.FindDefaultGroupResp - 33, // 104: OpenIMChat.admin.admin.SearchDefaultGroup:output_type -> OpenIMChat.admin.SearchDefaultGroupResp - 35, // 105: OpenIMChat.admin.admin.AddInvitationCode:output_type -> OpenIMChat.admin.AddInvitationCodeResp - 37, // 106: OpenIMChat.admin.admin.GenInvitationCode:output_type -> OpenIMChat.admin.GenInvitationCodeResp - 39, // 107: OpenIMChat.admin.admin.FindInvitationCode:output_type -> OpenIMChat.admin.FindInvitationCodeResp - 41, // 108: OpenIMChat.admin.admin.UseInvitationCode:output_type -> OpenIMChat.admin.UseInvitationCodeResp - 43, // 109: OpenIMChat.admin.admin.DelInvitationCode:output_type -> OpenIMChat.admin.DelInvitationCodeResp - 46, // 110: OpenIMChat.admin.admin.SearchInvitationCode:output_type -> OpenIMChat.admin.SearchInvitationCodeResp - 49, // 111: OpenIMChat.admin.admin.SearchUserIPLimitLogin:output_type -> OpenIMChat.admin.SearchUserIPLimitLoginResp - 52, // 112: OpenIMChat.admin.admin.AddUserIPLimitLogin:output_type -> OpenIMChat.admin.AddUserIPLimitLoginResp - 54, // 113: OpenIMChat.admin.admin.DelUserIPLimitLogin:output_type -> OpenIMChat.admin.DelUserIPLimitLoginResp - 58, // 114: OpenIMChat.admin.admin.SearchIPForbidden:output_type -> OpenIMChat.admin.SearchIPForbiddenResp - 60, // 115: OpenIMChat.admin.admin.AddIPForbidden:output_type -> OpenIMChat.admin.AddIPForbiddenResp - 62, // 116: OpenIMChat.admin.admin.DelIPForbidden:output_type -> OpenIMChat.admin.DelIPForbiddenResp - 68, // 117: OpenIMChat.admin.admin.CancellationUser:output_type -> OpenIMChat.admin.CancellationUserResp - 70, // 118: OpenIMChat.admin.admin.BlockUser:output_type -> OpenIMChat.admin.BlockUserResp - 72, // 119: OpenIMChat.admin.admin.UnblockUser:output_type -> OpenIMChat.admin.UnblockUserResp - 75, // 120: OpenIMChat.admin.admin.SearchBlockUser:output_type -> OpenIMChat.admin.SearchBlockUserResp - 78, // 121: OpenIMChat.admin.admin.FindUserBlockInfo:output_type -> OpenIMChat.admin.FindUserBlockInfoResp - 64, // 122: OpenIMChat.admin.admin.CheckRegisterForbidden:output_type -> OpenIMChat.admin.CheckRegisterForbiddenResp - 66, // 123: OpenIMChat.admin.admin.CheckLoginForbidden:output_type -> OpenIMChat.admin.CheckLoginForbiddenResp - 80, // 124: OpenIMChat.admin.admin.CreateToken:output_type -> OpenIMChat.admin.CreateTokenResp - 82, // 125: OpenIMChat.admin.admin.ParseToken:output_type -> OpenIMChat.admin.ParseTokenResp - 84, // 126: OpenIMChat.admin.admin.AddApplet:output_type -> OpenIMChat.admin.AddAppletResp - 86, // 127: OpenIMChat.admin.admin.DelApplet:output_type -> OpenIMChat.admin.DelAppletResp - 88, // 128: OpenIMChat.admin.admin.UpdateApplet:output_type -> OpenIMChat.admin.UpdateAppletResp - 90, // 129: OpenIMChat.admin.admin.FindApplet:output_type -> OpenIMChat.admin.FindAppletResp - 92, // 130: OpenIMChat.admin.admin.SearchApplet:output_type -> OpenIMChat.admin.SearchAppletResp - 98, // 131: OpenIMChat.admin.admin.GetClientConfig:output_type -> OpenIMChat.admin.GetClientConfigResp - 94, // 132: OpenIMChat.admin.admin.SetClientConfig:output_type -> OpenIMChat.admin.SetClientConfigResp - 96, // 133: OpenIMChat.admin.admin.DelClientConfig:output_type -> OpenIMChat.admin.DelClientConfigResp - 100, // 134: OpenIMChat.admin.admin.GetUserToken:output_type -> OpenIMChat.admin.GetUserTokenResp + 104, // 0: openim.admin.AdminUpdateInfoReq.account:type_name -> openim.protobuf.StringValue + 104, // 1: openim.admin.AdminUpdateInfoReq.password:type_name -> openim.protobuf.StringValue + 104, // 2: openim.admin.AdminUpdateInfoReq.faceURL:type_name -> openim.protobuf.StringValue + 104, // 3: openim.admin.AdminUpdateInfoReq.nickname:type_name -> openim.protobuf.StringValue + 105, // 4: openim.admin.AdminUpdateInfoReq.level:type_name -> openim.protobuf.Int32Value + 106, // 5: openim.admin.SearchAdminAccountReq.pagination:type_name -> openim.sdkws.RequestPagination + 15, // 6: openim.admin.SearchAdminAccountResp.adminAccounts:type_name -> openim.admin.GetAdminInfoResp + 106, // 7: openim.admin.SearchDefaultFriendReq.pagination:type_name -> openim.sdkws.RequestPagination + 107, // 8: openim.admin.DefaultFriendAttribute.user:type_name -> openim.chat.common.UserPublicInfo + 23, // 9: openim.admin.SearchDefaultFriendResp.users:type_name -> openim.admin.DefaultFriendAttribute + 106, // 10: openim.admin.SearchDefaultGroupReq.pagination:type_name -> openim.sdkws.RequestPagination + 108, // 11: openim.admin.GroupAttribute.group:type_name -> openim.sdkws.GroupInfo + 44, // 12: openim.admin.FindInvitationCodeResp.codes:type_name -> openim.admin.InvitationRegister + 107, // 13: openim.admin.InvitationRegister.usedUser:type_name -> openim.chat.common.UserPublicInfo + 106, // 14: openim.admin.SearchInvitationCodeReq.pagination:type_name -> openim.sdkws.RequestPagination + 44, // 15: openim.admin.SearchInvitationCodeResp.list:type_name -> openim.admin.InvitationRegister + 106, // 16: openim.admin.SearchUserIPLimitLoginReq.pagination:type_name -> openim.sdkws.RequestPagination + 107, // 17: openim.admin.LimitUserLoginIP.user:type_name -> openim.chat.common.UserPublicInfo + 48, // 18: openim.admin.SearchUserIPLimitLoginResp.limits:type_name -> openim.admin.LimitUserLoginIP + 50, // 19: openim.admin.AddUserIPLimitLoginReq.limits:type_name -> openim.admin.UserIPLimitLogin + 50, // 20: openim.admin.DelUserIPLimitLoginReq.limits:type_name -> openim.admin.UserIPLimitLogin + 106, // 21: openim.admin.SearchIPForbiddenReq.pagination:type_name -> openim.sdkws.RequestPagination + 55, // 22: openim.admin.SearchIPForbiddenResp.forbiddens:type_name -> openim.admin.IPForbidden + 56, // 23: openim.admin.AddIPForbiddenReq.forbiddens:type_name -> openim.admin.IPForbiddenAdd + 106, // 24: openim.admin.SearchBlockUserReq.pagination:type_name -> openim.sdkws.RequestPagination + 74, // 25: openim.admin.SearchBlockUserResp.users:type_name -> openim.admin.BlockUserInfo + 77, // 26: openim.admin.FindUserBlockInfoResp.blocks:type_name -> openim.admin.BlockInfo + 104, // 27: openim.admin.UpdateAppletReq.name:type_name -> openim.protobuf.StringValue + 104, // 28: openim.admin.UpdateAppletReq.appID:type_name -> openim.protobuf.StringValue + 104, // 29: openim.admin.UpdateAppletReq.icon:type_name -> openim.protobuf.StringValue + 104, // 30: openim.admin.UpdateAppletReq.url:type_name -> openim.protobuf.StringValue + 104, // 31: openim.admin.UpdateAppletReq.md5:type_name -> openim.protobuf.StringValue + 109, // 32: openim.admin.UpdateAppletReq.size:type_name -> openim.protobuf.Int64Value + 104, // 33: openim.admin.UpdateAppletReq.version:type_name -> openim.protobuf.StringValue + 110, // 34: openim.admin.UpdateAppletReq.priority:type_name -> openim.protobuf.UInt32Value + 110, // 35: openim.admin.UpdateAppletReq.status:type_name -> openim.protobuf.UInt32Value + 109, // 36: openim.admin.UpdateAppletReq.createTime:type_name -> openim.protobuf.Int64Value + 111, // 37: openim.admin.FindAppletResp.applets:type_name -> openim.chat.common.AppletInfo + 106, // 38: openim.admin.SearchAppletReq.pagination:type_name -> openim.sdkws.RequestPagination + 111, // 39: openim.admin.SearchAppletResp.applets:type_name -> openim.chat.common.AppletInfo + 101, // 40: openim.admin.SetClientConfigReq.config:type_name -> openim.admin.SetClientConfigReq.ConfigEntry + 102, // 41: openim.admin.GetClientConfigResp.config:type_name -> openim.admin.GetClientConfigResp.ConfigEntry + 103, // 42: openim.admin.GetUserTokenResp.tokensMap:type_name -> openim.admin.GetUserTokenResp.TokensMapEntry + 0, // 43: openim.admin.admin.Login:input_type -> openim.admin.LoginReq + 6, // 44: openim.admin.admin.ChangePassword:input_type -> openim.admin.ChangePasswordReq + 4, // 45: openim.admin.admin.AdminUpdateInfo:input_type -> openim.admin.AdminUpdateInfoReq + 8, // 46: openim.admin.admin.GetAdminInfo:input_type -> openim.admin.GetAdminInfoReq + 2, // 47: openim.admin.admin.AddAdminAccount:input_type -> openim.admin.AddAdminAccountReq + 9, // 48: openim.admin.admin.ChangeAdminPassword:input_type -> openim.admin.ChangeAdminPasswordReq + 11, // 49: openim.admin.admin.DelAdminAccount:input_type -> openim.admin.DelAdminAccountReq + 13, // 50: openim.admin.admin.SearchAdminAccount:input_type -> openim.admin.SearchAdminAccountReq + 16, // 51: openim.admin.admin.AddDefaultFriend:input_type -> openim.admin.AddDefaultFriendReq + 18, // 52: openim.admin.admin.DelDefaultFriend:input_type -> openim.admin.DelDefaultFriendReq + 20, // 53: openim.admin.admin.FindDefaultFriend:input_type -> openim.admin.FindDefaultFriendReq + 22, // 54: openim.admin.admin.SearchDefaultFriend:input_type -> openim.admin.SearchDefaultFriendReq + 25, // 55: openim.admin.admin.AddDefaultGroup:input_type -> openim.admin.AddDefaultGroupReq + 27, // 56: openim.admin.admin.DelDefaultGroup:input_type -> openim.admin.DelDefaultGroupReq + 29, // 57: openim.admin.admin.FindDefaultGroup:input_type -> openim.admin.FindDefaultGroupReq + 31, // 58: openim.admin.admin.SearchDefaultGroup:input_type -> openim.admin.SearchDefaultGroupReq + 34, // 59: openim.admin.admin.AddInvitationCode:input_type -> openim.admin.AddInvitationCodeReq + 36, // 60: openim.admin.admin.GenInvitationCode:input_type -> openim.admin.GenInvitationCodeReq + 38, // 61: openim.admin.admin.FindInvitationCode:input_type -> openim.admin.FindInvitationCodeReq + 40, // 62: openim.admin.admin.UseInvitationCode:input_type -> openim.admin.UseInvitationCodeReq + 42, // 63: openim.admin.admin.DelInvitationCode:input_type -> openim.admin.DelInvitationCodeReq + 45, // 64: openim.admin.admin.SearchInvitationCode:input_type -> openim.admin.SearchInvitationCodeReq + 47, // 65: openim.admin.admin.SearchUserIPLimitLogin:input_type -> openim.admin.SearchUserIPLimitLoginReq + 51, // 66: openim.admin.admin.AddUserIPLimitLogin:input_type -> openim.admin.AddUserIPLimitLoginReq + 53, // 67: openim.admin.admin.DelUserIPLimitLogin:input_type -> openim.admin.DelUserIPLimitLoginReq + 57, // 68: openim.admin.admin.SearchIPForbidden:input_type -> openim.admin.SearchIPForbiddenReq + 59, // 69: openim.admin.admin.AddIPForbidden:input_type -> openim.admin.AddIPForbiddenReq + 61, // 70: openim.admin.admin.DelIPForbidden:input_type -> openim.admin.DelIPForbiddenReq + 67, // 71: openim.admin.admin.CancellationUser:input_type -> openim.admin.CancellationUserReq + 69, // 72: openim.admin.admin.BlockUser:input_type -> openim.admin.BlockUserReq + 71, // 73: openim.admin.admin.UnblockUser:input_type -> openim.admin.UnblockUserReq + 73, // 74: openim.admin.admin.SearchBlockUser:input_type -> openim.admin.SearchBlockUserReq + 76, // 75: openim.admin.admin.FindUserBlockInfo:input_type -> openim.admin.FindUserBlockInfoReq + 63, // 76: openim.admin.admin.CheckRegisterForbidden:input_type -> openim.admin.CheckRegisterForbiddenReq + 65, // 77: openim.admin.admin.CheckLoginForbidden:input_type -> openim.admin.CheckLoginForbiddenReq + 79, // 78: openim.admin.admin.CreateToken:input_type -> openim.admin.CreateTokenReq + 81, // 79: openim.admin.admin.ParseToken:input_type -> openim.admin.ParseTokenReq + 83, // 80: openim.admin.admin.AddApplet:input_type -> openim.admin.AddAppletReq + 85, // 81: openim.admin.admin.DelApplet:input_type -> openim.admin.DelAppletReq + 87, // 82: openim.admin.admin.UpdateApplet:input_type -> openim.admin.UpdateAppletReq + 89, // 83: openim.admin.admin.FindApplet:input_type -> openim.admin.FindAppletReq + 91, // 84: openim.admin.admin.SearchApplet:input_type -> openim.admin.SearchAppletReq + 97, // 85: openim.admin.admin.GetClientConfig:input_type -> openim.admin.GetClientConfigReq + 93, // 86: openim.admin.admin.SetClientConfig:input_type -> openim.admin.SetClientConfigReq + 95, // 87: openim.admin.admin.DelClientConfig:input_type -> openim.admin.DelClientConfigReq + 99, // 88: openim.admin.admin.GetUserToken:input_type -> openim.admin.GetUserTokenReq + 1, // 89: openim.admin.admin.Login:output_type -> openim.admin.LoginResp + 7, // 90: openim.admin.admin.ChangePassword:output_type -> openim.admin.ChangePasswordResp + 5, // 91: openim.admin.admin.AdminUpdateInfo:output_type -> openim.admin.AdminUpdateInfoResp + 15, // 92: openim.admin.admin.GetAdminInfo:output_type -> openim.admin.GetAdminInfoResp + 3, // 93: openim.admin.admin.AddAdminAccount:output_type -> openim.admin.AddAdminAccountResp + 10, // 94: openim.admin.admin.ChangeAdminPassword:output_type -> openim.admin.ChangeAdminPasswordResp + 12, // 95: openim.admin.admin.DelAdminAccount:output_type -> openim.admin.DelAdminAccountResp + 14, // 96: openim.admin.admin.SearchAdminAccount:output_type -> openim.admin.SearchAdminAccountResp + 17, // 97: openim.admin.admin.AddDefaultFriend:output_type -> openim.admin.AddDefaultFriendResp + 19, // 98: openim.admin.admin.DelDefaultFriend:output_type -> openim.admin.DelDefaultFriendResp + 21, // 99: openim.admin.admin.FindDefaultFriend:output_type -> openim.admin.FindDefaultFriendResp + 24, // 100: openim.admin.admin.SearchDefaultFriend:output_type -> openim.admin.SearchDefaultFriendResp + 26, // 101: openim.admin.admin.AddDefaultGroup:output_type -> openim.admin.AddDefaultGroupResp + 28, // 102: openim.admin.admin.DelDefaultGroup:output_type -> openim.admin.DelDefaultGroupResp + 30, // 103: openim.admin.admin.FindDefaultGroup:output_type -> openim.admin.FindDefaultGroupResp + 33, // 104: openim.admin.admin.SearchDefaultGroup:output_type -> openim.admin.SearchDefaultGroupResp + 35, // 105: openim.admin.admin.AddInvitationCode:output_type -> openim.admin.AddInvitationCodeResp + 37, // 106: openim.admin.admin.GenInvitationCode:output_type -> openim.admin.GenInvitationCodeResp + 39, // 107: openim.admin.admin.FindInvitationCode:output_type -> openim.admin.FindInvitationCodeResp + 41, // 108: openim.admin.admin.UseInvitationCode:output_type -> openim.admin.UseInvitationCodeResp + 43, // 109: openim.admin.admin.DelInvitationCode:output_type -> openim.admin.DelInvitationCodeResp + 46, // 110: openim.admin.admin.SearchInvitationCode:output_type -> openim.admin.SearchInvitationCodeResp + 49, // 111: openim.admin.admin.SearchUserIPLimitLogin:output_type -> openim.admin.SearchUserIPLimitLoginResp + 52, // 112: openim.admin.admin.AddUserIPLimitLogin:output_type -> openim.admin.AddUserIPLimitLoginResp + 54, // 113: openim.admin.admin.DelUserIPLimitLogin:output_type -> openim.admin.DelUserIPLimitLoginResp + 58, // 114: openim.admin.admin.SearchIPForbidden:output_type -> openim.admin.SearchIPForbiddenResp + 60, // 115: openim.admin.admin.AddIPForbidden:output_type -> openim.admin.AddIPForbiddenResp + 62, // 116: openim.admin.admin.DelIPForbidden:output_type -> openim.admin.DelIPForbiddenResp + 68, // 117: openim.admin.admin.CancellationUser:output_type -> openim.admin.CancellationUserResp + 70, // 118: openim.admin.admin.BlockUser:output_type -> openim.admin.BlockUserResp + 72, // 119: openim.admin.admin.UnblockUser:output_type -> openim.admin.UnblockUserResp + 75, // 120: openim.admin.admin.SearchBlockUser:output_type -> openim.admin.SearchBlockUserResp + 78, // 121: openim.admin.admin.FindUserBlockInfo:output_type -> openim.admin.FindUserBlockInfoResp + 64, // 122: openim.admin.admin.CheckRegisterForbidden:output_type -> openim.admin.CheckRegisterForbiddenResp + 66, // 123: openim.admin.admin.CheckLoginForbidden:output_type -> openim.admin.CheckLoginForbiddenResp + 80, // 124: openim.admin.admin.CreateToken:output_type -> openim.admin.CreateTokenResp + 82, // 125: openim.admin.admin.ParseToken:output_type -> openim.admin.ParseTokenResp + 84, // 126: openim.admin.admin.AddApplet:output_type -> openim.admin.AddAppletResp + 86, // 127: openim.admin.admin.DelApplet:output_type -> openim.admin.DelAppletResp + 88, // 128: openim.admin.admin.UpdateApplet:output_type -> openim.admin.UpdateAppletResp + 90, // 129: openim.admin.admin.FindApplet:output_type -> openim.admin.FindAppletResp + 92, // 130: openim.admin.admin.SearchApplet:output_type -> openim.admin.SearchAppletResp + 98, // 131: openim.admin.admin.GetClientConfig:output_type -> openim.admin.GetClientConfigResp + 94, // 132: openim.admin.admin.SetClientConfig:output_type -> openim.admin.SetClientConfigResp + 96, // 133: openim.admin.admin.DelClientConfig:output_type -> openim.admin.DelClientConfigResp + 100, // 134: openim.admin.admin.GetUserToken:output_type -> openim.admin.GetUserTokenResp 89, // [89:135] is the sub-list for method output_type 43, // [43:89] is the sub-list for method input_type 43, // [43:43] is the sub-list for extension type_name @@ -7721,7 +7686,7 @@ func NewAdminClient(cc grpc.ClientConnInterface) AdminClient { func (c *adminClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) { out := new(LoginResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/Login", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/Login", in, out, opts...) if err != nil { return nil, err } @@ -7730,7 +7695,7 @@ func (c *adminClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.Call func (c *adminClient) ChangePassword(ctx context.Context, in *ChangePasswordReq, opts ...grpc.CallOption) (*ChangePasswordResp, error) { out := new(ChangePasswordResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/ChangePassword", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/ChangePassword", in, out, opts...) if err != nil { return nil, err } @@ -7739,7 +7704,7 @@ func (c *adminClient) ChangePassword(ctx context.Context, in *ChangePasswordReq, func (c *adminClient) AdminUpdateInfo(ctx context.Context, in *AdminUpdateInfoReq, opts ...grpc.CallOption) (*AdminUpdateInfoResp, error) { out := new(AdminUpdateInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AdminUpdateInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AdminUpdateInfo", in, out, opts...) if err != nil { return nil, err } @@ -7748,7 +7713,7 @@ func (c *adminClient) AdminUpdateInfo(ctx context.Context, in *AdminUpdateInfoRe func (c *adminClient) GetAdminInfo(ctx context.Context, in *GetAdminInfoReq, opts ...grpc.CallOption) (*GetAdminInfoResp, error) { out := new(GetAdminInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/GetAdminInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/GetAdminInfo", in, out, opts...) if err != nil { return nil, err } @@ -7757,7 +7722,7 @@ func (c *adminClient) GetAdminInfo(ctx context.Context, in *GetAdminInfoReq, opt func (c *adminClient) AddAdminAccount(ctx context.Context, in *AddAdminAccountReq, opts ...grpc.CallOption) (*AddAdminAccountResp, error) { out := new(AddAdminAccountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddAdminAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddAdminAccount", in, out, opts...) if err != nil { return nil, err } @@ -7766,7 +7731,7 @@ func (c *adminClient) AddAdminAccount(ctx context.Context, in *AddAdminAccountRe func (c *adminClient) ChangeAdminPassword(ctx context.Context, in *ChangeAdminPasswordReq, opts ...grpc.CallOption) (*ChangeAdminPasswordResp, error) { out := new(ChangeAdminPasswordResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/ChangeAdminPassword", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/ChangeAdminPassword", in, out, opts...) if err != nil { return nil, err } @@ -7775,7 +7740,7 @@ func (c *adminClient) ChangeAdminPassword(ctx context.Context, in *ChangeAdminPa func (c *adminClient) DelAdminAccount(ctx context.Context, in *DelAdminAccountReq, opts ...grpc.CallOption) (*DelAdminAccountResp, error) { out := new(DelAdminAccountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelAdminAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelAdminAccount", in, out, opts...) if err != nil { return nil, err } @@ -7784,7 +7749,7 @@ func (c *adminClient) DelAdminAccount(ctx context.Context, in *DelAdminAccountRe func (c *adminClient) SearchAdminAccount(ctx context.Context, in *SearchAdminAccountReq, opts ...grpc.CallOption) (*SearchAdminAccountResp, error) { out := new(SearchAdminAccountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchAdminAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchAdminAccount", in, out, opts...) if err != nil { return nil, err } @@ -7793,7 +7758,7 @@ func (c *adminClient) SearchAdminAccount(ctx context.Context, in *SearchAdminAcc func (c *adminClient) AddDefaultFriend(ctx context.Context, in *AddDefaultFriendReq, opts ...grpc.CallOption) (*AddDefaultFriendResp, error) { out := new(AddDefaultFriendResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddDefaultFriend", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddDefaultFriend", in, out, opts...) if err != nil { return nil, err } @@ -7802,7 +7767,7 @@ func (c *adminClient) AddDefaultFriend(ctx context.Context, in *AddDefaultFriend func (c *adminClient) DelDefaultFriend(ctx context.Context, in *DelDefaultFriendReq, opts ...grpc.CallOption) (*DelDefaultFriendResp, error) { out := new(DelDefaultFriendResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelDefaultFriend", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelDefaultFriend", in, out, opts...) if err != nil { return nil, err } @@ -7811,7 +7776,7 @@ func (c *adminClient) DelDefaultFriend(ctx context.Context, in *DelDefaultFriend func (c *adminClient) FindDefaultFriend(ctx context.Context, in *FindDefaultFriendReq, opts ...grpc.CallOption) (*FindDefaultFriendResp, error) { out := new(FindDefaultFriendResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/FindDefaultFriend", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/FindDefaultFriend", in, out, opts...) if err != nil { return nil, err } @@ -7820,7 +7785,7 @@ func (c *adminClient) FindDefaultFriend(ctx context.Context, in *FindDefaultFrie func (c *adminClient) SearchDefaultFriend(ctx context.Context, in *SearchDefaultFriendReq, opts ...grpc.CallOption) (*SearchDefaultFriendResp, error) { out := new(SearchDefaultFriendResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchDefaultFriend", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchDefaultFriend", in, out, opts...) if err != nil { return nil, err } @@ -7829,7 +7794,7 @@ func (c *adminClient) SearchDefaultFriend(ctx context.Context, in *SearchDefault func (c *adminClient) AddDefaultGroup(ctx context.Context, in *AddDefaultGroupReq, opts ...grpc.CallOption) (*AddDefaultGroupResp, error) { out := new(AddDefaultGroupResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddDefaultGroup", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddDefaultGroup", in, out, opts...) if err != nil { return nil, err } @@ -7838,7 +7803,7 @@ func (c *adminClient) AddDefaultGroup(ctx context.Context, in *AddDefaultGroupRe func (c *adminClient) DelDefaultGroup(ctx context.Context, in *DelDefaultGroupReq, opts ...grpc.CallOption) (*DelDefaultGroupResp, error) { out := new(DelDefaultGroupResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelDefaultGroup", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelDefaultGroup", in, out, opts...) if err != nil { return nil, err } @@ -7847,7 +7812,7 @@ func (c *adminClient) DelDefaultGroup(ctx context.Context, in *DelDefaultGroupRe func (c *adminClient) FindDefaultGroup(ctx context.Context, in *FindDefaultGroupReq, opts ...grpc.CallOption) (*FindDefaultGroupResp, error) { out := new(FindDefaultGroupResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/FindDefaultGroup", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/FindDefaultGroup", in, out, opts...) if err != nil { return nil, err } @@ -7856,7 +7821,7 @@ func (c *adminClient) FindDefaultGroup(ctx context.Context, in *FindDefaultGroup func (c *adminClient) SearchDefaultGroup(ctx context.Context, in *SearchDefaultGroupReq, opts ...grpc.CallOption) (*SearchDefaultGroupResp, error) { out := new(SearchDefaultGroupResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchDefaultGroup", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchDefaultGroup", in, out, opts...) if err != nil { return nil, err } @@ -7865,7 +7830,7 @@ func (c *adminClient) SearchDefaultGroup(ctx context.Context, in *SearchDefaultG func (c *adminClient) AddInvitationCode(ctx context.Context, in *AddInvitationCodeReq, opts ...grpc.CallOption) (*AddInvitationCodeResp, error) { out := new(AddInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7874,7 +7839,7 @@ func (c *adminClient) AddInvitationCode(ctx context.Context, in *AddInvitationCo func (c *adminClient) GenInvitationCode(ctx context.Context, in *GenInvitationCodeReq, opts ...grpc.CallOption) (*GenInvitationCodeResp, error) { out := new(GenInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/GenInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/GenInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7883,7 +7848,7 @@ func (c *adminClient) GenInvitationCode(ctx context.Context, in *GenInvitationCo func (c *adminClient) FindInvitationCode(ctx context.Context, in *FindInvitationCodeReq, opts ...grpc.CallOption) (*FindInvitationCodeResp, error) { out := new(FindInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/FindInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/FindInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7892,7 +7857,7 @@ func (c *adminClient) FindInvitationCode(ctx context.Context, in *FindInvitation func (c *adminClient) UseInvitationCode(ctx context.Context, in *UseInvitationCodeReq, opts ...grpc.CallOption) (*UseInvitationCodeResp, error) { out := new(UseInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/UseInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/UseInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7901,7 +7866,7 @@ func (c *adminClient) UseInvitationCode(ctx context.Context, in *UseInvitationCo func (c *adminClient) DelInvitationCode(ctx context.Context, in *DelInvitationCodeReq, opts ...grpc.CallOption) (*DelInvitationCodeResp, error) { out := new(DelInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7910,7 +7875,7 @@ func (c *adminClient) DelInvitationCode(ctx context.Context, in *DelInvitationCo func (c *adminClient) SearchInvitationCode(ctx context.Context, in *SearchInvitationCodeReq, opts ...grpc.CallOption) (*SearchInvitationCodeResp, error) { out := new(SearchInvitationCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchInvitationCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchInvitationCode", in, out, opts...) if err != nil { return nil, err } @@ -7919,7 +7884,7 @@ func (c *adminClient) SearchInvitationCode(ctx context.Context, in *SearchInvita func (c *adminClient) SearchUserIPLimitLogin(ctx context.Context, in *SearchUserIPLimitLoginReq, opts ...grpc.CallOption) (*SearchUserIPLimitLoginResp, error) { out := new(SearchUserIPLimitLoginResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchUserIPLimitLogin", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchUserIPLimitLogin", in, out, opts...) if err != nil { return nil, err } @@ -7928,7 +7893,7 @@ func (c *adminClient) SearchUserIPLimitLogin(ctx context.Context, in *SearchUser func (c *adminClient) AddUserIPLimitLogin(ctx context.Context, in *AddUserIPLimitLoginReq, opts ...grpc.CallOption) (*AddUserIPLimitLoginResp, error) { out := new(AddUserIPLimitLoginResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddUserIPLimitLogin", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddUserIPLimitLogin", in, out, opts...) if err != nil { return nil, err } @@ -7937,7 +7902,7 @@ func (c *adminClient) AddUserIPLimitLogin(ctx context.Context, in *AddUserIPLimi func (c *adminClient) DelUserIPLimitLogin(ctx context.Context, in *DelUserIPLimitLoginReq, opts ...grpc.CallOption) (*DelUserIPLimitLoginResp, error) { out := new(DelUserIPLimitLoginResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelUserIPLimitLogin", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelUserIPLimitLogin", in, out, opts...) if err != nil { return nil, err } @@ -7946,7 +7911,7 @@ func (c *adminClient) DelUserIPLimitLogin(ctx context.Context, in *DelUserIPLimi func (c *adminClient) SearchIPForbidden(ctx context.Context, in *SearchIPForbiddenReq, opts ...grpc.CallOption) (*SearchIPForbiddenResp, error) { out := new(SearchIPForbiddenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchIPForbidden", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchIPForbidden", in, out, opts...) if err != nil { return nil, err } @@ -7955,7 +7920,7 @@ func (c *adminClient) SearchIPForbidden(ctx context.Context, in *SearchIPForbidd func (c *adminClient) AddIPForbidden(ctx context.Context, in *AddIPForbiddenReq, opts ...grpc.CallOption) (*AddIPForbiddenResp, error) { out := new(AddIPForbiddenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddIPForbidden", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddIPForbidden", in, out, opts...) if err != nil { return nil, err } @@ -7964,7 +7929,7 @@ func (c *adminClient) AddIPForbidden(ctx context.Context, in *AddIPForbiddenReq, func (c *adminClient) DelIPForbidden(ctx context.Context, in *DelIPForbiddenReq, opts ...grpc.CallOption) (*DelIPForbiddenResp, error) { out := new(DelIPForbiddenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelIPForbidden", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelIPForbidden", in, out, opts...) if err != nil { return nil, err } @@ -7973,7 +7938,7 @@ func (c *adminClient) DelIPForbidden(ctx context.Context, in *DelIPForbiddenReq, func (c *adminClient) CancellationUser(ctx context.Context, in *CancellationUserReq, opts ...grpc.CallOption) (*CancellationUserResp, error) { out := new(CancellationUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/CancellationUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/CancellationUser", in, out, opts...) if err != nil { return nil, err } @@ -7982,7 +7947,7 @@ func (c *adminClient) CancellationUser(ctx context.Context, in *CancellationUser func (c *adminClient) BlockUser(ctx context.Context, in *BlockUserReq, opts ...grpc.CallOption) (*BlockUserResp, error) { out := new(BlockUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/BlockUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/BlockUser", in, out, opts...) if err != nil { return nil, err } @@ -7991,7 +7956,7 @@ func (c *adminClient) BlockUser(ctx context.Context, in *BlockUserReq, opts ...g func (c *adminClient) UnblockUser(ctx context.Context, in *UnblockUserReq, opts ...grpc.CallOption) (*UnblockUserResp, error) { out := new(UnblockUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/UnblockUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/UnblockUser", in, out, opts...) if err != nil { return nil, err } @@ -8000,7 +7965,7 @@ func (c *adminClient) UnblockUser(ctx context.Context, in *UnblockUserReq, opts func (c *adminClient) SearchBlockUser(ctx context.Context, in *SearchBlockUserReq, opts ...grpc.CallOption) (*SearchBlockUserResp, error) { out := new(SearchBlockUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchBlockUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchBlockUser", in, out, opts...) if err != nil { return nil, err } @@ -8009,7 +7974,7 @@ func (c *adminClient) SearchBlockUser(ctx context.Context, in *SearchBlockUserRe func (c *adminClient) FindUserBlockInfo(ctx context.Context, in *FindUserBlockInfoReq, opts ...grpc.CallOption) (*FindUserBlockInfoResp, error) { out := new(FindUserBlockInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/FindUserBlockInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/FindUserBlockInfo", in, out, opts...) if err != nil { return nil, err } @@ -8018,7 +7983,7 @@ func (c *adminClient) FindUserBlockInfo(ctx context.Context, in *FindUserBlockIn func (c *adminClient) CheckRegisterForbidden(ctx context.Context, in *CheckRegisterForbiddenReq, opts ...grpc.CallOption) (*CheckRegisterForbiddenResp, error) { out := new(CheckRegisterForbiddenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/CheckRegisterForbidden", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/CheckRegisterForbidden", in, out, opts...) if err != nil { return nil, err } @@ -8027,7 +7992,7 @@ func (c *adminClient) CheckRegisterForbidden(ctx context.Context, in *CheckRegis func (c *adminClient) CheckLoginForbidden(ctx context.Context, in *CheckLoginForbiddenReq, opts ...grpc.CallOption) (*CheckLoginForbiddenResp, error) { out := new(CheckLoginForbiddenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/CheckLoginForbidden", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/CheckLoginForbidden", in, out, opts...) if err != nil { return nil, err } @@ -8036,7 +8001,7 @@ func (c *adminClient) CheckLoginForbidden(ctx context.Context, in *CheckLoginFor func (c *adminClient) CreateToken(ctx context.Context, in *CreateTokenReq, opts ...grpc.CallOption) (*CreateTokenResp, error) { out := new(CreateTokenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/CreateToken", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/CreateToken", in, out, opts...) if err != nil { return nil, err } @@ -8045,7 +8010,7 @@ func (c *adminClient) CreateToken(ctx context.Context, in *CreateTokenReq, opts func (c *adminClient) ParseToken(ctx context.Context, in *ParseTokenReq, opts ...grpc.CallOption) (*ParseTokenResp, error) { out := new(ParseTokenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/ParseToken", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/ParseToken", in, out, opts...) if err != nil { return nil, err } @@ -8054,7 +8019,7 @@ func (c *adminClient) ParseToken(ctx context.Context, in *ParseTokenReq, opts .. func (c *adminClient) AddApplet(ctx context.Context, in *AddAppletReq, opts ...grpc.CallOption) (*AddAppletResp, error) { out := new(AddAppletResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/AddApplet", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddApplet", in, out, opts...) if err != nil { return nil, err } @@ -8063,7 +8028,7 @@ func (c *adminClient) AddApplet(ctx context.Context, in *AddAppletReq, opts ...g func (c *adminClient) DelApplet(ctx context.Context, in *DelAppletReq, opts ...grpc.CallOption) (*DelAppletResp, error) { out := new(DelAppletResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelApplet", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelApplet", in, out, opts...) if err != nil { return nil, err } @@ -8072,7 +8037,7 @@ func (c *adminClient) DelApplet(ctx context.Context, in *DelAppletReq, opts ...g func (c *adminClient) UpdateApplet(ctx context.Context, in *UpdateAppletReq, opts ...grpc.CallOption) (*UpdateAppletResp, error) { out := new(UpdateAppletResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/UpdateApplet", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/UpdateApplet", in, out, opts...) if err != nil { return nil, err } @@ -8081,7 +8046,7 @@ func (c *adminClient) UpdateApplet(ctx context.Context, in *UpdateAppletReq, opt func (c *adminClient) FindApplet(ctx context.Context, in *FindAppletReq, opts ...grpc.CallOption) (*FindAppletResp, error) { out := new(FindAppletResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/FindApplet", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/FindApplet", in, out, opts...) if err != nil { return nil, err } @@ -8090,7 +8055,7 @@ func (c *adminClient) FindApplet(ctx context.Context, in *FindAppletReq, opts .. func (c *adminClient) SearchApplet(ctx context.Context, in *SearchAppletReq, opts ...grpc.CallOption) (*SearchAppletResp, error) { out := new(SearchAppletResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SearchApplet", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SearchApplet", in, out, opts...) if err != nil { return nil, err } @@ -8099,7 +8064,7 @@ func (c *adminClient) SearchApplet(ctx context.Context, in *SearchAppletReq, opt func (c *adminClient) GetClientConfig(ctx context.Context, in *GetClientConfigReq, opts ...grpc.CallOption) (*GetClientConfigResp, error) { out := new(GetClientConfigResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/GetClientConfig", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/GetClientConfig", in, out, opts...) if err != nil { return nil, err } @@ -8108,7 +8073,7 @@ func (c *adminClient) GetClientConfig(ctx context.Context, in *GetClientConfigRe func (c *adminClient) SetClientConfig(ctx context.Context, in *SetClientConfigReq, opts ...grpc.CallOption) (*SetClientConfigResp, error) { out := new(SetClientConfigResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/SetClientConfig", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/SetClientConfig", in, out, opts...) if err != nil { return nil, err } @@ -8117,7 +8082,7 @@ func (c *adminClient) SetClientConfig(ctx context.Context, in *SetClientConfigRe func (c *adminClient) DelClientConfig(ctx context.Context, in *DelClientConfigReq, opts ...grpc.CallOption) (*DelClientConfigResp, error) { out := new(DelClientConfigResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/DelClientConfig", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DelClientConfig", in, out, opts...) if err != nil { return nil, err } @@ -8126,7 +8091,7 @@ func (c *adminClient) DelClientConfig(ctx context.Context, in *DelClientConfigRe func (c *adminClient) GetUserToken(ctx context.Context, in *GetUserTokenReq, opts ...grpc.CallOption) (*GetUserTokenResp, error) { out := new(GetUserTokenResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.admin.admin/GetUserToken", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.admin.admin/GetUserToken", in, out, opts...) if err != nil { return nil, err } @@ -8351,7 +8316,7 @@ func _Admin_Login_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/Login", + FullMethod: "/openim.admin.admin/Login", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).Login(ctx, req.(*LoginReq)) @@ -8369,7 +8334,7 @@ func _Admin_ChangePassword_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/ChangePassword", + FullMethod: "/openim.admin.admin/ChangePassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).ChangePassword(ctx, req.(*ChangePasswordReq)) @@ -8387,7 +8352,7 @@ func _Admin_AdminUpdateInfo_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AdminUpdateInfo", + FullMethod: "/openim.admin.admin/AdminUpdateInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AdminUpdateInfo(ctx, req.(*AdminUpdateInfoReq)) @@ -8405,7 +8370,7 @@ func _Admin_GetAdminInfo_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/GetAdminInfo", + FullMethod: "/openim.admin.admin/GetAdminInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).GetAdminInfo(ctx, req.(*GetAdminInfoReq)) @@ -8423,7 +8388,7 @@ func _Admin_AddAdminAccount_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddAdminAccount", + FullMethod: "/openim.admin.admin/AddAdminAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddAdminAccount(ctx, req.(*AddAdminAccountReq)) @@ -8441,7 +8406,7 @@ func _Admin_ChangeAdminPassword_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/ChangeAdminPassword", + FullMethod: "/openim.admin.admin/ChangeAdminPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).ChangeAdminPassword(ctx, req.(*ChangeAdminPasswordReq)) @@ -8459,7 +8424,7 @@ func _Admin_DelAdminAccount_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelAdminAccount", + FullMethod: "/openim.admin.admin/DelAdminAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelAdminAccount(ctx, req.(*DelAdminAccountReq)) @@ -8477,7 +8442,7 @@ func _Admin_SearchAdminAccount_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchAdminAccount", + FullMethod: "/openim.admin.admin/SearchAdminAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchAdminAccount(ctx, req.(*SearchAdminAccountReq)) @@ -8495,7 +8460,7 @@ func _Admin_AddDefaultFriend_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddDefaultFriend", + FullMethod: "/openim.admin.admin/AddDefaultFriend", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddDefaultFriend(ctx, req.(*AddDefaultFriendReq)) @@ -8513,7 +8478,7 @@ func _Admin_DelDefaultFriend_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelDefaultFriend", + FullMethod: "/openim.admin.admin/DelDefaultFriend", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelDefaultFriend(ctx, req.(*DelDefaultFriendReq)) @@ -8531,7 +8496,7 @@ func _Admin_FindDefaultFriend_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/FindDefaultFriend", + FullMethod: "/openim.admin.admin/FindDefaultFriend", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).FindDefaultFriend(ctx, req.(*FindDefaultFriendReq)) @@ -8549,7 +8514,7 @@ func _Admin_SearchDefaultFriend_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchDefaultFriend", + FullMethod: "/openim.admin.admin/SearchDefaultFriend", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchDefaultFriend(ctx, req.(*SearchDefaultFriendReq)) @@ -8567,7 +8532,7 @@ func _Admin_AddDefaultGroup_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddDefaultGroup", + FullMethod: "/openim.admin.admin/AddDefaultGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddDefaultGroup(ctx, req.(*AddDefaultGroupReq)) @@ -8585,7 +8550,7 @@ func _Admin_DelDefaultGroup_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelDefaultGroup", + FullMethod: "/openim.admin.admin/DelDefaultGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelDefaultGroup(ctx, req.(*DelDefaultGroupReq)) @@ -8603,7 +8568,7 @@ func _Admin_FindDefaultGroup_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/FindDefaultGroup", + FullMethod: "/openim.admin.admin/FindDefaultGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).FindDefaultGroup(ctx, req.(*FindDefaultGroupReq)) @@ -8621,7 +8586,7 @@ func _Admin_SearchDefaultGroup_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchDefaultGroup", + FullMethod: "/openim.admin.admin/SearchDefaultGroup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchDefaultGroup(ctx, req.(*SearchDefaultGroupReq)) @@ -8639,7 +8604,7 @@ func _Admin_AddInvitationCode_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddInvitationCode", + FullMethod: "/openim.admin.admin/AddInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddInvitationCode(ctx, req.(*AddInvitationCodeReq)) @@ -8657,7 +8622,7 @@ func _Admin_GenInvitationCode_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/GenInvitationCode", + FullMethod: "/openim.admin.admin/GenInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).GenInvitationCode(ctx, req.(*GenInvitationCodeReq)) @@ -8675,7 +8640,7 @@ func _Admin_FindInvitationCode_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/FindInvitationCode", + FullMethod: "/openim.admin.admin/FindInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).FindInvitationCode(ctx, req.(*FindInvitationCodeReq)) @@ -8693,7 +8658,7 @@ func _Admin_UseInvitationCode_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/UseInvitationCode", + FullMethod: "/openim.admin.admin/UseInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).UseInvitationCode(ctx, req.(*UseInvitationCodeReq)) @@ -8711,7 +8676,7 @@ func _Admin_DelInvitationCode_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelInvitationCode", + FullMethod: "/openim.admin.admin/DelInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelInvitationCode(ctx, req.(*DelInvitationCodeReq)) @@ -8729,7 +8694,7 @@ func _Admin_SearchInvitationCode_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchInvitationCode", + FullMethod: "/openim.admin.admin/SearchInvitationCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchInvitationCode(ctx, req.(*SearchInvitationCodeReq)) @@ -8747,7 +8712,7 @@ func _Admin_SearchUserIPLimitLogin_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchUserIPLimitLogin", + FullMethod: "/openim.admin.admin/SearchUserIPLimitLogin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchUserIPLimitLogin(ctx, req.(*SearchUserIPLimitLoginReq)) @@ -8765,7 +8730,7 @@ func _Admin_AddUserIPLimitLogin_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddUserIPLimitLogin", + FullMethod: "/openim.admin.admin/AddUserIPLimitLogin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddUserIPLimitLogin(ctx, req.(*AddUserIPLimitLoginReq)) @@ -8783,7 +8748,7 @@ func _Admin_DelUserIPLimitLogin_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelUserIPLimitLogin", + FullMethod: "/openim.admin.admin/DelUserIPLimitLogin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelUserIPLimitLogin(ctx, req.(*DelUserIPLimitLoginReq)) @@ -8801,7 +8766,7 @@ func _Admin_SearchIPForbidden_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchIPForbidden", + FullMethod: "/openim.admin.admin/SearchIPForbidden", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchIPForbidden(ctx, req.(*SearchIPForbiddenReq)) @@ -8819,7 +8784,7 @@ func _Admin_AddIPForbidden_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddIPForbidden", + FullMethod: "/openim.admin.admin/AddIPForbidden", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddIPForbidden(ctx, req.(*AddIPForbiddenReq)) @@ -8837,7 +8802,7 @@ func _Admin_DelIPForbidden_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelIPForbidden", + FullMethod: "/openim.admin.admin/DelIPForbidden", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelIPForbidden(ctx, req.(*DelIPForbiddenReq)) @@ -8855,7 +8820,7 @@ func _Admin_CancellationUser_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/CancellationUser", + FullMethod: "/openim.admin.admin/CancellationUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).CancellationUser(ctx, req.(*CancellationUserReq)) @@ -8873,7 +8838,7 @@ func _Admin_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/BlockUser", + FullMethod: "/openim.admin.admin/BlockUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).BlockUser(ctx, req.(*BlockUserReq)) @@ -8891,7 +8856,7 @@ func _Admin_UnblockUser_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/UnblockUser", + FullMethod: "/openim.admin.admin/UnblockUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).UnblockUser(ctx, req.(*UnblockUserReq)) @@ -8909,7 +8874,7 @@ func _Admin_SearchBlockUser_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchBlockUser", + FullMethod: "/openim.admin.admin/SearchBlockUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchBlockUser(ctx, req.(*SearchBlockUserReq)) @@ -8927,7 +8892,7 @@ func _Admin_FindUserBlockInfo_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/FindUserBlockInfo", + FullMethod: "/openim.admin.admin/FindUserBlockInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).FindUserBlockInfo(ctx, req.(*FindUserBlockInfoReq)) @@ -8945,7 +8910,7 @@ func _Admin_CheckRegisterForbidden_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/CheckRegisterForbidden", + FullMethod: "/openim.admin.admin/CheckRegisterForbidden", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).CheckRegisterForbidden(ctx, req.(*CheckRegisterForbiddenReq)) @@ -8963,7 +8928,7 @@ func _Admin_CheckLoginForbidden_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/CheckLoginForbidden", + FullMethod: "/openim.admin.admin/CheckLoginForbidden", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).CheckLoginForbidden(ctx, req.(*CheckLoginForbiddenReq)) @@ -8981,7 +8946,7 @@ func _Admin_CreateToken_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/CreateToken", + FullMethod: "/openim.admin.admin/CreateToken", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).CreateToken(ctx, req.(*CreateTokenReq)) @@ -8999,7 +8964,7 @@ func _Admin_ParseToken_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/ParseToken", + FullMethod: "/openim.admin.admin/ParseToken", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).ParseToken(ctx, req.(*ParseTokenReq)) @@ -9017,7 +8982,7 @@ func _Admin_AddApplet_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/AddApplet", + FullMethod: "/openim.admin.admin/AddApplet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).AddApplet(ctx, req.(*AddAppletReq)) @@ -9035,7 +9000,7 @@ func _Admin_DelApplet_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelApplet", + FullMethod: "/openim.admin.admin/DelApplet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelApplet(ctx, req.(*DelAppletReq)) @@ -9053,7 +9018,7 @@ func _Admin_UpdateApplet_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/UpdateApplet", + FullMethod: "/openim.admin.admin/UpdateApplet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).UpdateApplet(ctx, req.(*UpdateAppletReq)) @@ -9071,7 +9036,7 @@ func _Admin_FindApplet_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/FindApplet", + FullMethod: "/openim.admin.admin/FindApplet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).FindApplet(ctx, req.(*FindAppletReq)) @@ -9089,7 +9054,7 @@ func _Admin_SearchApplet_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SearchApplet", + FullMethod: "/openim.admin.admin/SearchApplet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SearchApplet(ctx, req.(*SearchAppletReq)) @@ -9107,7 +9072,7 @@ func _Admin_GetClientConfig_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/GetClientConfig", + FullMethod: "/openim.admin.admin/GetClientConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).GetClientConfig(ctx, req.(*GetClientConfigReq)) @@ -9125,7 +9090,7 @@ func _Admin_SetClientConfig_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/SetClientConfig", + FullMethod: "/openim.admin.admin/SetClientConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).SetClientConfig(ctx, req.(*SetClientConfigReq)) @@ -9143,7 +9108,7 @@ func _Admin_DelClientConfig_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/DelClientConfig", + FullMethod: "/openim.admin.admin/DelClientConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).DelClientConfig(ctx, req.(*DelClientConfigReq)) @@ -9161,7 +9126,7 @@ func _Admin_GetUserToken_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.admin.admin/GetUserToken", + FullMethod: "/openim.admin.admin/GetUserToken", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AdminServer).GetUserToken(ctx, req.(*GetUserTokenReq)) @@ -9170,7 +9135,7 @@ func _Admin_GetUserToken_Handler(srv interface{}, ctx context.Context, dec func( } var _Admin_serviceDesc = grpc.ServiceDesc{ - ServiceName: "OpenIMChat.admin.admin", + ServiceName: "openim.admin.admin", HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/pkg/proto/admin/admin.proto b/pkg/protocol/admin/admin.proto similarity index 87% rename from pkg/proto/admin/admin.proto rename to pkg/protocol/admin/admin.proto index ead783bd8..87c4cbfd5 100644 --- a/pkg/proto/admin/admin.proto +++ b/pkg/protocol/admin/admin.proto @@ -13,11 +13,11 @@ // limitations under the License. syntax = "proto3"; -package OpenIMChat.admin; -import "pub/wrapperspb.proto"; -import "pub/sdkws.proto"; +package openim.admin; +import "wrapperspb/wrapperspb.proto"; +import "sdkws/sdkws.proto"; import "common/common.proto"; -option go_package = "github.com/OpenIMSDK/chat/pkg/proto/admin"; +option go_package = "github.com/openimsdk/chat/pkg/protocol/admin"; //登录 message LoginReq { @@ -45,11 +45,11 @@ message AddAdminAccountResp{ } message AdminUpdateInfoReq { - OpenIMServer.protobuf.StringValue account = 1; - OpenIMServer.protobuf.StringValue password = 2; - OpenIMServer.protobuf.StringValue faceURL = 3; - OpenIMServer.protobuf.StringValue nickname = 4; - OpenIMServer.protobuf.Int32Value level = 6; + openim.protobuf.StringValue account = 1; + openim.protobuf.StringValue password = 2; + openim.protobuf.StringValue faceURL = 3; + openim.protobuf.StringValue nickname = 4; + openim.protobuf.Int32Value level = 6; } message AdminUpdateInfoResp { @@ -85,7 +85,7 @@ message DelAdminAccountResp{ } message SearchAdminAccountReq{ - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message SearchAdminAccountResp{ @@ -125,13 +125,13 @@ message FindDefaultFriendResp { message SearchDefaultFriendReq { string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message DefaultFriendAttribute { string userID = 1; int64 createTime = 2; - OpenIMChat.common.UserPublicInfo user = 3; + openim.chat.common.UserPublicInfo user = 3; } message SearchDefaultFriendResp { @@ -162,13 +162,13 @@ message FindDefaultGroupResp { message SearchDefaultGroupReq { string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message GroupAttribute { string groupID = 1; int64 createTime = 2; - OpenIMServer.sdkws.GroupInfo group = 3; + openim.sdkws.GroupInfo group = 3; } message SearchDefaultGroupResp { @@ -219,7 +219,7 @@ message InvitationRegister { string invitationCode = 1; int64 createTime = 2; string usedUserID = 3; - OpenIMChat.common.UserPublicInfo usedUser = 4; + openim.chat.common.UserPublicInfo usedUser = 4; } @@ -229,7 +229,7 @@ message SearchInvitationCodeReq { repeated string userIDs = 2; repeated string codes = 3; string keyword = 4; - OpenIMServer.sdkws.RequestPagination pagination = 5; + openim.sdkws.RequestPagination pagination = 5; } message SearchInvitationCodeResp { @@ -241,14 +241,14 @@ message SearchInvitationCodeResp { message SearchUserIPLimitLoginReq { string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message LimitUserLoginIP { string userID = 1; string ip = 2; int64 createTime = 3; - OpenIMChat.common.UserPublicInfo user = 4; + openim.chat.common.UserPublicInfo user = 4; } message SearchUserIPLimitLoginResp { @@ -294,7 +294,7 @@ message IPForbiddenAdd { message SearchIPForbiddenReq { string keyword = 1; int32 status = 2; - OpenIMServer.sdkws.RequestPagination pagination = 3; + openim.sdkws.RequestPagination pagination = 3; } message SearchIPForbiddenResp{ @@ -354,7 +354,7 @@ message UnblockUserResp {} message SearchBlockUserReq{ string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message BlockUserInfo { @@ -443,16 +443,16 @@ message DelAppletResp { message UpdateAppletReq { string id = 1; - OpenIMServer.protobuf.StringValue name = 2; - OpenIMServer.protobuf.StringValue appID = 3; - OpenIMServer.protobuf.StringValue icon = 4; - OpenIMServer.protobuf.StringValue url = 5; - OpenIMServer.protobuf.StringValue md5 = 6; - OpenIMServer.protobuf.Int64Value size = 7; - OpenIMServer.protobuf.StringValue version = 8; - OpenIMServer.protobuf.UInt32Value priority = 9; - OpenIMServer.protobuf.UInt32Value status = 10; - OpenIMServer.protobuf.Int64Value createTime = 11; + openim.protobuf.StringValue name = 2; + openim.protobuf.StringValue appID = 3; + openim.protobuf.StringValue icon = 4; + openim.protobuf.StringValue url = 5; + openim.protobuf.StringValue md5 = 6; + openim.protobuf.Int64Value size = 7; + openim.protobuf.StringValue version = 8; + openim.protobuf.UInt32Value priority = 9; + openim.protobuf.UInt32Value status = 10; + openim.protobuf.Int64Value createTime = 11; } message UpdateAppletResp { @@ -462,17 +462,17 @@ message FindAppletReq { } message FindAppletResp { - repeated OpenIMChat.common.AppletInfo applets = 1; + repeated openim.chat.common.AppletInfo applets = 1; } message SearchAppletReq { string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; } message SearchAppletResp { uint32 total = 1; - repeated OpenIMChat.common.AppletInfo applets = 2; + repeated openim.chat.common.AppletInfo applets = 2; } diff --git a/pkg/proto/admin/api.go b/pkg/protocol/admin/api.go similarity index 89% rename from pkg/proto/admin/api.go rename to pkg/protocol/admin/api.go index 1fab59504..d52c5cf51 100644 --- a/pkg/proto/admin/api.go +++ b/pkg/protocol/admin/api.go @@ -14,8 +14,8 @@ package admin -import "github.com/OpenIMSDK/tools/utils" +import "github.com/openimsdk/tools/utils/datautil" func (x *GetClientConfigResp) ApiFormat() { - utils.InitMap(&x.Config) + datautil.InitMap(&x.Config) } diff --git a/pkg/proto/chat/chat.go b/pkg/protocol/chat/chat.go similarity index 60% rename from pkg/proto/chat/chat.go rename to pkg/protocol/chat/chat.go index 8d7e87466..12b76c870 100644 --- a/pkg/proto/chat/chat.go +++ b/pkg/protocol/chat/chat.go @@ -18,16 +18,14 @@ import ( "regexp" "strconv" - "github.com/OpenIMSDK/tools/utils" - - "github.com/OpenIMSDK/chat/pkg/common/constant" - constant2 "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" + "github.com/openimsdk/chat/pkg/common/constant" + pconstant "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" ) func (x *UpdateUserInfoReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } if x.Email != nil && x.Email.Value != "" { if err := EmailCheck(x.Email.Value); err != nil { @@ -39,43 +37,43 @@ func (x *UpdateUserInfoReq) Check() error { func (x *FindUserPublicInfoReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *SearchUserPublicInfoReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *FindUserFullInfoReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *SendVerifyCodeReq) Check() error { if x.UsedFor < constant.VerificationCodeForRegister || x.UsedFor > constant.VerificationCodeForLogin { - return errs.ErrArgs.Wrap("usedFor flied is empty") + return errs.ErrArgs.WrapMsg("usedFor flied is empty") } if x.Email == "" { if x.AreaCode == "" { - return errs.ErrArgs.Wrap("AreaCode is empty") + return errs.ErrArgs.WrapMsg("AreaCode is empty") } else if err := AreaCodeCheck(x.AreaCode); err != nil { return err } if x.PhoneNumber == "" { - return errs.ErrArgs.Wrap("PhoneNumber is empty") + return errs.ErrArgs.WrapMsg("PhoneNumber is empty") } else if err := PhoneNumberCheck(x.PhoneNumber); err != nil { return err } @@ -91,12 +89,12 @@ func (x *SendVerifyCodeReq) Check() error { func (x *VerifyCodeReq) Check() error { if x.Email == "" { if x.AreaCode == "" { - return errs.ErrArgs.Wrap("AreaCode is empty") + return errs.ErrArgs.WrapMsg("AreaCode is empty") } else if err := AreaCodeCheck(x.AreaCode); err != nil { return err } if x.PhoneNumber == "" { - return errs.ErrArgs.Wrap("PhoneNumber is empty") + return errs.ErrArgs.WrapMsg("PhoneNumber is empty") } else if err := PhoneNumberCheck(x.PhoneNumber); err != nil { return err } @@ -106,32 +104,32 @@ func (x *VerifyCodeReq) Check() error { } } if x.VerifyCode == "" { - return errs.ErrArgs.Wrap("VerifyCode is empty") + return errs.ErrArgs.WrapMsg("VerifyCode is empty") } return nil } func (x *RegisterUserReq) Check() error { //if x.VerifyCode == "" { - // return errs.ErrArgs.Wrap("VerifyCode is empty") + // return errs.ErrArgs.WrapMsg("VerifyCode is empty") //} if x.User.Nickname == "" { - return errs.ErrArgs.Wrap("Nickname is nil") + return errs.ErrArgs.WrapMsg("Nickname is nil") } - if x.Platform < constant2.IOSPlatformID || x.Platform > constant2.AdminPlatformID { - return errs.ErrArgs.Wrap("platform is invalid") + if x.Platform < pconstant.IOSPlatformID || x.Platform > pconstant.AdminPlatformID { + return errs.ErrArgs.WrapMsg("platform is invalid") } if x.User == nil { - return errs.ErrArgs.Wrap("user is empty") + return errs.ErrArgs.WrapMsg("user is empty") } if x.User.Email == "" { if x.User.AreaCode == "" { - return errs.ErrArgs.Wrap("AreaCode is empty") + return errs.ErrArgs.WrapMsg("AreaCode is empty") } else if err := AreaCodeCheck(x.User.AreaCode); err != nil { return err } if x.User.PhoneNumber == "" { - return errs.ErrArgs.Wrap("PhoneNumber is empty") + return errs.ErrArgs.WrapMsg("PhoneNumber is empty") } else if err := PhoneNumberCheck(x.User.PhoneNumber); err != nil { return err } @@ -144,17 +142,17 @@ func (x *RegisterUserReq) Check() error { } func (x *LoginReq) Check() error { - if x.Platform < constant2.IOSPlatformID || x.Platform > constant2.AdminPlatformID { - return errs.ErrArgs.Wrap("platform is invalid") + if x.Platform < pconstant.IOSPlatformID || x.Platform > pconstant.AdminPlatformID { + return errs.ErrArgs.WrapMsg("platform is invalid") } if x.Email == "" { if x.AreaCode == "" { - return errs.ErrArgs.Wrap("AreaCode is empty") + return errs.ErrArgs.WrapMsg("AreaCode is empty") } else if err := AreaCodeCheck(x.AreaCode); err != nil { return err } if x.PhoneNumber == "" { - return errs.ErrArgs.Wrap("PhoneNumber is empty") + return errs.ErrArgs.WrapMsg("PhoneNumber is empty") } else if err := PhoneNumberCheck(x.PhoneNumber); err != nil { return err } @@ -168,16 +166,16 @@ func (x *LoginReq) Check() error { func (x *ResetPasswordReq) Check() error { if x.Password == "" { - return errs.ErrArgs.Wrap("password is empty") + return errs.ErrArgs.WrapMsg("password is empty") } if x.Email == "" { if x.AreaCode == "" { - return errs.ErrArgs.Wrap("AreaCode is empty") + return errs.ErrArgs.WrapMsg("AreaCode is empty") } else if err := AreaCodeCheck(x.AreaCode); err != nil { return err } if x.PhoneNumber == "" { - return errs.ErrArgs.Wrap("PhoneNumber is empty") + return errs.ErrArgs.WrapMsg("PhoneNumber is empty") } else if err := PhoneNumberCheck(x.PhoneNumber); err != nil { return err } @@ -187,18 +185,18 @@ func (x *ResetPasswordReq) Check() error { } } if x.VerifyCode == "" { - return errs.ErrArgs.Wrap("VerifyCode is empty") + return errs.ErrArgs.WrapMsg("VerifyCode is empty") } return nil } func (x *ChangePasswordReq) Check() error { if x.UserID == "" { - return errs.ErrArgs.Wrap("userID is empty") + return errs.ErrArgs.WrapMsg("userID is empty") } if x.NewPassword == "" { - return errs.ErrArgs.Wrap("newPassword is empty") + return errs.ErrArgs.WrapMsg("newPassword is empty") } return nil @@ -206,73 +204,40 @@ func (x *ChangePasswordReq) Check() error { func (x *FindUserAccountReq) Check() error { if x.UserIDs == nil { - return errs.ErrArgs.Wrap("userIDs is empty") + return errs.ErrArgs.WrapMsg("userIDs is empty") } return nil } func (x *FindAccountUserReq) Check() error { if x.Accounts == nil { - return errs.ErrArgs.Wrap("Accounts is empty") + return errs.ErrArgs.WrapMsg("Accounts is empty") } return nil } func (x *SearchUserFullInfoReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("pagination is empty") + return errs.ErrArgs.WrapMsg("pagination is empty") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } if x.Normal < constant.FinDAllUser || x.Normal > constant.FindNormalUser { - return errs.ErrArgs.Wrap("normal flied is invalid") - } - return nil -} - -func (x *DeleteLogsReq) Check() error { - if x.LogIDs == nil { - return errs.ErrArgs.Wrap("LogIDs is empty") - } - if utils.Duplicate(x.LogIDs) { - return errs.ErrArgs.Wrap("Logs has duplicate") - } - return nil -} - -func (x *UploadLogsReq) Check() error { - if x.FileURLs == nil { - return errs.ErrArgs.Wrap("FileUrls is empty") - } - if x.Platform < constant2.IOSPlatformID || x.Platform > constant2.AdminPlatformID { - return errs.ErrArgs.Wrap("Platform is invalid") - } - return nil -} - -func (x *SearchLogsReq) Check() error { - if x.Pagination == nil { - return errs.ErrArgs.Wrap("Pagination is empty") - } - if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") - } - if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("normal flied is invalid") } return nil } func (x *GetTokenForVideoMeetingReq) Check() error { if x.Room == "" { - errs.ErrArgs.Wrap("Room is empty") + errs.ErrArgs.WrapMsg("Room is empty") } if x.Identity == "" { - errs.ErrArgs.Wrap("User Identity is empty") + errs.ErrArgs.WrapMsg("User Identity is empty") } return nil } @@ -280,7 +245,7 @@ func (x *GetTokenForVideoMeetingReq) Check() error { func EmailCheck(email string) error { pattern := `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` if err := regexMatch(pattern, email); err != nil { - return errs.Wrap(err, "Email is invalid") + return errs.WrapMsg(err, "Email is invalid") } return nil } @@ -288,18 +253,18 @@ func EmailCheck(email string) error { func AreaCodeCheck(areaCode string) error { //pattern := `\+[1-9][0-9]{1,2}` //if err := regexMatch(pattern, areaCode); err != nil { - // return errs.Wrap(err, "AreaCode is invalid") + // return errs.WrapMsg(err, "AreaCode is invalid") //} return nil } func PhoneNumberCheck(phoneNumber string) error { if phoneNumber == "" { - return errs.ErrArgs.Wrap("phoneNumber is empty") + return errs.ErrArgs.WrapMsg("phoneNumber is empty") } _, err := strconv.ParseUint(phoneNumber, 10, 64) if err != nil { - return errs.ErrArgs.Wrap("phoneNumber is invalid") + return errs.ErrArgs.WrapMsg("phoneNumber is invalid") } return nil } @@ -315,38 +280,38 @@ func regexMatch(pattern string, target string) error { func (x *SearchUserInfoReq) Check() error { if x.Pagination == nil { - return errs.ErrArgs.Wrap("Pagination is nil") + return errs.ErrArgs.WrapMsg("Pagination is nil") } if x.Pagination.PageNumber < 1 { - return errs.ErrArgs.Wrap("pageNumber is invalid") + return errs.ErrArgs.WrapMsg("pageNumber is invalid") } if x.Pagination.ShowNumber < 1 { - return errs.ErrArgs.Wrap("showNumber is invalid") + return errs.ErrArgs.WrapMsg("showNumber is invalid") } return nil } func (x *AddUserAccountReq) Check() error { if x.User == nil { - return errs.ErrArgs.Wrap("user is empty") + return errs.ErrArgs.WrapMsg("user is empty") } if x.User.Email == "" { if x.User.AreaCode == "" || x.User.PhoneNumber == "" { - return errs.ErrArgs.Wrap("area code or phone number is empty") + return errs.ErrArgs.WrapMsg("area code or phone number is empty") } if x.User.AreaCode[0] != '+' { x.User.AreaCode = "+" + x.User.AreaCode } if _, err := strconv.ParseUint(x.User.AreaCode[1:], 10, 64); err != nil { - return errs.ErrArgs.Wrap("area code must be number") + return errs.ErrArgs.WrapMsg("area code must be number") } if _, err := strconv.ParseUint(x.User.PhoneNumber, 10, 64); err != nil { - return errs.ErrArgs.Wrap("phone number must be number") + return errs.ErrArgs.WrapMsg("phone number must be number") } } else { if err := EmailCheck(x.User.Email); err != nil { - return errs.ErrArgs.Wrap("email must be right") + return errs.ErrArgs.WrapMsg("email must be right") } } diff --git a/pkg/proto/chat/chat.pb.go b/pkg/protocol/chat/chat.pb.go similarity index 54% rename from pkg/proto/chat/chat.pb.go rename to pkg/protocol/chat/chat.pb.go index bf07d6631..16b85c937 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/protocol/chat/chat.pb.go @@ -14,17 +14,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 -// protoc v4.22.0 +// protoc-gen-go v1.33.0 +// protoc v5.26.0 // source: chat/chat.proto package chat import ( context "context" - common "github.com/OpenIMSDK/chat/pkg/proto/common" - sdkws "github.com/OpenIMSDK/protocol/sdkws" - wrapperspb "github.com/OpenIMSDK/protocol/wrapperspb" + common "github.com/openimsdk/chat/pkg/protocol/common" + sdkws "github.com/openimsdk/protocol/sdkws" + wrapperspb "github.com/openimsdk/protocol/wrapperspb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -1395,61 +1395,6 @@ func (x *LoginReq) GetEmail() string { return "" } -type LoginResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ChatToken string `protobuf:"bytes,2,opt,name=chatToken,proto3" json:"chatToken"` - UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` -} - -func (x *LoginResp) Reset() { - *x = LoginResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoginResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginResp) ProtoMessage() {} - -func (x *LoginResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginResp.ProtoReflect.Descriptor instead. -func (*LoginResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{19} -} - -func (x *LoginResp) GetChatToken() string { - if x != nil { - return x.ChatToken - } - return "" -} - -func (x *LoginResp) GetUserID() string { - if x != nil { - return x.UserID - } - return "" -} - type ResetPasswordReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1465,7 +1410,7 @@ type ResetPasswordReq struct { func (x *ResetPasswordReq) Reset() { *x = ResetPasswordReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[20] + mi := &file_chat_chat_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1478,7 +1423,7 @@ func (x *ResetPasswordReq) String() string { func (*ResetPasswordReq) ProtoMessage() {} func (x *ResetPasswordReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[20] + mi := &file_chat_chat_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1491,7 +1436,7 @@ func (x *ResetPasswordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetPasswordReq.ProtoReflect.Descriptor instead. func (*ResetPasswordReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{20} + return file_chat_chat_proto_rawDescGZIP(), []int{19} } func (x *ResetPasswordReq) GetAreaCode() string { @@ -1538,7 +1483,7 @@ type ResetPasswordResp struct { func (x *ResetPasswordResp) Reset() { *x = ResetPasswordResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[21] + mi := &file_chat_chat_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1551,7 +1496,7 @@ func (x *ResetPasswordResp) String() string { func (*ResetPasswordResp) ProtoMessage() {} func (x *ResetPasswordResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[21] + mi := &file_chat_chat_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1564,7 +1509,7 @@ func (x *ResetPasswordResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetPasswordResp.ProtoReflect.Descriptor instead. func (*ResetPasswordResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{21} + return file_chat_chat_proto_rawDescGZIP(), []int{20} } type ChangePasswordReq struct { @@ -1580,7 +1525,7 @@ type ChangePasswordReq struct { func (x *ChangePasswordReq) Reset() { *x = ChangePasswordReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[22] + mi := &file_chat_chat_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1593,7 +1538,7 @@ func (x *ChangePasswordReq) String() string { func (*ChangePasswordReq) ProtoMessage() {} func (x *ChangePasswordReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[22] + mi := &file_chat_chat_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1606,7 +1551,7 @@ func (x *ChangePasswordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangePasswordReq.ProtoReflect.Descriptor instead. func (*ChangePasswordReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{22} + return file_chat_chat_proto_rawDescGZIP(), []int{21} } func (x *ChangePasswordReq) GetUserID() string { @@ -1639,7 +1584,7 @@ type ChangePasswordResp struct { func (x *ChangePasswordResp) Reset() { *x = ChangePasswordResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[23] + mi := &file_chat_chat_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1652,7 +1597,7 @@ func (x *ChangePasswordResp) String() string { func (*ChangePasswordResp) ProtoMessage() {} func (x *ChangePasswordResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[23] + mi := &file_chat_chat_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1665,7 +1610,7 @@ func (x *ChangePasswordResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangePasswordResp.ProtoReflect.Descriptor instead. func (*ChangePasswordResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{23} + return file_chat_chat_proto_rawDescGZIP(), []int{22} } type FindUserAccountReq struct { @@ -1679,7 +1624,7 @@ type FindUserAccountReq struct { func (x *FindUserAccountReq) Reset() { *x = FindUserAccountReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[24] + mi := &file_chat_chat_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1692,7 +1637,7 @@ func (x *FindUserAccountReq) String() string { func (*FindUserAccountReq) ProtoMessage() {} func (x *FindUserAccountReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[24] + mi := &file_chat_chat_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1705,7 +1650,7 @@ func (x *FindUserAccountReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FindUserAccountReq.ProtoReflect.Descriptor instead. func (*FindUserAccountReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{24} + return file_chat_chat_proto_rawDescGZIP(), []int{23} } func (x *FindUserAccountReq) GetUserIDs() []string { @@ -1720,13 +1665,13 @@ type FindUserAccountResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserAccountMap map[string]string `protobuf:"bytes,1,rep,name=userAccountMap,proto3" json:"userAccountMap" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // userID account + UserAccountMap map[string]string `protobuf:"bytes,1,rep,name=userAccountMap,proto3" json:"userAccountMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // userID account } func (x *FindUserAccountResp) Reset() { *x = FindUserAccountResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[25] + mi := &file_chat_chat_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1739,7 +1684,7 @@ func (x *FindUserAccountResp) String() string { func (*FindUserAccountResp) ProtoMessage() {} func (x *FindUserAccountResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[25] + mi := &file_chat_chat_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1752,7 +1697,7 @@ func (x *FindUserAccountResp) ProtoReflect() protoreflect.Message { // Deprecated: Use FindUserAccountResp.ProtoReflect.Descriptor instead. func (*FindUserAccountResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{25} + return file_chat_chat_proto_rawDescGZIP(), []int{24} } func (x *FindUserAccountResp) GetUserAccountMap() map[string]string { @@ -1773,7 +1718,7 @@ type FindAccountUserReq struct { func (x *FindAccountUserReq) Reset() { *x = FindAccountUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[26] + mi := &file_chat_chat_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1786,7 +1731,7 @@ func (x *FindAccountUserReq) String() string { func (*FindAccountUserReq) ProtoMessage() {} func (x *FindAccountUserReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[26] + mi := &file_chat_chat_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1799,7 +1744,7 @@ func (x *FindAccountUserReq) ProtoReflect() protoreflect.Message { // Deprecated: Use FindAccountUserReq.ProtoReflect.Descriptor instead. func (*FindAccountUserReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{26} + return file_chat_chat_proto_rawDescGZIP(), []int{25} } func (x *FindAccountUserReq) GetAccounts() []string { @@ -1814,13 +1759,13 @@ type FindAccountUserResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountUserMap map[string]string `protobuf:"bytes,1,rep,name=accountUserMap,proto3" json:"accountUserMap" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // account userID + AccountUserMap map[string]string `protobuf:"bytes,1,rep,name=accountUserMap,proto3" json:"accountUserMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // account userID } func (x *FindAccountUserResp) Reset() { *x = FindAccountUserResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[27] + mi := &file_chat_chat_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1833,7 +1778,7 @@ func (x *FindAccountUserResp) String() string { func (*FindAccountUserResp) ProtoMessage() {} func (x *FindAccountUserResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[27] + mi := &file_chat_chat_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1846,7 +1791,7 @@ func (x *FindAccountUserResp) ProtoReflect() protoreflect.Message { // Deprecated: Use FindAccountUserResp.ProtoReflect.Descriptor instead. func (*FindAccountUserResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{27} + return file_chat_chat_proto_rawDescGZIP(), []int{26} } func (x *FindAccountUserResp) GetAccountUserMap() map[string]string { @@ -1880,7 +1825,7 @@ type SignalRecord struct { func (x *SignalRecord) Reset() { *x = SignalRecord{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[28] + mi := &file_chat_chat_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1893,7 +1838,7 @@ func (x *SignalRecord) String() string { func (*SignalRecord) ProtoMessage() {} func (x *SignalRecord) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[28] + mi := &file_chat_chat_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1906,7 +1851,7 @@ func (x *SignalRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use SignalRecord.ProtoReflect.Descriptor instead. func (*SignalRecord) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{28} + return file_chat_chat_proto_rawDescGZIP(), []int{27} } func (x *SignalRecord) GetFileName() string { @@ -2007,32 +1952,32 @@ func (x *SignalRecord) GetDownloadURL() string { return "" } -type AddSignalRecordReq struct { +type OpenIMCallbackReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SignalRecord *SignalRecord `protobuf:"bytes,1,opt,name=signalRecord,proto3" json:"signalRecord"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID"` + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command"` + Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body"` } -func (x *AddSignalRecordReq) Reset() { - *x = AddSignalRecordReq{} +func (x *OpenIMCallbackReq) Reset() { + *x = OpenIMCallbackReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[29] + mi := &file_chat_chat_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *AddSignalRecordReq) String() string { +func (x *OpenIMCallbackReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddSignalRecordReq) ProtoMessage() {} +func (*OpenIMCallbackReq) ProtoMessage() {} -func (x *AddSignalRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[29] +func (x *OpenIMCallbackReq) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2043,48 +1988,48 @@ func (x *AddSignalRecordReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddSignalRecordReq.ProtoReflect.Descriptor instead. -func (*AddSignalRecordReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{29} +// Deprecated: Use OpenIMCallbackReq.ProtoReflect.Descriptor instead. +func (*OpenIMCallbackReq) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{28} } -func (x *AddSignalRecordReq) GetSignalRecord() *SignalRecord { +func (x *OpenIMCallbackReq) GetCommand() string { if x != nil { - return x.SignalRecord + return x.Command } - return nil + return "" } -func (x *AddSignalRecordReq) GetOperationID() string { +func (x *OpenIMCallbackReq) GetBody() string { if x != nil { - return x.OperationID + return x.Body } return "" } -type AddSignalRecordResp struct { +type OpenIMCallbackResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *AddSignalRecordResp) Reset() { - *x = AddSignalRecordResp{} +func (x *OpenIMCallbackResp) Reset() { + *x = OpenIMCallbackResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[30] + mi := &file_chat_chat_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *AddSignalRecordResp) String() string { +func (x *OpenIMCallbackResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddSignalRecordResp) ProtoMessage() {} +func (*OpenIMCallbackResp) ProtoMessage() {} -func (x *AddSignalRecordResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[30] +func (x *OpenIMCallbackResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2095,41 +2040,39 @@ func (x *AddSignalRecordResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddSignalRecordResp.ProtoReflect.Descriptor instead. -func (*AddSignalRecordResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{30} +// Deprecated: Use OpenIMCallbackResp.ProtoReflect.Descriptor instead. +func (*OpenIMCallbackResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{29} } -type GetSignalRecordsReq struct { +type SearchUserFullInfoReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` - SenderID string `protobuf:"bytes,2,opt,name=senderID,proto3" json:"senderID"` - RecvID string `protobuf:"bytes,3,opt,name=recvID,proto3" json:"recvID"` - MediaType string `protobuf:"bytes,4,opt,name=mediaType,proto3" json:"mediaType"` - CreateTime int64 `protobuf:"varint,5,opt,name=createTime,proto3" json:"createTime"` - OperationID string `protobuf:"bytes,6,opt,name=operationID,proto3" json:"operationID"` + Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword"` + Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` + Genders int32 `protobuf:"varint,3,opt,name=genders,proto3" json:"genders"` + Normal int32 `protobuf:"varint,4,opt,name=normal,proto3" json:"normal"` } -func (x *GetSignalRecordsReq) Reset() { - *x = GetSignalRecordsReq{} +func (x *SearchUserFullInfoReq) Reset() { + *x = SearchUserFullInfoReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[31] + mi := &file_chat_chat_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetSignalRecordsReq) String() string { +func (x *SearchUserFullInfoReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetSignalRecordsReq) ProtoMessage() {} +func (*SearchUserFullInfoReq) ProtoMessage() {} -func (x *GetSignalRecordsReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[31] +func (x *SearchUserFullInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2140,79 +2083,65 @@ func (x *GetSignalRecordsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetSignalRecordsReq.ProtoReflect.Descriptor instead. -func (*GetSignalRecordsReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{31} -} - -func (x *GetSignalRecordsReq) GetPagination() *sdkws.RequestPagination { - if x != nil { - return x.Pagination - } - return nil -} - -func (x *GetSignalRecordsReq) GetSenderID() string { - if x != nil { - return x.SenderID - } - return "" +// Deprecated: Use SearchUserFullInfoReq.ProtoReflect.Descriptor instead. +func (*SearchUserFullInfoReq) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{30} } -func (x *GetSignalRecordsReq) GetRecvID() string { +func (x *SearchUserFullInfoReq) GetKeyword() string { if x != nil { - return x.RecvID + return x.Keyword } return "" } -func (x *GetSignalRecordsReq) GetMediaType() string { +func (x *SearchUserFullInfoReq) GetPagination() *sdkws.RequestPagination { if x != nil { - return x.MediaType + return x.Pagination } - return "" + return nil } -func (x *GetSignalRecordsReq) GetCreateTime() int64 { +func (x *SearchUserFullInfoReq) GetGenders() int32 { if x != nil { - return x.CreateTime + return x.Genders } return 0 } -func (x *GetSignalRecordsReq) GetOperationID() string { +func (x *SearchUserFullInfoReq) GetNormal() int32 { if x != nil { - return x.OperationID + return x.Normal } - return "" + return 0 } -type GetSignalRecordsResp struct { +type SearchUserFullInfoResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TotalNumber uint32 `protobuf:"varint,1,opt,name=totalNumber,proto3" json:"totalNumber"` - SignalRecords []*SignalRecord `protobuf:"bytes,2,rep,name=signalRecords,proto3" json:"signalRecords"` + Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` + Users []*common.UserFullInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"` } -func (x *GetSignalRecordsResp) Reset() { - *x = GetSignalRecordsResp{} +func (x *SearchUserFullInfoResp) Reset() { + *x = SearchUserFullInfoResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[32] + mi := &file_chat_chat_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetSignalRecordsResp) String() string { +func (x *SearchUserFullInfoResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetSignalRecordsResp) ProtoMessage() {} +func (*SearchUserFullInfoResp) ProtoMessage() {} -func (x *GetSignalRecordsResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[32] +func (x *SearchUserFullInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2223,51 +2152,51 @@ func (x *GetSignalRecordsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetSignalRecordsResp.ProtoReflect.Descriptor instead. -func (*GetSignalRecordsResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{32} +// Deprecated: Use SearchUserFullInfoResp.ProtoReflect.Descriptor instead. +func (*SearchUserFullInfoResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{31} } -func (x *GetSignalRecordsResp) GetTotalNumber() uint32 { +func (x *SearchUserFullInfoResp) GetTotal() uint32 { if x != nil { - return x.TotalNumber + return x.Total } return 0 } -func (x *GetSignalRecordsResp) GetSignalRecords() []*SignalRecord { +func (x *SearchUserFullInfoResp) GetUsers() []*common.UserFullInfo { if x != nil { - return x.SignalRecords + return x.Users } return nil } -type OpenIMCallbackReq struct { +type UserLoginCountReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command"` - Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body"` + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` + End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` } -func (x *OpenIMCallbackReq) Reset() { - *x = OpenIMCallbackReq{} +func (x *UserLoginCountReq) Reset() { + *x = UserLoginCountReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[33] + mi := &file_chat_chat_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *OpenIMCallbackReq) String() string { +func (x *UserLoginCountReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OpenIMCallbackReq) ProtoMessage() {} +func (*UserLoginCountReq) ProtoMessage() {} -func (x *OpenIMCallbackReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[33] +func (x *UserLoginCountReq) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2278,592 +2207,52 @@ func (x *OpenIMCallbackReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OpenIMCallbackReq.ProtoReflect.Descriptor instead. -func (*OpenIMCallbackReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{33} +// Deprecated: Use UserLoginCountReq.ProtoReflect.Descriptor instead. +func (*UserLoginCountReq) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{32} } -func (x *OpenIMCallbackReq) GetCommand() string { +func (x *UserLoginCountReq) GetStart() int64 { if x != nil { - return x.Command + return x.Start } - return "" + return 0 } -func (x *OpenIMCallbackReq) GetBody() string { +func (x *UserLoginCountReq) GetEnd() int64 { if x != nil { - return x.Body + return x.End } - return "" + return 0 } -type OpenIMCallbackResp struct { +type UserLoginCountResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + LoginCount int64 `protobuf:"varint,1,opt,name=loginCount,proto3" json:"loginCount"` + UnloginCount int64 `protobuf:"varint,2,opt,name=unloginCount,proto3" json:"unloginCount"` + Count map[string]int64 `protobuf:"bytes,3,rep,name=count,proto3" json:"count,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } -func (x *OpenIMCallbackResp) Reset() { - *x = OpenIMCallbackResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OpenIMCallbackResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OpenIMCallbackResp) ProtoMessage() {} - -func (x *OpenIMCallbackResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OpenIMCallbackResp.ProtoReflect.Descriptor instead. -func (*OpenIMCallbackResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{34} -} - -type SearchUserFullInfoReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword"` - Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` - Genders int32 `protobuf:"varint,3,opt,name=genders,proto3" json:"genders"` - Normal int32 `protobuf:"varint,4,opt,name=normal,proto3" json:"normal"` -} - -func (x *SearchUserFullInfoReq) Reset() { - *x = SearchUserFullInfoReq{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchUserFullInfoReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchUserFullInfoReq) ProtoMessage() {} - -func (x *SearchUserFullInfoReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchUserFullInfoReq.ProtoReflect.Descriptor instead. -func (*SearchUserFullInfoReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{35} -} - -func (x *SearchUserFullInfoReq) GetKeyword() string { - if x != nil { - return x.Keyword - } - return "" -} - -func (x *SearchUserFullInfoReq) GetPagination() *sdkws.RequestPagination { - if x != nil { - return x.Pagination - } - return nil -} - -func (x *SearchUserFullInfoReq) GetGenders() int32 { - if x != nil { - return x.Genders - } - return 0 -} - -func (x *SearchUserFullInfoReq) GetNormal() int32 { - if x != nil { - return x.Normal - } - return 0 -} - -type SearchUserFullInfoResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` - Users []*common.UserFullInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"` -} - -func (x *SearchUserFullInfoResp) Reset() { - *x = SearchUserFullInfoResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchUserFullInfoResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchUserFullInfoResp) ProtoMessage() {} - -func (x *SearchUserFullInfoResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchUserFullInfoResp.ProtoReflect.Descriptor instead. -func (*SearchUserFullInfoResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{36} -} - -func (x *SearchUserFullInfoResp) GetTotal() uint32 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *SearchUserFullInfoResp) GetUsers() []*common.UserFullInfo { - if x != nil { - return x.Users - } - return nil -} - -type UserLoginCountReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` - End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` -} - -func (x *UserLoginCountReq) Reset() { - *x = UserLoginCountReq{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserLoginCountReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserLoginCountReq) ProtoMessage() {} - -func (x *UserLoginCountReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserLoginCountReq.ProtoReflect.Descriptor instead. -func (*UserLoginCountReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{37} -} - -func (x *UserLoginCountReq) GetStart() int64 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *UserLoginCountReq) GetEnd() int64 { - if x != nil { - return x.End - } - return 0 -} - -type UserLoginCountResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LoginCount int64 `protobuf:"varint,1,opt,name=loginCount,proto3" json:"loginCount"` - UnloginCount int64 `protobuf:"varint,2,opt,name=unloginCount,proto3" json:"unloginCount"` - Count map[string]int64 `protobuf:"bytes,3,rep,name=Count,proto3" json:"Count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *UserLoginCountResp) Reset() { - *x = UserLoginCountResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserLoginCountResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserLoginCountResp) ProtoMessage() {} - -func (x *UserLoginCountResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserLoginCountResp.ProtoReflect.Descriptor instead. -func (*UserLoginCountResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{38} -} - -func (x *UserLoginCountResp) GetLoginCount() int64 { - if x != nil { - return x.LoginCount - } - return 0 -} - -func (x *UserLoginCountResp) GetUnloginCount() int64 { - if x != nil { - return x.UnloginCount - } - return 0 -} - -func (x *UserLoginCountResp) GetCount() map[string]int64 { - if x != nil { - return x.Count - } - return nil -} - -type FileURL struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename"` - URL string `protobuf:"bytes,2,opt,name=URL,proto3" json:"URL"` -} - -func (x *FileURL) Reset() { - *x = FileURL{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileURL) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileURL) ProtoMessage() {} - -func (x *FileURL) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileURL.ProtoReflect.Descriptor instead. -func (*FileURL) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{39} -} - -func (x *FileURL) GetFilename() string { - if x != nil { - return x.Filename - } - return "" -} - -func (x *FileURL) GetURL() string { - if x != nil { - return x.URL - } - return "" -} - -type UploadLogsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform int32 `protobuf:"varint,1,opt,name=platform,proto3" json:"platform"` - FileURLs []*FileURL `protobuf:"bytes,2,rep,name=fileURLs,proto3" json:"fileURLs"` - SystemType string `protobuf:"bytes,3,opt,name=systemType,proto3" json:"systemType"` - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version"` - Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"` -} - -func (x *UploadLogsReq) Reset() { - *x = UploadLogsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadLogsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadLogsReq) ProtoMessage() {} - -func (x *UploadLogsReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadLogsReq.ProtoReflect.Descriptor instead. -func (*UploadLogsReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{40} -} - -func (x *UploadLogsReq) GetPlatform() int32 { - if x != nil { - return x.Platform - } - return 0 -} - -func (x *UploadLogsReq) GetFileURLs() []*FileURL { - if x != nil { - return x.FileURLs - } - return nil -} - -func (x *UploadLogsReq) GetSystemType() string { - if x != nil { - return x.SystemType - } - return "" -} - -func (x *UploadLogsReq) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *UploadLogsReq) GetEx() string { - if x != nil { - return x.Ex - } - return "" -} - -type UploadLogsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UploadLogsResp) Reset() { - *x = UploadLogsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadLogsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadLogsResp) ProtoMessage() {} - -func (x *UploadLogsResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadLogsResp.ProtoReflect.Descriptor instead. -func (*UploadLogsResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{41} -} - -type DeleteLogsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogIDs []string `protobuf:"bytes,1,rep,name=logIDs,proto3" json:"logIDs"` -} - -func (x *DeleteLogsReq) Reset() { - *x = DeleteLogsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteLogsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteLogsReq) ProtoMessage() {} - -func (x *DeleteLogsReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[42] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteLogsReq.ProtoReflect.Descriptor instead. -func (*DeleteLogsReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{42} -} - -func (x *DeleteLogsReq) GetLogIDs() []string { - if x != nil { - return x.LogIDs - } - return nil -} - -type DeleteLogsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteLogsResp) Reset() { - *x = DeleteLogsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteLogsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteLogsResp) ProtoMessage() {} - -func (x *DeleteLogsResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteLogsResp.ProtoReflect.Descriptor instead. -func (*DeleteLogsResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{43} -} - -type SearchLogsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword"` - StartTime int64 `protobuf:"varint,2,opt,name=startTime,proto3" json:"startTime"` - EndTime int64 `protobuf:"varint,3,opt,name=endTime,proto3" json:"endTime"` - Pagination *sdkws.RequestPagination `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination"` -} - -func (x *SearchLogsReq) Reset() { - *x = SearchLogsReq{} +func (x *UserLoginCountResp) Reset() { + *x = UserLoginCountResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[44] + mi := &file_chat_chat_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SearchLogsReq) String() string { +func (x *UserLoginCountResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchLogsReq) ProtoMessage() {} +func (*UserLoginCountResp) ProtoMessage() {} -func (x *SearchLogsReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[44] +func (x *UserLoginCountResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2874,65 +2263,58 @@ func (x *SearchLogsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchLogsReq.ProtoReflect.Descriptor instead. -func (*SearchLogsReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{44} -} - -func (x *SearchLogsReq) GetKeyword() string { - if x != nil { - return x.Keyword - } - return "" +// Deprecated: Use UserLoginCountResp.ProtoReflect.Descriptor instead. +func (*UserLoginCountResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{33} } -func (x *SearchLogsReq) GetStartTime() int64 { +func (x *UserLoginCountResp) GetLoginCount() int64 { if x != nil { - return x.StartTime + return x.LoginCount } return 0 } -func (x *SearchLogsReq) GetEndTime() int64 { +func (x *UserLoginCountResp) GetUnloginCount() int64 { if x != nil { - return x.EndTime + return x.UnloginCount } return 0 } -func (x *SearchLogsReq) GetPagination() *sdkws.RequestPagination { +func (x *UserLoginCountResp) GetCount() map[string]int64 { if x != nil { - return x.Pagination + return x.Count } return nil } -type SearchLogsResp struct { +type LoginResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - LogsInfos []*common.LogInfo `protobuf:"bytes,1,rep,name=LogsInfos,proto3" json:"LogsInfos"` - Total uint32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` + ChatToken string `protobuf:"bytes,2,opt,name=chatToken,proto3" json:"chatToken"` + UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` } -func (x *SearchLogsResp) Reset() { - *x = SearchLogsResp{} +func (x *LoginResp) Reset() { + *x = LoginResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[45] + mi := &file_chat_chat_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SearchLogsResp) String() string { +func (x *LoginResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SearchLogsResp) ProtoMessage() {} +func (*LoginResp) ProtoMessage() {} -func (x *SearchLogsResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[45] +func (x *LoginResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2943,23 +2325,23 @@ func (x *SearchLogsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SearchLogsResp.ProtoReflect.Descriptor instead. -func (*SearchLogsResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{45} +// Deprecated: Use LoginResp.ProtoReflect.Descriptor instead. +func (*LoginResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{34} } -func (x *SearchLogsResp) GetLogsInfos() []*common.LogInfo { +func (x *LoginResp) GetChatToken() string { if x != nil { - return x.LogsInfos + return x.ChatToken } - return nil + return "" } -func (x *SearchLogsResp) GetTotal() uint32 { +func (x *LoginResp) GetUserID() string { if x != nil { - return x.Total + return x.UserID } - return 0 + return "" } type SearchUserInfoReq struct { @@ -2976,7 +2358,7 @@ type SearchUserInfoReq struct { func (x *SearchUserInfoReq) Reset() { *x = SearchUserInfoReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[46] + mi := &file_chat_chat_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2989,7 +2371,7 @@ func (x *SearchUserInfoReq) String() string { func (*SearchUserInfoReq) ProtoMessage() {} func (x *SearchUserInfoReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[46] + mi := &file_chat_chat_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3002,7 +2384,7 @@ func (x *SearchUserInfoReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUserInfoReq.ProtoReflect.Descriptor instead. func (*SearchUserInfoReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{46} + return file_chat_chat_proto_rawDescGZIP(), []int{35} } func (x *SearchUserInfoReq) GetKeyword() string { @@ -3045,7 +2427,7 @@ type SearchUserInfoResp struct { func (x *SearchUserInfoResp) Reset() { *x = SearchUserInfoResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[47] + mi := &file_chat_chat_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3058,7 +2440,7 @@ func (x *SearchUserInfoResp) String() string { func (*SearchUserInfoResp) ProtoMessage() {} func (x *SearchUserInfoResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[47] + mi := &file_chat_chat_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3071,7 +2453,7 @@ func (x *SearchUserInfoResp) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUserInfoResp.ProtoReflect.Descriptor instead. func (*SearchUserInfoResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{47} + return file_chat_chat_proto_rawDescGZIP(), []int{36} } func (x *SearchUserInfoResp) GetTotal() uint32 { @@ -3100,7 +2482,7 @@ type GetTokenForVideoMeetingReq struct { func (x *GetTokenForVideoMeetingReq) Reset() { *x = GetTokenForVideoMeetingReq{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[48] + mi := &file_chat_chat_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3113,7 +2495,7 @@ func (x *GetTokenForVideoMeetingReq) String() string { func (*GetTokenForVideoMeetingReq) ProtoMessage() {} func (x *GetTokenForVideoMeetingReq) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[48] + mi := &file_chat_chat_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3126,7 +2508,7 @@ func (x *GetTokenForVideoMeetingReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTokenForVideoMeetingReq.ProtoReflect.Descriptor instead. func (*GetTokenForVideoMeetingReq) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{48} + return file_chat_chat_proto_rawDescGZIP(), []int{37} } func (x *GetTokenForVideoMeetingReq) GetRoom() string { @@ -3155,7 +2537,7 @@ type GetTokenForVideoMeetingResp struct { func (x *GetTokenForVideoMeetingResp) Reset() { *x = GetTokenForVideoMeetingResp{} if protoimpl.UnsafeEnabled { - mi := &file_chat_chat_proto_msgTypes[49] + mi := &file_chat_chat_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3168,7 +2550,7 @@ func (x *GetTokenForVideoMeetingResp) String() string { func (*GetTokenForVideoMeetingResp) ProtoMessage() {} func (x *GetTokenForVideoMeetingResp) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[49] + mi := &file_chat_chat_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3181,7 +2563,7 @@ func (x *GetTokenForVideoMeetingResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTokenForVideoMeetingResp.ProtoReflect.Descriptor instead. func (*GetTokenForVideoMeetingResp) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{49} + return file_chat_chat_proto_rawDescGZIP(), []int{38} } func (x *GetTokenForVideoMeetingResp) GetServerUrl() string { @@ -3202,873 +2584,602 @@ var File_chat_chat_proto protoreflect.FileDescriptor var file_chat_chat_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, - 0x61, 0x74, 0x1a, 0x14, 0x70, 0x75, 0x62, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, - 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x70, 0x75, 0x62, 0x2f, 0x73, 0x64, - 0x6b, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, - 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, - 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc1, 0x07, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, - 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x61, - 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x12, 0x3e, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, - 0x39, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x49, 0x0a, 0x0e, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, - 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, - 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x42, 0x65, 0x65, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x12, 0x49, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, - 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x6f, 0x12, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x1a, 0x1b, + 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x70, 0x62, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x72, 0x73, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x73, 0x64, 0x6b, + 0x77, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, + 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xed, 0x06, 0x0a, 0x11, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3e, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x38, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x38, + 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, + 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, + 0x55, 0x52, 0x4c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, + 0x12, 0x33, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x67, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, + 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x43, 0x0a, 0x0e, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x12, 0x39, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x12, 0x43, 0x0a, 0x0e, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, - 0x70, 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4a, 0x0a, 0x12, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, - 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, - 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x51, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x37, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x17, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x73, 0x22, 0x69, 0x0a, 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, + 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x47, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, + 0x67, 0x4f, 0x70, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, + 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4a, 0x0a, 0x12, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x52, 0x0a, 0x16, 0x46, 0x69, 0x6e, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, - 0x13, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x4d, - 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, - 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0xf1, 0x01, - 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x26, 0x0a, - 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, - 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, - 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x83, 0x01, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x10, 0x0a, - 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, - 0xbc, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, - 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, - 0x52, 0x4c, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf6, - 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xfc, 0x01, 0x0a, - 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x41, 0x0a, 0x09, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x74, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0xa2, - 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x77, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2e, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x13, 0x46, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x60, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, - 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, - 0x70, 0x1a, 0x41, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x30, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x13, 0x46, 0x69, 0x6e, 0x64, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x60, - 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, - 0x1a, 0x41, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x8e, 0x01, + 0x0a, 0x17, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, + 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x22, 0x6a, + 0x0a, 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x38, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x13, 0x46, 0x69, + 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x4e, 0x0a, 0x14, 0x46, + 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x11, + 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, + 0x14, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x83, 0x01, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x10, 0x0a, 0x0e, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xbc, 0x02, + 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, + 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, + 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf2, 0x01, 0x0a, + 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x31, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x22, 0x48, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x11, + 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x31, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x14, 0x0a, 0x12, + 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0xfc, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x22, 0xa2, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x77, 0x0a, 0x11, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2e, 0x0a, 0x12, 0x46, 0x69, + 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x13, 0x46, + 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x4d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x70, + 0x1a, 0x41, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0xdb, 0x03, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x76, 0x4e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x63, 0x76, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, - 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, - 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, - 0x4c, 0x22, 0x79, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0c, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, - 0x41, 0x64, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x22, 0xf0, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x12, 0x45, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, - 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x44, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x7d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, - 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x43, 0x0a, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x41, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x14, 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0xaa, - 0x01, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, - 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, - 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x22, 0x65, 0x0a, 0x16, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x35, 0x0a, 0x05, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x22, 0x3b, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, - 0xd8, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x75, 0x6e, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x6e, - 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x05, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x1a, 0x38, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x07, 0x66, 0x69, - 0x6c, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x52, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x55, 0x52, 0x4c, 0x22, 0xab, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x6f, - 0x67, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x12, 0x34, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x52, 0x4c, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x52, 0x4c, 0x52, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x55, 0x52, 0x4c, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, - 0x78, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x27, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x49, 0x44, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x49, 0x44, 0x73, 0x22, 0x10, 0x0a, 0x0e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0xa8, - 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x02, 0x38, 0x01, 0x22, 0x30, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x13, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, + 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x1a, 0x41, 0x0a, 0x13, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdc, + 0x03, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x6f, + 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, + 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, + 0x76, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x63, 0x76, 0x49, + 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x76, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x76, 0x4e, 0x69, 0x63, + 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, + 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, + 0x0f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x52, 0x4c, 0x22, 0x41, 0x0a, + 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x22, 0x14, 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0xa4, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x60, 0x0a, 0x0e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x4c, - 0x6f, 0x67, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x4c, 0x6f, 0x67, 0x73, - 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0xa8, 0x01, 0x0a, 0x11, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x45, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, - 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x05, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x61, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x12, 0x35, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x4c, 0x0a, 0x1a, 0x47, 0x65, 0x74, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, - 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x51, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb9, 0x10, 0x0a, 0x04, 0x63, - 0x68, 0x61, 0x74, 0x12, 0x59, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, - 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, + 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x22, 0x66, 0x0a, + 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x36, 0x0a, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x3b, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, + 0x6e, 0x64, 0x22, 0xd4, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, + 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x75, 0x6e, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0c, 0x75, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, + 0x38, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x41, 0x0a, 0x09, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x74, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0xa2, 0x01, 0x0a, + 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, + 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x73, 0x22, 0x62, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x36, 0x0a, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x4c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x22, 0x51, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, + 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xfd, 0x0b, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, + 0x51, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x14, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x65, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x46, 0x69, + 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x65, 0x0a, - 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, - 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, + 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x25, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, - 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x4d, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x53, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x1a, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x0e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x22, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x0c, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x4e, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, + 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, + 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x51, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, - 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x5f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x59, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, - 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, - 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4c, - 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, - 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, - 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x6f, - 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x6f, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x6f, 0x67, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x74, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, - 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, - 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x2c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x43, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, + 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x46, 0x69, 0x6e, + 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, + 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, + 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x63, - 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x68, - 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, 0x63, + 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2f, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_chat_chat_proto_rawDescOnce sync.Once - file_chat_chat_proto_rawDescData = file_chat_chat_proto_rawDesc -) - -func file_chat_chat_proto_rawDescGZIP() []byte { - file_chat_chat_proto_rawDescOnce.Do(func() { - file_chat_chat_proto_rawDescData = protoimpl.X.CompressGZIP(file_chat_chat_proto_rawDescData) - }) - return file_chat_chat_proto_rawDescData -} - -var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 53) -var file_chat_chat_proto_goTypes = []interface{}{ - (*UserIdentity)(nil), // 0: OpenIMChat.chat.UserIdentity - (*UpdateUserInfoReq)(nil), // 1: OpenIMChat.chat.UpdateUserInfoReq - (*UpdateUserInfoResp)(nil), // 2: OpenIMChat.chat.UpdateUserInfoResp - (*FindUserPublicInfoReq)(nil), // 3: OpenIMChat.chat.FindUserPublicInfoReq - (*FindUserPublicInfoResp)(nil), // 4: OpenIMChat.chat.FindUserPublicInfoResp - (*SearchUserPublicInfoReq)(nil), // 5: OpenIMChat.chat.SearchUserPublicInfoReq - (*SearchUserPublicInfoResp)(nil), // 6: OpenIMChat.chat.SearchUserPublicInfoResp - (*FindUserFullInfoReq)(nil), // 7: OpenIMChat.chat.FindUserFullInfoReq - (*FindUserFullInfoResp)(nil), // 8: OpenIMChat.chat.FindUserFullInfoResp - (*SendVerifyCodeReq)(nil), // 9: OpenIMChat.chat.SendVerifyCodeReq - (*SendVerifyCodeResp)(nil), // 10: OpenIMChat.chat.SendVerifyCodeResp - (*VerifyCodeReq)(nil), // 11: OpenIMChat.chat.VerifyCodeReq - (*VerifyCodeResp)(nil), // 12: OpenIMChat.chat.VerifyCodeResp - (*RegisterUserInfo)(nil), // 13: OpenIMChat.chat.RegisterUserInfo - (*RegisterUserReq)(nil), // 14: OpenIMChat.chat.RegisterUserReq - (*RegisterUserResp)(nil), // 15: OpenIMChat.chat.RegisterUserResp - (*AddUserAccountReq)(nil), // 16: OpenIMChat.chat.AddUserAccountReq - (*AddUserAccountResp)(nil), // 17: OpenIMChat.chat.AddUserAccountResp - (*LoginReq)(nil), // 18: OpenIMChat.chat.LoginReq - (*LoginResp)(nil), // 19: OpenIMChat.chat.LoginResp - (*ResetPasswordReq)(nil), // 20: OpenIMChat.chat.ResetPasswordReq - (*ResetPasswordResp)(nil), // 21: OpenIMChat.chat.ResetPasswordResp - (*ChangePasswordReq)(nil), // 22: OpenIMChat.chat.ChangePasswordReq - (*ChangePasswordResp)(nil), // 23: OpenIMChat.chat.ChangePasswordResp - (*FindUserAccountReq)(nil), // 24: OpenIMChat.chat.FindUserAccountReq - (*FindUserAccountResp)(nil), // 25: OpenIMChat.chat.FindUserAccountResp - (*FindAccountUserReq)(nil), // 26: OpenIMChat.chat.FindAccountUserReq - (*FindAccountUserResp)(nil), // 27: OpenIMChat.chat.FindAccountUserResp - (*SignalRecord)(nil), // 28: OpenIMChat.chat.SignalRecord - (*AddSignalRecordReq)(nil), // 29: OpenIMChat.chat.AddSignalRecordReq - (*AddSignalRecordResp)(nil), // 30: OpenIMChat.chat.AddSignalRecordResp - (*GetSignalRecordsReq)(nil), // 31: OpenIMChat.chat.GetSignalRecordsReq - (*GetSignalRecordsResp)(nil), // 32: OpenIMChat.chat.GetSignalRecordsResp - (*OpenIMCallbackReq)(nil), // 33: OpenIMChat.chat.OpenIMCallbackReq - (*OpenIMCallbackResp)(nil), // 34: OpenIMChat.chat.OpenIMCallbackResp - (*SearchUserFullInfoReq)(nil), // 35: OpenIMChat.chat.SearchUserFullInfoReq - (*SearchUserFullInfoResp)(nil), // 36: OpenIMChat.chat.SearchUserFullInfoResp - (*UserLoginCountReq)(nil), // 37: OpenIMChat.chat.UserLoginCountReq - (*UserLoginCountResp)(nil), // 38: OpenIMChat.chat.UserLoginCountResp - (*FileURL)(nil), // 39: OpenIMChat.chat.fileURL - (*UploadLogsReq)(nil), // 40: OpenIMChat.chat.UploadLogsReq - (*UploadLogsResp)(nil), // 41: OpenIMChat.chat.UploadLogsResp - (*DeleteLogsReq)(nil), // 42: OpenIMChat.chat.DeleteLogsReq - (*DeleteLogsResp)(nil), // 43: OpenIMChat.chat.DeleteLogsResp - (*SearchLogsReq)(nil), // 44: OpenIMChat.chat.SearchLogsReq - (*SearchLogsResp)(nil), // 45: OpenIMChat.chat.SearchLogsResp - (*SearchUserInfoReq)(nil), // 46: OpenIMChat.chat.SearchUserInfoReq - (*SearchUserInfoResp)(nil), // 47: OpenIMChat.chat.SearchUserInfoResp - (*GetTokenForVideoMeetingReq)(nil), // 48: OpenIMChat.chat.GetTokenForVideoMeetingReq - (*GetTokenForVideoMeetingResp)(nil), // 49: OpenIMChat.chat.GetTokenForVideoMeetingResp - nil, // 50: OpenIMChat.chat.FindUserAccountResp.UserAccountMapEntry - nil, // 51: OpenIMChat.chat.FindAccountUserResp.AccountUserMapEntry - nil, // 52: OpenIMChat.chat.UserLoginCountResp.CountEntry - (*wrapperspb.StringValue)(nil), // 53: OpenIMServer.protobuf.StringValue - (*wrapperspb.Int32Value)(nil), // 54: OpenIMServer.protobuf.Int32Value - (*wrapperspb.Int64Value)(nil), // 55: OpenIMServer.protobuf.Int64Value - (*common.UserPublicInfo)(nil), // 56: OpenIMChat.common.UserPublicInfo - (*sdkws.RequestPagination)(nil), // 57: OpenIMServer.sdkws.RequestPagination - (*common.UserFullInfo)(nil), // 58: OpenIMChat.common.UserFullInfo - (*common.LogInfo)(nil), // 59: OpenIMChat.common.LogInfo -} -var file_chat_chat_proto_depIdxs = []int32{ - 53, // 0: OpenIMChat.chat.UpdateUserInfoReq.account:type_name -> OpenIMServer.protobuf.StringValue - 53, // 1: OpenIMChat.chat.UpdateUserInfoReq.phoneNumber:type_name -> OpenIMServer.protobuf.StringValue - 53, // 2: OpenIMChat.chat.UpdateUserInfoReq.areaCode:type_name -> OpenIMServer.protobuf.StringValue - 53, // 3: OpenIMChat.chat.UpdateUserInfoReq.email:type_name -> OpenIMServer.protobuf.StringValue - 53, // 4: OpenIMChat.chat.UpdateUserInfoReq.nickname:type_name -> OpenIMServer.protobuf.StringValue - 53, // 5: OpenIMChat.chat.UpdateUserInfoReq.faceURL:type_name -> OpenIMServer.protobuf.StringValue - 54, // 6: OpenIMChat.chat.UpdateUserInfoReq.gender:type_name -> OpenIMServer.protobuf.Int32Value - 54, // 7: OpenIMChat.chat.UpdateUserInfoReq.level:type_name -> OpenIMServer.protobuf.Int32Value - 55, // 8: OpenIMChat.chat.UpdateUserInfoReq.birth:type_name -> OpenIMServer.protobuf.Int64Value - 54, // 9: OpenIMChat.chat.UpdateUserInfoReq.allowAddFriend:type_name -> OpenIMServer.protobuf.Int32Value - 54, // 10: OpenIMChat.chat.UpdateUserInfoReq.allowBeep:type_name -> OpenIMServer.protobuf.Int32Value - 54, // 11: OpenIMChat.chat.UpdateUserInfoReq.allowVibration:type_name -> OpenIMServer.protobuf.Int32Value - 54, // 12: OpenIMChat.chat.UpdateUserInfoReq.globalRecvMsgOpt:type_name -> OpenIMServer.protobuf.Int32Value - 54, // 13: OpenIMChat.chat.UpdateUserInfoReq.RegisterType:type_name -> OpenIMServer.protobuf.Int32Value - 56, // 14: OpenIMChat.chat.FindUserPublicInfoResp.users:type_name -> OpenIMChat.common.UserPublicInfo - 57, // 15: OpenIMChat.chat.SearchUserPublicInfoReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 56, // 16: OpenIMChat.chat.SearchUserPublicInfoResp.users:type_name -> OpenIMChat.common.UserPublicInfo - 58, // 17: OpenIMChat.chat.FindUserFullInfoResp.users:type_name -> OpenIMChat.common.UserFullInfo - 13, // 18: OpenIMChat.chat.RegisterUserReq.user:type_name -> OpenIMChat.chat.RegisterUserInfo - 13, // 19: OpenIMChat.chat.AddUserAccountReq.user:type_name -> OpenIMChat.chat.RegisterUserInfo - 50, // 20: OpenIMChat.chat.FindUserAccountResp.userAccountMap:type_name -> OpenIMChat.chat.FindUserAccountResp.UserAccountMapEntry - 51, // 21: OpenIMChat.chat.FindAccountUserResp.accountUserMap:type_name -> OpenIMChat.chat.FindAccountUserResp.AccountUserMapEntry - 56, // 22: OpenIMChat.chat.SignalRecord.inviterUserList:type_name -> OpenIMChat.common.UserPublicInfo - 28, // 23: OpenIMChat.chat.AddSignalRecordReq.signalRecord:type_name -> OpenIMChat.chat.SignalRecord - 57, // 24: OpenIMChat.chat.GetSignalRecordsReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 28, // 25: OpenIMChat.chat.GetSignalRecordsResp.signalRecords:type_name -> OpenIMChat.chat.SignalRecord - 57, // 26: OpenIMChat.chat.SearchUserFullInfoReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 58, // 27: OpenIMChat.chat.SearchUserFullInfoResp.users:type_name -> OpenIMChat.common.UserFullInfo - 52, // 28: OpenIMChat.chat.UserLoginCountResp.Count:type_name -> OpenIMChat.chat.UserLoginCountResp.CountEntry - 39, // 29: OpenIMChat.chat.UploadLogsReq.fileURLs:type_name -> OpenIMChat.chat.fileURL - 57, // 30: OpenIMChat.chat.SearchLogsReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 59, // 31: OpenIMChat.chat.SearchLogsResp.LogsInfos:type_name -> OpenIMChat.common.LogInfo - 57, // 32: OpenIMChat.chat.SearchUserInfoReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 58, // 33: OpenIMChat.chat.SearchUserInfoResp.users:type_name -> OpenIMChat.common.UserFullInfo - 1, // 34: OpenIMChat.chat.chat.UpdateUserInfo:input_type -> OpenIMChat.chat.UpdateUserInfoReq - 16, // 35: OpenIMChat.chat.chat.AddUserAccount:input_type -> OpenIMChat.chat.AddUserAccountReq - 5, // 36: OpenIMChat.chat.chat.SearchUserPublicInfo:input_type -> OpenIMChat.chat.SearchUserPublicInfoReq - 3, // 37: OpenIMChat.chat.chat.FindUserPublicInfo:input_type -> OpenIMChat.chat.FindUserPublicInfoReq - 35, // 38: OpenIMChat.chat.chat.SearchUserFullInfo:input_type -> OpenIMChat.chat.SearchUserFullInfoReq - 7, // 39: OpenIMChat.chat.chat.FindUserFullInfo:input_type -> OpenIMChat.chat.FindUserFullInfoReq - 9, // 40: OpenIMChat.chat.chat.SendVerifyCode:input_type -> OpenIMChat.chat.SendVerifyCodeReq - 11, // 41: OpenIMChat.chat.chat.VerifyCode:input_type -> OpenIMChat.chat.VerifyCodeReq - 14, // 42: OpenIMChat.chat.chat.RegisterUser:input_type -> OpenIMChat.chat.RegisterUserReq - 18, // 43: OpenIMChat.chat.chat.Login:input_type -> OpenIMChat.chat.LoginReq - 20, // 44: OpenIMChat.chat.chat.ResetPassword:input_type -> OpenIMChat.chat.ResetPasswordReq - 22, // 45: OpenIMChat.chat.chat.ChangePassword:input_type -> OpenIMChat.chat.ChangePasswordReq - 24, // 46: OpenIMChat.chat.chat.FindUserAccount:input_type -> OpenIMChat.chat.FindUserAccountReq - 26, // 47: OpenIMChat.chat.chat.FindAccountUser:input_type -> OpenIMChat.chat.FindAccountUserReq - 29, // 48: OpenIMChat.chat.chat.AddSignalRecord:input_type -> OpenIMChat.chat.AddSignalRecordReq - 31, // 49: OpenIMChat.chat.chat.GetSignalRecords:input_type -> OpenIMChat.chat.GetSignalRecordsReq - 33, // 50: OpenIMChat.chat.chat.OpenIMCallback:input_type -> OpenIMChat.chat.OpenIMCallbackReq - 37, // 51: OpenIMChat.chat.chat.UserLoginCount:input_type -> OpenIMChat.chat.UserLoginCountReq - 40, // 52: OpenIMChat.chat.chat.UploadLogs:input_type -> OpenIMChat.chat.UploadLogsReq - 42, // 53: OpenIMChat.chat.chat.DeleteLogs:input_type -> OpenIMChat.chat.DeleteLogsReq - 44, // 54: OpenIMChat.chat.chat.SearchLogs:input_type -> OpenIMChat.chat.SearchLogsReq - 46, // 55: OpenIMChat.chat.chat.SearchUserInfo:input_type -> OpenIMChat.chat.SearchUserInfoReq - 48, // 56: OpenIMChat.chat.chat.GetTokenForVideoMeeting:input_type -> OpenIMChat.chat.GetTokenForVideoMeetingReq - 2, // 57: OpenIMChat.chat.chat.UpdateUserInfo:output_type -> OpenIMChat.chat.UpdateUserInfoResp - 17, // 58: OpenIMChat.chat.chat.AddUserAccount:output_type -> OpenIMChat.chat.AddUserAccountResp - 6, // 59: OpenIMChat.chat.chat.SearchUserPublicInfo:output_type -> OpenIMChat.chat.SearchUserPublicInfoResp - 4, // 60: OpenIMChat.chat.chat.FindUserPublicInfo:output_type -> OpenIMChat.chat.FindUserPublicInfoResp - 36, // 61: OpenIMChat.chat.chat.SearchUserFullInfo:output_type -> OpenIMChat.chat.SearchUserFullInfoResp - 8, // 62: OpenIMChat.chat.chat.FindUserFullInfo:output_type -> OpenIMChat.chat.FindUserFullInfoResp - 10, // 63: OpenIMChat.chat.chat.SendVerifyCode:output_type -> OpenIMChat.chat.SendVerifyCodeResp - 12, // 64: OpenIMChat.chat.chat.VerifyCode:output_type -> OpenIMChat.chat.VerifyCodeResp - 15, // 65: OpenIMChat.chat.chat.RegisterUser:output_type -> OpenIMChat.chat.RegisterUserResp - 19, // 66: OpenIMChat.chat.chat.Login:output_type -> OpenIMChat.chat.LoginResp - 21, // 67: OpenIMChat.chat.chat.ResetPassword:output_type -> OpenIMChat.chat.ResetPasswordResp - 23, // 68: OpenIMChat.chat.chat.ChangePassword:output_type -> OpenIMChat.chat.ChangePasswordResp - 25, // 69: OpenIMChat.chat.chat.FindUserAccount:output_type -> OpenIMChat.chat.FindUserAccountResp - 27, // 70: OpenIMChat.chat.chat.FindAccountUser:output_type -> OpenIMChat.chat.FindAccountUserResp - 30, // 71: OpenIMChat.chat.chat.AddSignalRecord:output_type -> OpenIMChat.chat.AddSignalRecordResp - 32, // 72: OpenIMChat.chat.chat.GetSignalRecords:output_type -> OpenIMChat.chat.GetSignalRecordsResp - 34, // 73: OpenIMChat.chat.chat.OpenIMCallback:output_type -> OpenIMChat.chat.OpenIMCallbackResp - 38, // 74: OpenIMChat.chat.chat.UserLoginCount:output_type -> OpenIMChat.chat.UserLoginCountResp - 41, // 75: OpenIMChat.chat.chat.UploadLogs:output_type -> OpenIMChat.chat.UploadLogsResp - 43, // 76: OpenIMChat.chat.chat.DeleteLogs:output_type -> OpenIMChat.chat.DeleteLogsResp - 45, // 77: OpenIMChat.chat.chat.SearchLogs:output_type -> OpenIMChat.chat.SearchLogsResp - 47, // 78: OpenIMChat.chat.chat.SearchUserInfo:output_type -> OpenIMChat.chat.SearchUserInfoResp - 49, // 79: OpenIMChat.chat.chat.GetTokenForVideoMeeting:output_type -> OpenIMChat.chat.GetTokenForVideoMeetingResp - 57, // [57:80] is the sub-list for method output_type - 34, // [34:57] is the sub-list for method input_type - 34, // [34:34] is the sub-list for extension type_name - 34, // [34:34] is the sub-list for extension extendee - 0, // [0:34] is the sub-list for field type_name -} - -func init() { file_chat_chat_proto_init() } -func file_chat_chat_proto_init() { - if File_chat_chat_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_chat_chat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIdentity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserInfoReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserInfoResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserPublicInfoReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserPublicInfoResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchUserPublicInfoReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchUserPublicInfoResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserFullInfoReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserFullInfoResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendVerifyCodeReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendVerifyCodeResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_chat_chat_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifyCodeReq); i { + file_chat_chat_proto_rawDescOnce sync.Once + file_chat_chat_proto_rawDescData = file_chat_chat_proto_rawDesc +) + +func file_chat_chat_proto_rawDescGZIP() []byte { + file_chat_chat_proto_rawDescOnce.Do(func() { + file_chat_chat_proto_rawDescData = protoimpl.X.CompressGZIP(file_chat_chat_proto_rawDescData) + }) + return file_chat_chat_proto_rawDescData +} + +var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_chat_chat_proto_goTypes = []interface{}{ + (*UserIdentity)(nil), // 0: openim.chat.UserIdentity + (*UpdateUserInfoReq)(nil), // 1: openim.chat.UpdateUserInfoReq + (*UpdateUserInfoResp)(nil), // 2: openim.chat.UpdateUserInfoResp + (*FindUserPublicInfoReq)(nil), // 3: openim.chat.FindUserPublicInfoReq + (*FindUserPublicInfoResp)(nil), // 4: openim.chat.FindUserPublicInfoResp + (*SearchUserPublicInfoReq)(nil), // 5: openim.chat.SearchUserPublicInfoReq + (*SearchUserPublicInfoResp)(nil), // 6: openim.chat.SearchUserPublicInfoResp + (*FindUserFullInfoReq)(nil), // 7: openim.chat.FindUserFullInfoReq + (*FindUserFullInfoResp)(nil), // 8: openim.chat.FindUserFullInfoResp + (*SendVerifyCodeReq)(nil), // 9: openim.chat.SendVerifyCodeReq + (*SendVerifyCodeResp)(nil), // 10: openim.chat.SendVerifyCodeResp + (*VerifyCodeReq)(nil), // 11: openim.chat.VerifyCodeReq + (*VerifyCodeResp)(nil), // 12: openim.chat.VerifyCodeResp + (*RegisterUserInfo)(nil), // 13: openim.chat.RegisterUserInfo + (*RegisterUserReq)(nil), // 14: openim.chat.RegisterUserReq + (*RegisterUserResp)(nil), // 15: openim.chat.RegisterUserResp + (*AddUserAccountReq)(nil), // 16: openim.chat.AddUserAccountReq + (*AddUserAccountResp)(nil), // 17: openim.chat.AddUserAccountResp + (*LoginReq)(nil), // 18: openim.chat.LoginReq + (*ResetPasswordReq)(nil), // 19: openim.chat.ResetPasswordReq + (*ResetPasswordResp)(nil), // 20: openim.chat.ResetPasswordResp + (*ChangePasswordReq)(nil), // 21: openim.chat.ChangePasswordReq + (*ChangePasswordResp)(nil), // 22: openim.chat.ChangePasswordResp + (*FindUserAccountReq)(nil), // 23: openim.chat.FindUserAccountReq + (*FindUserAccountResp)(nil), // 24: openim.chat.FindUserAccountResp + (*FindAccountUserReq)(nil), // 25: openim.chat.FindAccountUserReq + (*FindAccountUserResp)(nil), // 26: openim.chat.FindAccountUserResp + (*SignalRecord)(nil), // 27: openim.chat.SignalRecord + (*OpenIMCallbackReq)(nil), // 28: openim.chat.OpenIMCallbackReq + (*OpenIMCallbackResp)(nil), // 29: openim.chat.OpenIMCallbackResp + (*SearchUserFullInfoReq)(nil), // 30: openim.chat.SearchUserFullInfoReq + (*SearchUserFullInfoResp)(nil), // 31: openim.chat.SearchUserFullInfoResp + (*UserLoginCountReq)(nil), // 32: openim.chat.UserLoginCountReq + (*UserLoginCountResp)(nil), // 33: openim.chat.UserLoginCountResp + (*LoginResp)(nil), // 34: openim.chat.LoginResp + (*SearchUserInfoReq)(nil), // 35: openim.chat.SearchUserInfoReq + (*SearchUserInfoResp)(nil), // 36: openim.chat.SearchUserInfoResp + (*GetTokenForVideoMeetingReq)(nil), // 37: openim.chat.GetTokenForVideoMeetingReq + (*GetTokenForVideoMeetingResp)(nil), // 38: openim.chat.GetTokenForVideoMeetingResp + nil, // 39: openim.chat.FindUserAccountResp.UserAccountMapEntry + nil, // 40: openim.chat.FindAccountUserResp.AccountUserMapEntry + nil, // 41: openim.chat.UserLoginCountResp.CountEntry + (*wrapperspb.StringValue)(nil), // 42: openim.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 43: openim.protobuf.Int32Value + (*wrapperspb.Int64Value)(nil), // 44: openim.protobuf.Int64Value + (*common.UserPublicInfo)(nil), // 45: openim.chat.common.UserPublicInfo + (*sdkws.RequestPagination)(nil), // 46: openim.sdkws.RequestPagination + (*common.UserFullInfo)(nil), // 47: openim.chat.common.UserFullInfo +} +var file_chat_chat_proto_depIdxs = []int32{ + 42, // 0: openim.chat.UpdateUserInfoReq.account:type_name -> openim.protobuf.StringValue + 42, // 1: openim.chat.UpdateUserInfoReq.phoneNumber:type_name -> openim.protobuf.StringValue + 42, // 2: openim.chat.UpdateUserInfoReq.areaCode:type_name -> openim.protobuf.StringValue + 42, // 3: openim.chat.UpdateUserInfoReq.email:type_name -> openim.protobuf.StringValue + 42, // 4: openim.chat.UpdateUserInfoReq.nickname:type_name -> openim.protobuf.StringValue + 42, // 5: openim.chat.UpdateUserInfoReq.faceURL:type_name -> openim.protobuf.StringValue + 43, // 6: openim.chat.UpdateUserInfoReq.gender:type_name -> openim.protobuf.Int32Value + 43, // 7: openim.chat.UpdateUserInfoReq.level:type_name -> openim.protobuf.Int32Value + 44, // 8: openim.chat.UpdateUserInfoReq.birth:type_name -> openim.protobuf.Int64Value + 43, // 9: openim.chat.UpdateUserInfoReq.allowAddFriend:type_name -> openim.protobuf.Int32Value + 43, // 10: openim.chat.UpdateUserInfoReq.allowBeep:type_name -> openim.protobuf.Int32Value + 43, // 11: openim.chat.UpdateUserInfoReq.allowVibration:type_name -> openim.protobuf.Int32Value + 43, // 12: openim.chat.UpdateUserInfoReq.globalRecvMsgOpt:type_name -> openim.protobuf.Int32Value + 43, // 13: openim.chat.UpdateUserInfoReq.RegisterType:type_name -> openim.protobuf.Int32Value + 45, // 14: openim.chat.FindUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo + 46, // 15: openim.chat.SearchUserPublicInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 45, // 16: openim.chat.SearchUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo + 47, // 17: openim.chat.FindUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 13, // 18: openim.chat.RegisterUserReq.user:type_name -> openim.chat.RegisterUserInfo + 13, // 19: openim.chat.AddUserAccountReq.user:type_name -> openim.chat.RegisterUserInfo + 39, // 20: openim.chat.FindUserAccountResp.userAccountMap:type_name -> openim.chat.FindUserAccountResp.UserAccountMapEntry + 40, // 21: openim.chat.FindAccountUserResp.accountUserMap:type_name -> openim.chat.FindAccountUserResp.AccountUserMapEntry + 45, // 22: openim.chat.SignalRecord.inviterUserList:type_name -> openim.chat.common.UserPublicInfo + 46, // 23: openim.chat.SearchUserFullInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 47, // 24: openim.chat.SearchUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 41, // 25: openim.chat.UserLoginCountResp.count:type_name -> openim.chat.UserLoginCountResp.CountEntry + 46, // 26: openim.chat.SearchUserInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 47, // 27: openim.chat.SearchUserInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 1, // 28: openim.chat.chat.UpdateUserInfo:input_type -> openim.chat.UpdateUserInfoReq + 16, // 29: openim.chat.chat.AddUserAccount:input_type -> openim.chat.AddUserAccountReq + 5, // 30: openim.chat.chat.SearchUserPublicInfo:input_type -> openim.chat.SearchUserPublicInfoReq + 3, // 31: openim.chat.chat.FindUserPublicInfo:input_type -> openim.chat.FindUserPublicInfoReq + 30, // 32: openim.chat.chat.SearchUserFullInfo:input_type -> openim.chat.SearchUserFullInfoReq + 7, // 33: openim.chat.chat.FindUserFullInfo:input_type -> openim.chat.FindUserFullInfoReq + 9, // 34: openim.chat.chat.SendVerifyCode:input_type -> openim.chat.SendVerifyCodeReq + 11, // 35: openim.chat.chat.VerifyCode:input_type -> openim.chat.VerifyCodeReq + 14, // 36: openim.chat.chat.RegisterUser:input_type -> openim.chat.RegisterUserReq + 18, // 37: openim.chat.chat.Login:input_type -> openim.chat.LoginReq + 19, // 38: openim.chat.chat.ResetPassword:input_type -> openim.chat.ResetPasswordReq + 21, // 39: openim.chat.chat.ChangePassword:input_type -> openim.chat.ChangePasswordReq + 23, // 40: openim.chat.chat.FindUserAccount:input_type -> openim.chat.FindUserAccountReq + 25, // 41: openim.chat.chat.FindAccountUser:input_type -> openim.chat.FindAccountUserReq + 28, // 42: openim.chat.chat.OpenIMCallback:input_type -> openim.chat.OpenIMCallbackReq + 32, // 43: openim.chat.chat.UserLoginCount:input_type -> openim.chat.UserLoginCountReq + 35, // 44: openim.chat.chat.SearchUserInfo:input_type -> openim.chat.SearchUserInfoReq + 37, // 45: openim.chat.chat.GetTokenForVideoMeeting:input_type -> openim.chat.GetTokenForVideoMeetingReq + 2, // 46: openim.chat.chat.UpdateUserInfo:output_type -> openim.chat.UpdateUserInfoResp + 17, // 47: openim.chat.chat.AddUserAccount:output_type -> openim.chat.AddUserAccountResp + 6, // 48: openim.chat.chat.SearchUserPublicInfo:output_type -> openim.chat.SearchUserPublicInfoResp + 4, // 49: openim.chat.chat.FindUserPublicInfo:output_type -> openim.chat.FindUserPublicInfoResp + 31, // 50: openim.chat.chat.SearchUserFullInfo:output_type -> openim.chat.SearchUserFullInfoResp + 8, // 51: openim.chat.chat.FindUserFullInfo:output_type -> openim.chat.FindUserFullInfoResp + 10, // 52: openim.chat.chat.SendVerifyCode:output_type -> openim.chat.SendVerifyCodeResp + 12, // 53: openim.chat.chat.VerifyCode:output_type -> openim.chat.VerifyCodeResp + 15, // 54: openim.chat.chat.RegisterUser:output_type -> openim.chat.RegisterUserResp + 34, // 55: openim.chat.chat.Login:output_type -> openim.chat.LoginResp + 20, // 56: openim.chat.chat.ResetPassword:output_type -> openim.chat.ResetPasswordResp + 22, // 57: openim.chat.chat.ChangePassword:output_type -> openim.chat.ChangePasswordResp + 24, // 58: openim.chat.chat.FindUserAccount:output_type -> openim.chat.FindUserAccountResp + 26, // 59: openim.chat.chat.FindAccountUser:output_type -> openim.chat.FindAccountUserResp + 29, // 60: openim.chat.chat.OpenIMCallback:output_type -> openim.chat.OpenIMCallbackResp + 33, // 61: openim.chat.chat.UserLoginCount:output_type -> openim.chat.UserLoginCountResp + 36, // 62: openim.chat.chat.SearchUserInfo:output_type -> openim.chat.SearchUserInfoResp + 38, // 63: openim.chat.chat.GetTokenForVideoMeeting:output_type -> openim.chat.GetTokenForVideoMeetingResp + 46, // [46:64] is the sub-list for method output_type + 28, // [28:46] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_chat_chat_proto_init() } +func file_chat_chat_proto_init() { + if File_chat_chat_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_chat_chat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserIdentity); i { case 0: return &v.state case 1: @@ -4079,8 +3190,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifyCodeResp); i { + file_chat_chat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoReq); i { case 0: return &v.state case 1: @@ -4091,8 +3202,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterUserInfo); i { + file_chat_chat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoResp); i { case 0: return &v.state case 1: @@ -4103,8 +3214,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterUserReq); i { + file_chat_chat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserPublicInfoReq); i { case 0: return &v.state case 1: @@ -4115,8 +3226,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterUserResp); i { + file_chat_chat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserPublicInfoResp); i { case 0: return &v.state case 1: @@ -4127,8 +3238,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddUserAccountReq); i { + file_chat_chat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchUserPublicInfoReq); i { case 0: return &v.state case 1: @@ -4139,8 +3250,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddUserAccountResp); i { + file_chat_chat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchUserPublicInfoResp); i { case 0: return &v.state case 1: @@ -4151,8 +3262,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginReq); i { + file_chat_chat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserFullInfoReq); i { case 0: return &v.state case 1: @@ -4163,8 +3274,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginResp); i { + file_chat_chat_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserFullInfoResp); i { case 0: return &v.state case 1: @@ -4175,8 +3286,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetPasswordReq); i { + file_chat_chat_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendVerifyCodeReq); i { case 0: return &v.state case 1: @@ -4187,8 +3298,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetPasswordResp); i { + file_chat_chat_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendVerifyCodeResp); i { case 0: return &v.state case 1: @@ -4199,8 +3310,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePasswordReq); i { + file_chat_chat_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyCodeReq); i { case 0: return &v.state case 1: @@ -4211,8 +3322,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePasswordResp); i { + file_chat_chat_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyCodeResp); i { case 0: return &v.state case 1: @@ -4223,8 +3334,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserAccountReq); i { + file_chat_chat_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterUserInfo); i { case 0: return &v.state case 1: @@ -4235,8 +3346,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindUserAccountResp); i { + file_chat_chat_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterUserReq); i { case 0: return &v.state case 1: @@ -4247,8 +3358,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAccountUserReq); i { + file_chat_chat_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterUserResp); i { case 0: return &v.state case 1: @@ -4259,8 +3370,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAccountUserResp); i { + file_chat_chat_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUserAccountReq); i { case 0: return &v.state case 1: @@ -4271,8 +3382,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalRecord); i { + file_chat_chat_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUserAccountResp); i { case 0: return &v.state case 1: @@ -4283,8 +3394,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSignalRecordReq); i { + file_chat_chat_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginReq); i { case 0: return &v.state case 1: @@ -4295,8 +3406,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSignalRecordResp); i { + file_chat_chat_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetPasswordReq); i { case 0: return &v.state case 1: @@ -4307,8 +3418,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSignalRecordsReq); i { + file_chat_chat_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetPasswordResp); i { case 0: return &v.state case 1: @@ -4319,8 +3430,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSignalRecordsResp); i { + file_chat_chat_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangePasswordReq); i { case 0: return &v.state case 1: @@ -4331,8 +3442,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OpenIMCallbackReq); i { + file_chat_chat_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangePasswordResp); i { case 0: return &v.state case 1: @@ -4343,8 +3454,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OpenIMCallbackResp); i { + file_chat_chat_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserAccountReq); i { case 0: return &v.state case 1: @@ -4355,8 +3466,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchUserFullInfoReq); i { + file_chat_chat_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindUserAccountResp); i { case 0: return &v.state case 1: @@ -4367,8 +3478,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchUserFullInfoResp); i { + file_chat_chat_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAccountUserReq); i { case 0: return &v.state case 1: @@ -4379,8 +3490,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLoginCountReq); i { + file_chat_chat_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAccountUserResp); i { case 0: return &v.state case 1: @@ -4391,8 +3502,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLoginCountResp); i { + file_chat_chat_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalRecord); i { case 0: return &v.state case 1: @@ -4403,8 +3514,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileURL); i { + file_chat_chat_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenIMCallbackReq); i { case 0: return &v.state case 1: @@ -4415,8 +3526,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadLogsReq); i { + file_chat_chat_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenIMCallbackResp); i { case 0: return &v.state case 1: @@ -4427,8 +3538,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadLogsResp); i { + file_chat_chat_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchUserFullInfoReq); i { case 0: return &v.state case 1: @@ -4439,8 +3550,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteLogsReq); i { + file_chat_chat_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchUserFullInfoResp); i { case 0: return &v.state case 1: @@ -4451,8 +3562,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteLogsResp); i { + file_chat_chat_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserLoginCountReq); i { case 0: return &v.state case 1: @@ -4463,8 +3574,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchLogsReq); i { + file_chat_chat_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserLoginCountResp); i { case 0: return &v.state case 1: @@ -4475,8 +3586,8 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchLogsResp); i { + file_chat_chat_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginResp); i { case 0: return &v.state case 1: @@ -4487,7 +3598,7 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_chat_chat_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchUserInfoReq); i { case 0: return &v.state @@ -4499,7 +3610,7 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_chat_chat_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchUserInfoResp); i { case 0: return &v.state @@ -4511,7 +3622,7 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_chat_chat_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetTokenForVideoMeetingReq); i { case 0: return &v.state @@ -4523,7 +3634,7 @@ func file_chat_chat_proto_init() { return nil } } - file_chat_chat_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_chat_chat_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetTokenForVideoMeetingResp); i { case 0: return &v.state @@ -4542,7 +3653,7 @@ func file_chat_chat_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_chat_chat_proto_rawDesc, NumEnums: 0, - NumMessages: 53, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, @@ -4585,15 +3696,9 @@ type ChatClient interface { ChangePassword(ctx context.Context, in *ChangePasswordReq, opts ...grpc.CallOption) (*ChangePasswordResp, error) FindUserAccount(ctx context.Context, in *FindUserAccountReq, opts ...grpc.CallOption) (*FindUserAccountResp, error) FindAccountUser(ctx context.Context, in *FindAccountUserReq, opts ...grpc.CallOption) (*FindAccountUserResp, error) - AddSignalRecord(ctx context.Context, in *AddSignalRecordReq, opts ...grpc.CallOption) (*AddSignalRecordResp, error) - GetSignalRecords(ctx context.Context, in *GetSignalRecordsReq, opts ...grpc.CallOption) (*GetSignalRecordsResp, error) OpenIMCallback(ctx context.Context, in *OpenIMCallbackReq, opts ...grpc.CallOption) (*OpenIMCallbackResp, error) // Statistics UserLoginCount(ctx context.Context, in *UserLoginCountReq, opts ...grpc.CallOption) (*UserLoginCountResp, error) - // Logs - UploadLogs(ctx context.Context, in *UploadLogsReq, opts ...grpc.CallOption) (*UploadLogsResp, error) - DeleteLogs(ctx context.Context, in *DeleteLogsReq, opts ...grpc.CallOption) (*DeleteLogsResp, error) - SearchLogs(ctx context.Context, in *SearchLogsReq, opts ...grpc.CallOption) (*SearchLogsResp, error) SearchUserInfo(ctx context.Context, in *SearchUserInfoReq, opts ...grpc.CallOption) (*SearchUserInfoResp, error) // Audio/video call and video meeting GetTokenForVideoMeeting(ctx context.Context, in *GetTokenForVideoMeetingReq, opts ...grpc.CallOption) (*GetTokenForVideoMeetingResp, error) @@ -4609,7 +3714,7 @@ func NewChatClient(cc grpc.ClientConnInterface) ChatClient { func (c *chatClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { out := new(UpdateUserInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/UpdateUserInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/UpdateUserInfo", in, out, opts...) if err != nil { return nil, err } @@ -4618,7 +3723,7 @@ func (c *chatClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, func (c *chatClient) AddUserAccount(ctx context.Context, in *AddUserAccountReq, opts ...grpc.CallOption) (*AddUserAccountResp, error) { out := new(AddUserAccountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/AddUserAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/AddUserAccount", in, out, opts...) if err != nil { return nil, err } @@ -4627,7 +3732,7 @@ func (c *chatClient) AddUserAccount(ctx context.Context, in *AddUserAccountReq, func (c *chatClient) SearchUserPublicInfo(ctx context.Context, in *SearchUserPublicInfoReq, opts ...grpc.CallOption) (*SearchUserPublicInfoResp, error) { out := new(SearchUserPublicInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/SearchUserPublicInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/SearchUserPublicInfo", in, out, opts...) if err != nil { return nil, err } @@ -4636,7 +3741,7 @@ func (c *chatClient) SearchUserPublicInfo(ctx context.Context, in *SearchUserPub func (c *chatClient) FindUserPublicInfo(ctx context.Context, in *FindUserPublicInfoReq, opts ...grpc.CallOption) (*FindUserPublicInfoResp, error) { out := new(FindUserPublicInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/FindUserPublicInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/FindUserPublicInfo", in, out, opts...) if err != nil { return nil, err } @@ -4645,7 +3750,7 @@ func (c *chatClient) FindUserPublicInfo(ctx context.Context, in *FindUserPublicI func (c *chatClient) SearchUserFullInfo(ctx context.Context, in *SearchUserFullInfoReq, opts ...grpc.CallOption) (*SearchUserFullInfoResp, error) { out := new(SearchUserFullInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/SearchUserFullInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/SearchUserFullInfo", in, out, opts...) if err != nil { return nil, err } @@ -4654,7 +3759,7 @@ func (c *chatClient) SearchUserFullInfo(ctx context.Context, in *SearchUserFullI func (c *chatClient) FindUserFullInfo(ctx context.Context, in *FindUserFullInfoReq, opts ...grpc.CallOption) (*FindUserFullInfoResp, error) { out := new(FindUserFullInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/FindUserFullInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/FindUserFullInfo", in, out, opts...) if err != nil { return nil, err } @@ -4663,7 +3768,7 @@ func (c *chatClient) FindUserFullInfo(ctx context.Context, in *FindUserFullInfoR func (c *chatClient) SendVerifyCode(ctx context.Context, in *SendVerifyCodeReq, opts ...grpc.CallOption) (*SendVerifyCodeResp, error) { out := new(SendVerifyCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/SendVerifyCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/SendVerifyCode", in, out, opts...) if err != nil { return nil, err } @@ -4672,7 +3777,7 @@ func (c *chatClient) SendVerifyCode(ctx context.Context, in *SendVerifyCodeReq, func (c *chatClient) VerifyCode(ctx context.Context, in *VerifyCodeReq, opts ...grpc.CallOption) (*VerifyCodeResp, error) { out := new(VerifyCodeResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/VerifyCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/VerifyCode", in, out, opts...) if err != nil { return nil, err } @@ -4681,7 +3786,7 @@ func (c *chatClient) VerifyCode(ctx context.Context, in *VerifyCodeReq, opts ... func (c *chatClient) RegisterUser(ctx context.Context, in *RegisterUserReq, opts ...grpc.CallOption) (*RegisterUserResp, error) { out := new(RegisterUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/RegisterUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/RegisterUser", in, out, opts...) if err != nil { return nil, err } @@ -4690,7 +3795,7 @@ func (c *chatClient) RegisterUser(ctx context.Context, in *RegisterUserReq, opts func (c *chatClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) { out := new(LoginResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/Login", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/Login", in, out, opts...) if err != nil { return nil, err } @@ -4699,7 +3804,7 @@ func (c *chatClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallO func (c *chatClient) ResetPassword(ctx context.Context, in *ResetPasswordReq, opts ...grpc.CallOption) (*ResetPasswordResp, error) { out := new(ResetPasswordResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/ResetPassword", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/ResetPassword", in, out, opts...) if err != nil { return nil, err } @@ -4708,7 +3813,7 @@ func (c *chatClient) ResetPassword(ctx context.Context, in *ResetPasswordReq, op func (c *chatClient) ChangePassword(ctx context.Context, in *ChangePasswordReq, opts ...grpc.CallOption) (*ChangePasswordResp, error) { out := new(ChangePasswordResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/ChangePassword", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/ChangePassword", in, out, opts...) if err != nil { return nil, err } @@ -4717,7 +3822,7 @@ func (c *chatClient) ChangePassword(ctx context.Context, in *ChangePasswordReq, func (c *chatClient) FindUserAccount(ctx context.Context, in *FindUserAccountReq, opts ...grpc.CallOption) (*FindUserAccountResp, error) { out := new(FindUserAccountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/FindUserAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/FindUserAccount", in, out, opts...) if err != nil { return nil, err } @@ -4726,25 +3831,7 @@ func (c *chatClient) FindUserAccount(ctx context.Context, in *FindUserAccountReq func (c *chatClient) FindAccountUser(ctx context.Context, in *FindAccountUserReq, opts ...grpc.CallOption) (*FindAccountUserResp, error) { out := new(FindAccountUserResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/FindAccountUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) AddSignalRecord(ctx context.Context, in *AddSignalRecordReq, opts ...grpc.CallOption) (*AddSignalRecordResp, error) { - out := new(AddSignalRecordResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/AddSignalRecord", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) GetSignalRecords(ctx context.Context, in *GetSignalRecordsReq, opts ...grpc.CallOption) (*GetSignalRecordsResp, error) { - out := new(GetSignalRecordsResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/GetSignalRecords", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/FindAccountUser", in, out, opts...) if err != nil { return nil, err } @@ -4753,7 +3840,7 @@ func (c *chatClient) GetSignalRecords(ctx context.Context, in *GetSignalRecordsR func (c *chatClient) OpenIMCallback(ctx context.Context, in *OpenIMCallbackReq, opts ...grpc.CallOption) (*OpenIMCallbackResp, error) { out := new(OpenIMCallbackResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/OpenIMCallback", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/OpenIMCallback", in, out, opts...) if err != nil { return nil, err } @@ -4762,34 +3849,7 @@ func (c *chatClient) OpenIMCallback(ctx context.Context, in *OpenIMCallbackReq, func (c *chatClient) UserLoginCount(ctx context.Context, in *UserLoginCountReq, opts ...grpc.CallOption) (*UserLoginCountResp, error) { out := new(UserLoginCountResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/UserLoginCount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) UploadLogs(ctx context.Context, in *UploadLogsReq, opts ...grpc.CallOption) (*UploadLogsResp, error) { - out := new(UploadLogsResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/UploadLogs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) DeleteLogs(ctx context.Context, in *DeleteLogsReq, opts ...grpc.CallOption) (*DeleteLogsResp, error) { - out := new(DeleteLogsResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/DeleteLogs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) SearchLogs(ctx context.Context, in *SearchLogsReq, opts ...grpc.CallOption) (*SearchLogsResp, error) { - out := new(SearchLogsResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/SearchLogs", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/UserLoginCount", in, out, opts...) if err != nil { return nil, err } @@ -4798,7 +3858,7 @@ func (c *chatClient) SearchLogs(ctx context.Context, in *SearchLogsReq, opts ... func (c *chatClient) SearchUserInfo(ctx context.Context, in *SearchUserInfoReq, opts ...grpc.CallOption) (*SearchUserInfoResp, error) { out := new(SearchUserInfoResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/SearchUserInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/SearchUserInfo", in, out, opts...) if err != nil { return nil, err } @@ -4807,7 +3867,7 @@ func (c *chatClient) SearchUserInfo(ctx context.Context, in *SearchUserInfoReq, func (c *chatClient) GetTokenForVideoMeeting(ctx context.Context, in *GetTokenForVideoMeetingReq, opts ...grpc.CallOption) (*GetTokenForVideoMeetingResp, error) { out := new(GetTokenForVideoMeetingResp) - err := c.cc.Invoke(ctx, "/OpenIMChat.chat.chat/GetTokenForVideoMeeting", in, out, opts...) + err := c.cc.Invoke(ctx, "/openim.chat.chat/GetTokenForVideoMeeting", in, out, opts...) if err != nil { return nil, err } @@ -4833,15 +3893,9 @@ type ChatServer interface { ChangePassword(context.Context, *ChangePasswordReq) (*ChangePasswordResp, error) FindUserAccount(context.Context, *FindUserAccountReq) (*FindUserAccountResp, error) FindAccountUser(context.Context, *FindAccountUserReq) (*FindAccountUserResp, error) - AddSignalRecord(context.Context, *AddSignalRecordReq) (*AddSignalRecordResp, error) - GetSignalRecords(context.Context, *GetSignalRecordsReq) (*GetSignalRecordsResp, error) OpenIMCallback(context.Context, *OpenIMCallbackReq) (*OpenIMCallbackResp, error) // Statistics UserLoginCount(context.Context, *UserLoginCountReq) (*UserLoginCountResp, error) - // Logs - UploadLogs(context.Context, *UploadLogsReq) (*UploadLogsResp, error) - DeleteLogs(context.Context, *DeleteLogsReq) (*DeleteLogsResp, error) - SearchLogs(context.Context, *SearchLogsReq) (*SearchLogsResp, error) SearchUserInfo(context.Context, *SearchUserInfoReq) (*SearchUserInfoResp, error) // Audio/video call and video meeting GetTokenForVideoMeeting(context.Context, *GetTokenForVideoMeetingReq) (*GetTokenForVideoMeetingResp, error) @@ -4893,27 +3947,12 @@ func (*UnimplementedChatServer) FindUserAccount(context.Context, *FindUserAccoun func (*UnimplementedChatServer) FindAccountUser(context.Context, *FindAccountUserReq) (*FindAccountUserResp, error) { return nil, status.Errorf(codes.Unimplemented, "method FindAccountUser not implemented") } -func (*UnimplementedChatServer) AddSignalRecord(context.Context, *AddSignalRecordReq) (*AddSignalRecordResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddSignalRecord not implemented") -} -func (*UnimplementedChatServer) GetSignalRecords(context.Context, *GetSignalRecordsReq) (*GetSignalRecordsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSignalRecords not implemented") -} func (*UnimplementedChatServer) OpenIMCallback(context.Context, *OpenIMCallbackReq) (*OpenIMCallbackResp, error) { return nil, status.Errorf(codes.Unimplemented, "method OpenIMCallback not implemented") } func (*UnimplementedChatServer) UserLoginCount(context.Context, *UserLoginCountReq) (*UserLoginCountResp, error) { return nil, status.Errorf(codes.Unimplemented, "method UserLoginCount not implemented") } -func (*UnimplementedChatServer) UploadLogs(context.Context, *UploadLogsReq) (*UploadLogsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UploadLogs not implemented") -} -func (*UnimplementedChatServer) DeleteLogs(context.Context, *DeleteLogsReq) (*DeleteLogsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteLogs not implemented") -} -func (*UnimplementedChatServer) SearchLogs(context.Context, *SearchLogsReq) (*SearchLogsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SearchLogs not implemented") -} func (*UnimplementedChatServer) SearchUserInfo(context.Context, *SearchUserInfoReq) (*SearchUserInfoResp, error) { return nil, status.Errorf(codes.Unimplemented, "method SearchUserInfo not implemented") } @@ -4935,7 +3974,7 @@ func _Chat_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/UpdateUserInfo", + FullMethod: "/openim.chat.chat/UpdateUserInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) @@ -4953,7 +3992,7 @@ func _Chat_AddUserAccount_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/AddUserAccount", + FullMethod: "/openim.chat.chat/AddUserAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).AddUserAccount(ctx, req.(*AddUserAccountReq)) @@ -4971,7 +4010,7 @@ func _Chat_SearchUserPublicInfo_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/SearchUserPublicInfo", + FullMethod: "/openim.chat.chat/SearchUserPublicInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).SearchUserPublicInfo(ctx, req.(*SearchUserPublicInfoReq)) @@ -4989,7 +4028,7 @@ func _Chat_FindUserPublicInfo_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/FindUserPublicInfo", + FullMethod: "/openim.chat.chat/FindUserPublicInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).FindUserPublicInfo(ctx, req.(*FindUserPublicInfoReq)) @@ -5007,7 +4046,7 @@ func _Chat_SearchUserFullInfo_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/SearchUserFullInfo", + FullMethod: "/openim.chat.chat/SearchUserFullInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).SearchUserFullInfo(ctx, req.(*SearchUserFullInfoReq)) @@ -5025,7 +4064,7 @@ func _Chat_FindUserFullInfo_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/FindUserFullInfo", + FullMethod: "/openim.chat.chat/FindUserFullInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).FindUserFullInfo(ctx, req.(*FindUserFullInfoReq)) @@ -5043,7 +4082,7 @@ func _Chat_SendVerifyCode_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/SendVerifyCode", + FullMethod: "/openim.chat.chat/SendVerifyCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).SendVerifyCode(ctx, req.(*SendVerifyCodeReq)) @@ -5061,7 +4100,7 @@ func _Chat_VerifyCode_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/VerifyCode", + FullMethod: "/openim.chat.chat/VerifyCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).VerifyCode(ctx, req.(*VerifyCodeReq)) @@ -5079,7 +4118,7 @@ func _Chat_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/RegisterUser", + FullMethod: "/openim.chat.chat/RegisterUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).RegisterUser(ctx, req.(*RegisterUserReq)) @@ -5097,7 +4136,7 @@ func _Chat_Login_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/Login", + FullMethod: "/openim.chat.chat/Login", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).Login(ctx, req.(*LoginReq)) @@ -5115,7 +4154,7 @@ func _Chat_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/ResetPassword", + FullMethod: "/openim.chat.chat/ResetPassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).ResetPassword(ctx, req.(*ResetPasswordReq)) @@ -5133,7 +4172,7 @@ func _Chat_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/ChangePassword", + FullMethod: "/openim.chat.chat/ChangePassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).ChangePassword(ctx, req.(*ChangePasswordReq)) @@ -5151,7 +4190,7 @@ func _Chat_FindUserAccount_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/FindUserAccount", + FullMethod: "/openim.chat.chat/FindUserAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).FindUserAccount(ctx, req.(*FindUserAccountReq)) @@ -5169,7 +4208,7 @@ func _Chat_FindAccountUser_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/FindAccountUser", + FullMethod: "/openim.chat.chat/FindAccountUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).FindAccountUser(ctx, req.(*FindAccountUserReq)) @@ -5177,42 +4216,6 @@ func _Chat_FindAccountUser_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Chat_AddSignalRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddSignalRecordReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).AddSignalRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/OpenIMChat.chat.chat/AddSignalRecord", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).AddSignalRecord(ctx, req.(*AddSignalRecordReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Chat_GetSignalRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSignalRecordsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).GetSignalRecords(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/OpenIMChat.chat.chat/GetSignalRecords", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).GetSignalRecords(ctx, req.(*GetSignalRecordsReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Chat_OpenIMCallback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(OpenIMCallbackReq) if err := dec(in); err != nil { @@ -5223,7 +4226,7 @@ func _Chat_OpenIMCallback_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/OpenIMCallback", + FullMethod: "/openim.chat.chat/OpenIMCallback", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).OpenIMCallback(ctx, req.(*OpenIMCallbackReq)) @@ -5241,7 +4244,7 @@ func _Chat_UserLoginCount_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/UserLoginCount", + FullMethod: "/openim.chat.chat/UserLoginCount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).UserLoginCount(ctx, req.(*UserLoginCountReq)) @@ -5249,60 +4252,6 @@ func _Chat_UserLoginCount_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Chat_UploadLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadLogsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).UploadLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/OpenIMChat.chat.chat/UploadLogs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).UploadLogs(ctx, req.(*UploadLogsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Chat_DeleteLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteLogsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).DeleteLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/OpenIMChat.chat.chat/DeleteLogs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).DeleteLogs(ctx, req.(*DeleteLogsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Chat_SearchLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchLogsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).SearchLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/OpenIMChat.chat.chat/SearchLogs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).SearchLogs(ctx, req.(*SearchLogsReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Chat_SearchUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SearchUserInfoReq) if err := dec(in); err != nil { @@ -5313,7 +4262,7 @@ func _Chat_SearchUserInfo_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/SearchUserInfo", + FullMethod: "/openim.chat.chat/SearchUserInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).SearchUserInfo(ctx, req.(*SearchUserInfoReq)) @@ -5331,7 +4280,7 @@ func _Chat_GetTokenForVideoMeeting_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/OpenIMChat.chat.chat/GetTokenForVideoMeeting", + FullMethod: "/openim.chat.chat/GetTokenForVideoMeeting", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChatServer).GetTokenForVideoMeeting(ctx, req.(*GetTokenForVideoMeetingReq)) @@ -5340,7 +4289,7 @@ func _Chat_GetTokenForVideoMeeting_Handler(srv interface{}, ctx context.Context, } var _Chat_serviceDesc = grpc.ServiceDesc{ - ServiceName: "OpenIMChat.chat.chat", + ServiceName: "openim.chat.chat", HandlerType: (*ChatServer)(nil), Methods: []grpc.MethodDesc{ { @@ -5399,14 +4348,6 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "FindAccountUser", Handler: _Chat_FindAccountUser_Handler, }, - { - MethodName: "AddSignalRecord", - Handler: _Chat_AddSignalRecord_Handler, - }, - { - MethodName: "GetSignalRecords", - Handler: _Chat_GetSignalRecords_Handler, - }, { MethodName: "OpenIMCallback", Handler: _Chat_OpenIMCallback_Handler, @@ -5415,18 +4356,6 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "UserLoginCount", Handler: _Chat_UserLoginCount_Handler, }, - { - MethodName: "UploadLogs", - Handler: _Chat_UploadLogs_Handler, - }, - { - MethodName: "DeleteLogs", - Handler: _Chat_DeleteLogs_Handler, - }, - { - MethodName: "SearchLogs", - Handler: _Chat_SearchLogs_Handler, - }, { MethodName: "SearchUserInfo", Handler: _Chat_SearchUserInfo_Handler, diff --git a/pkg/proto/chat/chat.proto b/pkg/protocol/chat/chat.proto similarity index 67% rename from pkg/proto/chat/chat.proto rename to pkg/protocol/chat/chat.proto index 6f840a127..a11c2cd42 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/protocol/chat/chat.proto @@ -13,11 +13,11 @@ // limitations under the License. syntax = "proto3"; -package OpenIMChat.chat; -import "pub/wrapperspb.proto"; -import "pub/sdkws.proto"; +package openim.chat; +import "wrapperspb/wrapperspb.proto"; +import "sdkws/sdkws.proto"; import "common/common.proto"; -option go_package = "github.com/OpenIMSDK/chat/pkg/proto/chat"; +option go_package = "github.com/openimsdk/chat/pkg/protocol/chat"; message UserIdentity { string email = 1; @@ -31,20 +31,20 @@ message UserIdentity { message UpdateUserInfoReq{ string userID = 1; - OpenIMServer.protobuf.StringValue account = 2; - OpenIMServer.protobuf.StringValue phoneNumber = 3; - OpenIMServer.protobuf.StringValue areaCode = 4; - OpenIMServer.protobuf.StringValue email = 5; - OpenIMServer.protobuf.StringValue nickname = 6; - OpenIMServer.protobuf.StringValue faceURL = 7; - OpenIMServer.protobuf.Int32Value gender = 8; - OpenIMServer.protobuf.Int32Value level = 9; - OpenIMServer.protobuf.Int64Value birth = 10; - OpenIMServer.protobuf.Int32Value allowAddFriend = 11; - OpenIMServer.protobuf.Int32Value allowBeep = 12; - OpenIMServer.protobuf.Int32Value allowVibration = 13; - OpenIMServer.protobuf.Int32Value globalRecvMsgOpt = 14; - OpenIMServer.protobuf.Int32Value RegisterType = 15; + openim.protobuf.StringValue account = 2; + openim.protobuf.StringValue phoneNumber = 3; + openim.protobuf.StringValue areaCode = 4; + openim.protobuf.StringValue email = 5; + openim.protobuf.StringValue nickname = 6; + openim.protobuf.StringValue faceURL = 7; + openim.protobuf.Int32Value gender = 8; + openim.protobuf.Int32Value level = 9; + openim.protobuf.Int64Value birth = 10; + openim.protobuf.Int32Value allowAddFriend = 11; + openim.protobuf.Int32Value allowBeep = 12; + openim.protobuf.Int32Value allowVibration = 13; + openim.protobuf.Int32Value globalRecvMsgOpt = 14; + openim.protobuf.Int32Value RegisterType = 15; } message UpdateUserInfoResp{ @@ -57,18 +57,18 @@ message FindUserPublicInfoReq{ } message FindUserPublicInfoResp{ - repeated OpenIMChat.common.UserPublicInfo users = 1; + repeated openim.chat.common.UserPublicInfo users = 1; } message SearchUserPublicInfoReq{ string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; int32 genders = 3; } message SearchUserPublicInfoResp{ uint32 total = 1; - repeated OpenIMChat.common.UserPublicInfo users = 2; + repeated openim.chat.common.UserPublicInfo users = 2; } message FindUserFullInfoReq{ @@ -76,7 +76,7 @@ message FindUserFullInfoReq{ } message FindUserFullInfoResp{ - repeated OpenIMChat.common.UserFullInfo users = 1; + repeated openim.chat.common.UserFullInfo users = 1; } message SendVerifyCodeReq { @@ -87,7 +87,7 @@ message SendVerifyCodeReq { int32 platform = 5; string areaCode = 6; string phoneNumber = 7; - string email= 8; + string email = 8; } message SendVerifyCodeResp { @@ -133,10 +133,10 @@ message RegisterUserResp { } message AddUserAccountReq{ - string ip=1; - string deviceID=2; - int32 platform=3; - RegisterUserInfo user=4; + string ip = 1; + string deviceID = 2; + int32 platform = 3; + RegisterUserInfo user = 4; } message AddUserAccountResp{ @@ -154,11 +154,6 @@ message LoginReq { string email = 9; } -message LoginResp { - string chatToken = 2; - string userID = 3; -} - message ResetPasswordReq { string areaCode = 1; string phoneNumber = 2; @@ -206,35 +201,13 @@ message SignalRecord { string recvNickname = 7; string groupID = 8; string groupName = 9; - repeated OpenIMChat.common.UserPublicInfo inviterUserList = 10; + repeated openim.chat.common.UserPublicInfo inviterUserList = 10; int32 duration = 11; int64 createTime = 12; string size = 13; string downloadURL = 14; } -message AddSignalRecordReq { - SignalRecord signalRecord = 1; - string operationID = 2; -} - -message AddSignalRecordResp { -} - -message GetSignalRecordsReq { - OpenIMServer.sdkws.RequestPagination pagination = 1; - string senderID = 2; - string recvID = 3; - string mediaType = 4; - int64 createTime = 5; - string operationID = 6; -} - -message GetSignalRecordsResp { - uint32 totalNumber = 1; - repeated SignalRecord signalRecords = 2; -} - message OpenIMCallbackReq { string command = 1; string body = 2; @@ -246,14 +219,14 @@ message OpenIMCallbackResp { message SearchUserFullInfoReq{ string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; int32 genders = 3; int32 normal = 4; } message SearchUserFullInfoResp{ uint32 total = 1; - repeated OpenIMChat.common.UserFullInfo users = 2; + repeated openim.chat.common.UserFullInfo users = 2; } message UserLoginCountReq{ @@ -264,53 +237,24 @@ message UserLoginCountReq{ message UserLoginCountResp{ int64 loginCount = 1; int64 unloginCount = 2; - mapCount = 3; -} - -message fileURL{ - string filename = 1; - string URL = 2; -} -message UploadLogsReq{ - int32 platform = 1; - repeated fileURL fileURLs = 2; - string systemType = 3; - string version = 5; - string ex = 4; -} - -message UploadLogsResp{ -} - -message DeleteLogsReq{ - repeated string logIDs = 1; -} - -message DeleteLogsResp{ + map count = 3; } -message SearchLogsReq{ - string keyword = 1; - int64 startTime = 2; - int64 endTime = 3; - OpenIMServer.sdkws.RequestPagination pagination = 4; -} - -message SearchLogsResp{ - repeated OpenIMChat.common.LogInfo LogsInfos = 1; - uint32 total = 2; +message LoginResp { + string chatToken = 2; + string userID = 3; } message SearchUserInfoReq{ string keyword = 1; - OpenIMServer.sdkws.RequestPagination pagination = 2; + openim.sdkws.RequestPagination pagination = 2; repeated int32 genders = 3; repeated string userIDs = 4; } message SearchUserInfoResp { uint32 total = 1; - repeated OpenIMChat.common.UserFullInfo users = 2; + repeated openim.chat.common.UserFullInfo users = 2; } message GetTokenForVideoMeetingReq { @@ -344,17 +288,10 @@ service chat { rpc FindUserAccount(FindUserAccountReq) returns(FindUserAccountResp); rpc FindAccountUser(FindAccountUserReq) returns(FindAccountUserResp); - rpc AddSignalRecord(AddSignalRecordReq) returns(AddSignalRecordResp); - rpc GetSignalRecords(GetSignalRecordsReq) returns(GetSignalRecordsResp); - rpc OpenIMCallback(OpenIMCallbackReq) returns(OpenIMCallbackResp); // Statistics rpc UserLoginCount(UserLoginCountReq) returns (UserLoginCountResp); - // Logs - rpc UploadLogs(UploadLogsReq) returns (UploadLogsResp); - rpc DeleteLogs(DeleteLogsReq) returns (DeleteLogsResp); - rpc SearchLogs(SearchLogsReq) returns (SearchLogsResp); rpc SearchUserInfo(SearchUserInfoReq)returns(SearchUserInfoResp); diff --git a/pkg/proto/common/common.pb.go b/pkg/protocol/common/common.pb.go similarity index 67% rename from pkg/proto/common/common.pb.go rename to pkg/protocol/common/common.pb.go index e3ee90cdf..250498086 100644 --- a/pkg/proto/common/common.pb.go +++ b/pkg/protocol/common/common.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.1 -// protoc v4.22.0 +// protoc-gen-go v1.33.0 +// protoc v5.26.0 // source: common/common.proto package common @@ -633,98 +633,98 @@ var File_common_common_proto protoreflect.FileDescriptor var file_common_common_proto_rawDesc = []byte{ 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x68, 0x61, - 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xe8, 0x03, 0x0a, 0x0c, 0x55, 0x73, 0x65, - 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xe8, 0x03, 0x0a, 0x0c, 0x55, 0x73, + 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, + 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, + 0x55, 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, + 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, + 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x12, 0x26, 0x0a, 0x0e, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, + 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, + 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, + 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, + 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, + 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x0a, 0x41, + 0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, + 0x70, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x87, 0x02, + 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, - 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, - 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, - 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x14, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, - 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, - 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x67, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x12, - 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, - 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, - 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, - 0x65, 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, - 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x0a, 0x41, 0x70, - 0x70, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x87, 0x02, 0x0a, - 0x07, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x10, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, - 0x67, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x44, - 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x63, - 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x6f, 0x67, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, + 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, + 0x63, 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -741,11 +741,11 @@ func file_common_common_proto_rawDescGZIP() []byte { var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_common_common_proto_goTypes = []interface{}{ - (*UserFullInfo)(nil), // 0: OpenIMChat.common.UserFullInfo - (*UserPublicInfo)(nil), // 1: OpenIMChat.common.UserPublicInfo - (*UserIdentity)(nil), // 2: OpenIMChat.common.UserIdentity - (*AppletInfo)(nil), // 3: OpenIMChat.common.AppletInfo - (*LogInfo)(nil), // 4: OpenIMChat.common.LogInfo + (*UserFullInfo)(nil), // 0: openim.chat.common.UserFullInfo + (*UserPublicInfo)(nil), // 1: openim.chat.common.UserPublicInfo + (*UserIdentity)(nil), // 2: openim.chat.common.UserIdentity + (*AppletInfo)(nil), // 3: openim.chat.common.AppletInfo + (*LogInfo)(nil), // 4: openim.chat.common.LogInfo } var file_common_common_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/pkg/proto/common/common.proto b/pkg/protocol/common/common.proto similarity index 95% rename from pkg/proto/common/common.proto rename to pkg/protocol/common/common.proto index 59f2cfb11..3a08e4557 100644 --- a/pkg/proto/common/common.proto +++ b/pkg/protocol/common/common.proto @@ -13,8 +13,8 @@ // limitations under the License. syntax = "proto3"; -package OpenIMChat.common; -option go_package = "github.com/OpenIMSDK/chat/pkg/proto/common"; +package openim.chat.common; +option go_package = "github.com/openimsdk/chat/pkg/protocol/common"; message UserFullInfo{ diff --git a/pkg/protocol/gen.cmd b/pkg/protocol/gen.cmd new file mode 100644 index 000000000..ac7ae372e --- /dev/null +++ b/pkg/protocol/gen.cmd @@ -0,0 +1,12 @@ +@echo off +setlocal + +rem Define array elements +set "PROTO_NAMES=admin chat common" + +rem Loop through each element in the array +for %%i in (%PROTO_NAMES%) do ( + protoc --go_out=plugins=grpc:./%%i --go_opt=module=github.com/openimsdk/chat/pkg/protocol/%%i %%i/%%i.proto +) + +endlocal diff --git a/scripts/function.sh b/pkg/protocol/gen.sh similarity index 59% rename from scripts/function.sh rename to pkg/protocol/gen.sh index 2ddbf3191..ff49af2f6 100755 --- a/scripts/function.sh +++ b/pkg/protocol/gen.sh @@ -1,6 +1,3 @@ -#!/usr/bin/env bash - - # Copyright © 2023 OpenIM open source community. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,20 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -#input:[10023,2323,3434] -#output:10023 2323 3434 -list_to_string(){ - ports_list=$* - sub_s1=`echo $ports_list | sed 's/ //g'` - sub_s2=${sub_s1//,/ } - sub_s3=${sub_s2#*[} - sub_s4=${sub_s3%]*} - ports_array=$sub_s4 -} - -remove_space(){ - value=$* - result=`echo $value | sed 's/ //g'` -} +PROTO_NAMES=( + "admin" + "chat" + "common" +) +for name in "${PROTO_NAMES[@]}"; do + protoc --go_out=plugins=grpc:./${name} --go_opt=module=github.com/openimsdk/chat/pkg/protocol/${name} ${name}/${name}.proto +done +if [ "$(uname -s)" == "Darwin" ]; then + find . -type f -name '*.pb.go' -exec sed -i '' 's/,omitempty"`/\"\`/g' {} + +else + find . -type f -name '*.pb.go' -exec sed -i 's/,omitempty"`/\"\`/g' {} + +fi \ No newline at end of file diff --git a/pkg/proto/pub/sdkws.proto b/pkg/protocol/sdkws/sdkws.proto similarity index 90% rename from pkg/proto/pub/sdkws.proto rename to pkg/protocol/sdkws/sdkws.proto index d0a0578b4..8032ed836 100644 --- a/pkg/proto/pub/sdkws.proto +++ b/pkg/protocol/sdkws/sdkws.proto @@ -13,9 +13,9 @@ // limitations under the License. syntax = "proto3"; -package OpenIMServer.sdkws; -import "pub/wrapperspb.proto"; -option go_package = "github.com/OpenIMSDK/protocol/sdkws"; +package openim.sdkws; +import "wrapperspb/wrapperspb.proto"; +option go_package = "github.com/openimsdk/protocol/sdkws"; ////////////////////////////////base/////////////////////////////// @@ -45,10 +45,10 @@ message GroupInfoForSet{ string notification = 3; string introduction = 4; string faceURL = 5; - string ex = 6; - OpenIMServer.protobuf.Int32Value needVerification = 7; - OpenIMServer.protobuf.Int32Value lookMemberInfo = 8; - OpenIMServer.protobuf.Int32Value applyMemberFriend = 9; + openim.protobuf.StringValue ex = 6; + openim.protobuf.Int32Value needVerification = 7; + openim.protobuf.Int32Value lookMemberInfo = 8; + openim.protobuf.Int32Value applyMemberFriend = 9; } @@ -84,6 +84,14 @@ message UserInfo{ int32 globalRecvMsgOpt = 7; } +message UserInfoWithEx{ + string userID = 1; + openim.protobuf.StringValue nickname = 2; + openim.protobuf.StringValue faceURL = 3; + openim.protobuf.StringValue ex = 4; + openim.protobuf.Int32Value globalRecvMsgOpt = 7; +} + message FriendInfo{ string ownerUserID = 1; string remark = 2; @@ -92,6 +100,7 @@ message FriendInfo{ int32 addSource = 5; string operatorUserID = 6; string ex = 7; + bool isPinned = 8; } message BlackInfo{ @@ -215,14 +224,6 @@ message OfflinePushInfo{ string signalInfo = 6; } - - - - - - - - message TipsComm{ bytes detail = 1; string defaultTips = 2; @@ -420,11 +421,31 @@ message BlackDeletedTips{ message FriendInfoChangedTips{ FromToUserID fromToUserID = 1; //from:changed; to:friend } + //////////////////////user///////////////////// message UserInfoUpdatedTips{ string userID = 1; } +message UserStatusChangeTips { + string fromUserID = 1; + string toUserID = 2; + int32 status = 3; + int32 platformID = 4; +} +message UserCommandAddTips { + string fromUserID = 1; + string toUserID = 2; +} +message UserCommandUpdateTips { + string fromUserID = 1; + string toUserID = 2; +} +message UserCommandDeleteTips { + string fromUserID = 1; + string toUserID = 2; +} + //////////////////////conversation///////////////////// message ConversationUpdateTips{ string userID = 1; @@ -468,6 +489,7 @@ message RevokeMsgTips{ int32 sesstionType = 5; int64 seq = 6; string conversationID = 7; + bool isAdminRevoke = 8; } @@ -511,9 +533,19 @@ message SetAppBackgroundStatusReq { message SetAppBackgroundStatusResp { } - +message ProcessUserCommand{ + string userID = 1; + int32 type = 2; + int64 createTime = 3; + string uuid = 4; + string value = 5; +} message RequestPagination { int32 pageNumber = 1; int32 showNumber = 2; -} \ No newline at end of file +} +message FriendsInfoUpdateTips{ + FromToUserID fromToUserID = 1; + repeated string friendIDs = 2; +} diff --git a/pkg/proto/pub/wrapperspb.proto b/pkg/protocol/wrapperspb/wrapperspb.proto similarity index 95% rename from pkg/proto/pub/wrapperspb.proto rename to pkg/protocol/wrapperspb/wrapperspb.proto index ff366eb75..32f970197 100644 --- a/pkg/proto/pub/wrapperspb.proto +++ b/pkg/protocol/wrapperspb/wrapperspb.proto @@ -14,9 +14,9 @@ syntax = "proto3"; -package OpenIMServer.protobuf; +package openim.protobuf; -option go_package = "github.com/OpenIMSDK/protocol/wrapperspb"; +option go_package = "github.com/openimsdk/protocol/wrapperspb"; // Wrapper message for `double`. // diff --git a/pkg/rpclient/chat/admin.go b/pkg/rpclient/chat/admin.go index 724e79c43..03f20be28 100644 --- a/pkg/rpclient/chat/admin.go +++ b/pkg/rpclient/chat/admin.go @@ -16,25 +16,14 @@ package chat import ( "context" - "fmt" - "os" - - "github.com/OpenIMSDK/tools/discoveryregistry" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/mctx" - "github.com/OpenIMSDK/chat/pkg/eerrs" - "github.com/OpenIMSDK/chat/pkg/proto/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/admin" ) -func NewAdminClient(discov discoveryregistry.SvcDiscoveryRegistry) *AdminClient { - conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAdminName) - if err != nil { - fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) - } +func NewAdminClient(client admin.AdminClient) *AdminClient { return &AdminClient{ - client: admin.NewAdminClient(conn), + client: client, } } diff --git a/pkg/rpclient/chat/chat.go b/pkg/rpclient/chat/chat.go index e318c54fc..4fc87e1df 100644 --- a/pkg/rpclient/chat/chat.go +++ b/pkg/rpclient/chat/chat.go @@ -16,26 +16,15 @@ package chat import ( "context" - "fmt" - "os" - - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/utils" - - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/proto/chat" - "github.com/OpenIMSDK/chat/pkg/proto/common" + "github.com/openimsdk/chat/pkg/protocol/chat" + "github.com/openimsdk/chat/pkg/protocol/common" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/datautil" ) -func NewChatClient(discov discoveryregistry.SvcDiscoveryRegistry) *ChatClient { - conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImChatName) - if err != nil { - fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) - } +func NewChatClient(client chat.ChatClient) *ChatClient { return &ChatClient{ - client: chat.NewChatClient(conn), + client: client, } } @@ -59,7 +48,7 @@ func (o *ChatClient) MapUserPublicInfo(ctx context.Context, userIDs []string) (m if err != nil { return nil, err } - return utils.SliceToMap(users, func(user *common.UserPublicInfo) string { + return datautil.SliceToMap(users, func(user *common.UserPublicInfo) string { return user.UserID }), nil } @@ -93,7 +82,7 @@ func (o *ChatClient) GetUserFullInfo(ctx context.Context, userID string) (*commo return nil, err } if len(users) == 0 { - return nil, errs.ErrUserIDNotFound.Wrap() + return nil, errs.ErrRecordNotFound.WrapMsg("user id not found") } return users[0], nil } @@ -104,7 +93,7 @@ func (o *ChatClient) GetUserPublicInfo(ctx context.Context, userID string) (*com return nil, err } if len(users) == 0 { - return nil, errs.ErrUserIDNotFound.Wrap() + return nil, errs.ErrRecordNotFound.WrapMsg("user id not found", "userID", userID) } return users[0], nil } diff --git a/pkg/sms/ali.go b/pkg/sms/ali.go index de8eea79e..c02b885d0 100644 --- a/pkg/sms/ali.go +++ b/pkg/sms/ali.go @@ -18,29 +18,33 @@ import ( "context" "encoding/json" - "github.com/OpenIMSDK/tools/errs" aliconf "github.com/alibabacloud-go/darabonba-openapi/client" dysmsapi "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" "github.com/alibabacloud-go/tea/tea" - - "github.com/OpenIMSDK/chat/pkg/common/config" + "github.com/openimsdk/tools/errs" ) -func newAli() (SMS, error) { +func NewAli(endpoint, accessKeyId, accessKeySecret, signName, verificationCodeTemplateCode string) (SMS, error) { conf := &aliconf.Config{ - Endpoint: tea.String(config.Config.VerifyCode.Ali.Endpoint), - AccessKeyId: tea.String(config.Config.VerifyCode.Ali.AccessKeyId), - AccessKeySecret: tea.String(config.Config.VerifyCode.Ali.AccessKeySecret), + Endpoint: tea.String(endpoint), + AccessKeyId: tea.String(accessKeyId), + AccessKeySecret: tea.String(accessKeySecret), } client, err := dysmsapi.NewClient(conf) if err != nil { return nil, err } - return &ali{client: client}, nil + return &ali{ + signName: signName, + verificationCodeTemplateCode: verificationCodeTemplateCode, + client: client, + }, nil } type ali struct { - client *dysmsapi.Client + signName string + verificationCodeTemplateCode string + client *dysmsapi.Client } func (a *ali) Name() string { @@ -56,8 +60,8 @@ func (a *ali) SendCode(ctx context.Context, areaCode string, phoneNumber string, } req := &dysmsapi.SendSmsRequest{ PhoneNumbers: tea.String(areaCode + phoneNumber), - SignName: tea.String(config.Config.VerifyCode.Ali.SignName), - TemplateCode: tea.String(config.Config.VerifyCode.Ali.VerificationCodeTemplateCode), + SignName: tea.String(a.signName), + TemplateCode: tea.String(a.verificationCodeTemplateCode), TemplateParam: tea.String(string(data)), } _, err = a.client.SendSms(req) diff --git a/pkg/sms/sms.go b/pkg/sms/sms.go index 8966822d9..a3c95b2b7 100644 --- a/pkg/sms/sms.go +++ b/pkg/sms/sms.go @@ -1,49 +1,8 @@ -// Copyright © 2023 OpenIM open source community. 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 sms -import ( - "context" - "fmt" - "strings" - - "github.com/OpenIMSDK/chat/pkg/common/config" -) - -func New() (SMS, error) { - switch strings.ToLower(config.Config.VerifyCode.Use) { - case "": - return empty{}, nil - case "ali": - return newAli() - default: - return nil, fmt.Errorf("not support sms: `%s`", config.Config.VerifyCode.Use) - } -} +import "context" type SMS interface { Name() string SendCode(ctx context.Context, areaCode string, phoneNumber string, verifyCode string) error } - -type empty struct{} - -func (e empty) Name() string { - return "empty-sms" -} - -func (e empty) SendCode(ctx context.Context, areaCode string, phoneNumber string, verifyCode string) error { - return nil -} diff --git a/scripts/LICENSE/LICENSE b/scripts/LICENSE/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/scripts/LICENSE/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/scripts/LICENSE/LICENSE_TEMPLATES b/scripts/LICENSE/LICENSE_TEMPLATES deleted file mode 100644 index dbc5ce2c8..000000000 --- a/scripts/LICENSE/LICENSE_TEMPLATES +++ /dev/null @@ -1,13 +0,0 @@ -Copyright © {{.Year}} {{.Holder}} 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. diff --git a/scripts/build-all-service.sh b/scripts/build-all-service.sh deleted file mode 100755 index 894f381b5..000000000 --- a/scripts/build-all-service.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env bash - - -# 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. - -set -e -set -o pipefail - -#Include shell font styles and some basic information -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. - -#Include shell font styles and some basic information -source $SCRIPTS_ROOT/style-info.sh -source $SCRIPTS_ROOT/path-info.sh -source $SCRIPTS_ROOT/function.sh - -echo -e "${BACKGROUND_BLUE}===============> Building all using make build binary files ${COLOR_SUFFIX}" - -echo -e "" - -bin_dir="$BIN_DIR" -logs_dir="$OPENIM_ROOT/_output/logs" - -if [ ! -d $logs_dir ]; then - mkdir -p $logs_dir -fi - -echo "==> bin_dir=$bin_dir" -echo "==> logs_dir=$logs_dir" - -cd $SCRIPTS_ROOT/.. - -# Get the current operating system and architecture -OS=$(uname -s | tr '[:upper:]' '[:lower:]') -ARCH=$(uname -m) - -# CPU core number -if [[ "$OS" == "darwin" ]]; then - cpu_count=$(sysctl -n hw.ncpu) -elif [[ "$OS" == "linux" ]]; then - cpu_count=$(lscpu | grep -e 'CPU(s):' | awk '{print $3}') -else [[ "$OS" == "windows" ]]; - cpu_count=$(lscpu | grep -e 'CPU(s):' | awk '{print $3}') -fi - -# Count the number of concurrent compilations (half the number of cpus) -compile_count=$((cpu_count / 2)) - -# Execute 'make build' run the make command for concurrent compilation -make -j$compile_count build - -if [ $? -ne 0 ]; then - echo "make build Error, script exits" - exit 1 -fi - -# Select the repository home directory based on the operating system and architecture -if [[ "$OS" == "darwin" ]]; then - if [[ "$ARCH" == "x86_64" ]]; then - REPO_DIR="darwin/amd64" - else - REPO_DIR="darwin/386" - fi -elif [[ "$OS" == "linux" ]]; then - if [[ "$ARCH" == "x86_64" ]]; then - REPO_DIR="linux/amd64" - elif [[ "$ARCH" == "arm64" ]]; then - REPO_DIR="linux/arm64" - elif [[ "$ARCH" == "mips64" ]]; then - REPO_DIR="linux/mips64" - elif [[ "$ARCH" == "mips64le" ]]; then - REPO_DIR="linux/mips64le" - elif [[ "$ARCH" == "ppc64le" ]]; then - REPO_DIR="linux/ppc64le" - elif [[ "$ARCH" == "s390x" ]]; then - REPO_DIR="linux/s390x" - else - REPO_DIR="linux/386" - fi -elif [[ "$OS" == "windows" ]]; then - if [[ "$ARCH" == "x86_64" ]]; then - REPO_DIR="windows/amd64" - else - REPO_DIR="windows/386" - fi -else - echo -e "${RED_PREFIX}Unsupported OS: $OS${COLOR_SUFFIX}" - exit 1 -fi - -# Determine if all scripts were successfully built -BUILD_SUCCESS=true -FAILED_SCRIPTS=() - -for binary in $(find _output/bin/platforms/$REPO_DIR -type f); do - if [[ ! -x $binary ]]; then - FAILED_SCRIPTS+=("$binary") - BUILD_SUCCESS=false - fi -done - -echo -e " " - -echo -e "${BOLD_PREFIX}=====================> Build Results <=====================${COLOR_SUFFIX}" - -echo -e " " - -if [[ "$BUILD_SUCCESS" == true ]]; then - echo -e "${GREEN_PREFIX}All binaries built successfully.${COLOR_SUFFIX}" -else - echo -e "${RED_PREFIX}Some binary builds failed. Please check the following binary files:${COLOR_SUFFIX}" - for script in "${FAILED_SCRIPTS[@]}"; do - echo -e "${RED_PREFIX}$script${COLOR_SUFFIX}" - done -fi - -echo -e " " - -echo -e "${BOLD_PREFIX}============================================================${COLOR_SUFFIX}" - -echo -e " " diff --git a/scripts/build.cmd b/scripts/build.cmd deleted file mode 100644 index f100073bc..000000000 --- a/scripts/build.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -set "api_apps=admin-api chat-api" -set "rpc_apps=admin-rpc chat-rpc" - -for %%a in (%api_apps%) do ( - go build -o %%a.exe ../cmd/api/%%a/main.go -) - -for %%a in (%rpc_apps%) do ( - go build -o %%a.exe ../cmd/rpc/%%a/main.go -) - -move *exe ../cmd diff --git a/scripts/check-all.sh b/scripts/check-all.sh deleted file mode 100755 index 8a387967b..000000000 --- a/scripts/check-all.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - - -# Copyright © 2023 OpenIM open source community. 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. - -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${SCRIPTS_ROOT}")/.. -source $SCRIPTS_ROOT/util.sh - - -logs_dir="$SCRIPTS_ROOT/../_output/logs" -DOCKER_LOG_FILE="$logs_dir/chat-docker.log" -if is_running_in_container; then - exec >> ${DOCKER_LOG_FILE} 2>&1 -fi - - -DATA="$(date +%H:%M:%S)" -echo "# Start Chat check-all.sh ${DATA}, For local deployments, use ./check-all.sh --print-screen" - -# --print-screen -if [ "$1" == "--print-screen" ]; then - PRINT_SCREEN=1 -fi - -#mkdir -p ${SCRIPTS_ROOT}/../logs - -#if [ -z "$PRINT_SCREEN" ]; then -# exec >> ${SCRIPTS_ROOT}/../logs/chat_$(date '+%Y%m%d').log 2>&1 -#fi - -#Include shell font styles and some basic information -source $SCRIPTS_ROOT/style-info.sh -source $SCRIPTS_ROOT/path-info.sh -source $SCRIPTS_ROOT/function.sh -source $SCRIPTS_ROOT/util.sh - - -all_services_running=true -not_running_count=0 # Initialize a counter for not running services - -for binary_path in "${binary_full_paths[@]}"; do - result=$(check_services_with_name "$binary_path") - if [ $? -ne 0 ]; then - all_services_running=false - not_running_count=$((not_running_count + 1)) # Increment the counter - # Print the binary path in red for not running services - echo -e "\033[0;31mService not running: $binary_path\033[0m" - fi -done - - - - - -if $all_services_running; then - for binary_path in "${binary_full_paths[@]}"; do - echo -e "\033[0;32mService running: $binary_path\033[0m" - done - - # Print "Startup successful" in green - echo -e "\033[0;32mAll chat services startup successful\033[0m" -else - # Print the number of services that are not running - echo -e "\033[0;31m$not_running_count chat service(s) are not running.\033[0m" - exit 1 -fi diff --git a/scripts/docker-start-all.sh b/scripts/docker-start-all.sh deleted file mode 100755 index b06c6e566..000000000 --- a/scripts/docker-start-all.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIM open source community. 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. - -#!/usr/bin/env bash - - -# Include shell font styles and some basic information -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. - -logs_dir="$SCRIPTS_ROOT/../_output/logs" -DOCKER_LOG_FILE="$logs_dir/chat-docker.log" - - -${OPENIM_ROOT}/scripts/init-config.sh --skip - -"${OPENIM_ROOT}"/scripts/start-all.sh -tail -f ${DOCKER_LOG_FILE} diff --git a/scripts/gen.mk b/scripts/gen.mk deleted file mode 100644 index 1671fafff..000000000 --- a/scripts/gen.mk +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright © 2023 OpenIMSDK. -# -# 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. - -# ============================================================================== -# Makefile helper functions for generate necessary files and docs -# https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources -# ! The stock of code generated by `make gen` should be idempotent -# -# Questions about go mod instead of go path: https://github.com/kubernetes/kubernetes/issues/117181 -# ============================================================================== -# Makefile helper functions for generate necessary files -# - -## gen.init: Initialize openim server project ✨ -.PHONY: gen.init -gen.init: - @echo "===========> Initializing openim server project" - @${ROOT_DIR}/scripts/init-config.sh - -## gen.init-githooks: Initialize git hooks ✨ -.PHONY: gen.init-githooks -gen.init-githooks: - @echo "===========> Initializing git hooks" - @${ROOT_DIR}/scripts/init-githooks.sh - -## gen.run: Generate necessary files and docs ✨ -.PHONY: gen.run -#gen.run: gen.errcode gen.docgo -gen.run: gen.clean gen.errcode gen.docgo.doc - -## gen.errcode: Generate necessary files and docs ✨ -.PHONY: gen.errcode -gen.errcode: gen.errcode.code gen.errcode.doc - -## gen.errcode.code: Generate openim error code go source files ✨ -.PHONY: gen.errcode.code -gen.errcode.code: tools.verify.codegen - @echo "===========> Generating openim error code go source files" - @codegen -type=int ${ROOT_DIR}/internal/pkg/code - -## gen.errcode.doc: Generate openim error code markdown documentation ✨ -.PHONY: gen.errcode.doc -gen.errcode.doc: tools.verify.codegen - @echo "===========> Generating error code markdown documentation" - @codegen -type=int -doc \ - -output ${ROOT_DIR}/docs/guide/zh-CN/api/error_code_generated.md ${ROOT_DIR}/internal/pkg/code - -## gen.docgo: Generate missing doc.go for go packages ✨ -.PHONY: gen.ca.% -gen.ca.%: - $(eval CA := $(word 1,$(subst ., ,$*))) - @echo "===========> Generating CA files for $(CA)" - @${ROOT_DIR}/scripts/gencerts.sh generate-openim-cert $(OUTPUT_DIR)/cert $(CA) - -## gen.ca: Generate CA files for all certificates ✨ -.PHONY: gen.ca -gen.ca: $(addprefix gen.ca., $(CERTIFICATES)) - -## gen.docgo: Generate missing doc.go for go packages ✨ -.PHONY: gen.docgo.doc -gen.docgo.doc: - @echo "===========> Generating missing doc.go for go packages" - @${ROOT_DIR}/scripts/gendoc.sh - -## gen.docgo.check: Check if there are untracked doc.go files ✨ -.PHONY: gen.docgo.check -gen.docgo.check: gen.docgo.doc - @n="$$(git ls-files --others '*/doc.go' | wc -l)"; \ - if test "$$n" -gt 0; then \ - git ls-files --others '*/doc.go' | sed -e 's/^/ /'; \ - echo "$@: untracked doc.go file(s) exist in working directory" >&2 ; \ - false ; \ - fi - -## gen.docgo.add: Add untracked doc.go files to git index ✨ -.PHONY: gen.docgo.add -gen.docgo.add: - @git ls-files --others '*/doc.go' | $(XARGS) -- git add - -## gen.docgo: Generate missing doc.go for go packages ✨ -.PHONY: gen.defaultconfigs -gen.defaultconfigs: - @${ROOT_DIR}/scripts/gen_default_config.sh - -## gen.docgo: Generate missing doc.go for go packages ✨ -.PHONY: gen.clean -gen.clean: - @rm -rf ./api/client/{clientset,informers,listers} - @$(FIND) -type f -name '*_generated.go' -delete - -## gen.help: show help for gen -.PHONY: gen.help -gen.help: scripts/make-rules/gen.mk - $(call smallhelp) \ No newline at end of file diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg deleted file mode 100644 index 21d977f74..000000000 --- a/scripts/githooks/commit-msg +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIMSDK. -# -# 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. -# -# ============================================================================== -# -# Store this file as .git/hooks/commit-msg in your repository in order to -# enforce checking for proper commit message format before actual commits. -# You may need to make the scripts executable by 'chmod +x .git/hooks/commit-msg'. - -# commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint` -# go-gitlint --msg-file="$1" - -# An example hook scripts to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. - -YELLOW="\e[93m" -GREEN="\e[32m" -RED="\e[31m" -ENDCOLOR="\e[0m" - -printMessage() { - printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n" -} - -printSuccess() { - printf "${GREEN}OpenIM : $1${ENDCOLOR}\n" -} - -printError() { - printf "${RED}OpenIM : $1${ENDCOLOR}\n" -} - -printMessage "Running the OpenIM commit-msg hook." - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} - -# TODO: go-gitlint dir set -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. -GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint" - -$GITLINT_DIR \ - --msg-file=$1 \ - --subject-regex="^(build|chore|ci|docs|feat|feature|fix|bug|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \ - --subject-maxlen=150 \ - --subject-minlen=10 \ - --body-regex=".*" \ - --max-parents=1 - -if [ $? -ne 0 ] -then - if ! command -v $GITLINT_DIR &>/dev/null; then - printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it." - fi - printError "Please fix your commit message to match kubecub coding standards" - printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md" - exit 1 -fi - -### Add Sign-off-by line to the end of the commit message -# Get local git config -NAME=$(git config user.name) -EMAIL=$(git config user.email) - -# Check if the commit message contains a sign-off line -grep -qs "^Signed-off-by: " "$1" -SIGNED_OFF_BY_EXISTS=$? - -# Add "Signed-off-by" line if it doesn't exist -if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then - echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1" -fi \ No newline at end of file diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit deleted file mode 100644 index 9ba5256ea..000000000 --- a/scripts/githooks/pre-commit +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIMSDK. -# -# 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. -# -# ============================================================================== -# This is a pre-commit hook that ensures attempts to commit files that are -# are larger than $limit to your _local_ repo fail, with a helpful error message. - -# You can override the default limit of 2MB by supplying the environment variable: -# GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB" -# -# ============================================================================== -# - -LC_ALL=C - -local_branch="$(git rev-parse --abbrev-ref HEAD)" -valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|fix|openim|hotfix|test|bug|bot|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$" - -YELLOW="\e[93m" -GREEN="\e[32m" -RED="\e[31m" -ENDCOLOR="\e[0m" - -printMessage() { - printf "${YELLOW}openim : $1${ENDCOLOR}\n" -} - -printSuccess() { - printf "${GREEN}openim : $1${ENDCOLOR}\n" -} - -printError() { - printf "${RED}openim : $1${ENDCOLOR}\n" -} - -printMessage "Running local openim pre-commit hook." - -# flutter format . -# https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md -# TODO! GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB" -# Maximum file size limit in bytes -limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB -limitInMB=$(( $limit / 1000000 )) - -function file_too_large(){ - filename=$0 - filesize=$(( $1 / 2**20 )) - - cat < /dev/null 2>&1 -then - against=HEAD -else - against="$empty_tree" -fi - -# Set split so that for loop below can handle spaces in file names by splitting on line breaks -IFS=' -' - -shouldFail=false -for file in $( git diff-index --cached --name-only $against ); do - file_size=$(([ ! -f $file ] && echo 0) || (ls -la $file | awk '{ print $5 }')) - if [ "$file_size" -gt "$limit" ]; then - printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB" - shouldFail=true - fi -done - -if $shouldFail -then - printMessage "If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=42000000 for 42MB. Or, commit with the --no-verify switch to skip the check entirely." - printError "Commit aborted" - exit 1; -fi - -if [[ ! $local_branch =~ $valid_branch_regex ]] -then - printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. -Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again." - printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" - exit 1 -fi \ No newline at end of file diff --git a/scripts/githooks/pre-push b/scripts/githooks/pre-push deleted file mode 100644 index cce9f91d8..000000000 --- a/scripts/githooks/pre-push +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIMSDK. -# -# 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. -# -# ============================================================================== -# - -YELLOW="\e[93m" -GREEN="\e[32m" -RED="\e[31m" -ENDCOLOR="\e[0m" - -local_branch="$(git rev-parse --abbrev-ref HEAD)" -valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|fix|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$" - -printMessage() { - printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n" -} - -printSuccess() { - printf "${GREEN}OpenIM : $1${ENDCOLOR}\n" -} - -printError() { - printf "${RED}OpenIM : $1${ENDCOLOR}\n" -} - -printMessage "Running local OpenIM pre-push hook." - -if [[ `git status --porcelain` ]]; then - printError "This scripts needs to run against committed code only. Please commit or stash you changes." - exit 1 -fi - -COLOR_SUFFIX="\033[0m" - -BLACK_PREFIX="\033[30m" -RED_PREFIX="\033[31m" -GREEN_PREFIX="\033[32m" -BACKGROUND_GREEN="\033[33m" -BLUE_PREFIX="\033[34m" -PURPLE_PREFIX="\033[35m" -SKY_BLUE_PREFIX="\033[36m" -WHITE_PREFIX="\033[37m" -BOLD_PREFIX="\033[1m" -UNDERLINE_PREFIX="\033[4m" -ITALIC_PREFIX="\033[3m" - -# Function to print colored text -print_color() { - local text=$1 - local color=$2 - echo -e "${color}${text}${COLOR_SUFFIX}" -} - -# Function to print section separator -print_separator() { - print_color "==========================================================" ${PURPLE_PREFIX} -} - -# Get current time -time=$(date +"%Y-%m-%d %H:%M:%S") - -# Print section separator -print_separator - -# Print time of submission -print_color "PTIME: ${time}" "${BOLD_PREFIX}${CYAN_PREFIX}" -echo "" -author=$(git config user.name) -repository=$(basename -s .git $(git config --get remote.origin.url)) - -# Print additional information if needed -print_color "Repository: ${repository}" "${BLUE_PREFIX}" -echo "" - -print_color "Author: ${author}" "${PURPLE_PREFIX}" - -# Print section separator -print_separator - -file_list=$(git diff --name-status HEAD @{u}) -added_files=$(grep -c '^A' <<< "$file_list") -modified_files=$(grep -c '^M' <<< "$file_list") -deleted_files=$(grep -c '^D' <<< "$file_list") - -print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}" -print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}" -print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}" - -if [[ ! $local_branch =~ $valid_branch_regex ]] -then - printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. -Your commit will be rejected. You should rename your branch to a valid name(feat/name OR bug/name) and try again." - printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" - exit 1 -fi - -# -#printMessage "Running the Flutter analyzer" -#flutter analyze -# -#if [ $? -ne 0 ]; then -# printError "Flutter analyzer error" -# exit 1 -#fi -# -#printMessage "Finished running the Flutter analyzer" diff --git a/scripts/init-config.sh b/scripts/init-config.sh deleted file mode 100755 index 27062609b..000000000 --- a/scripts/init-config.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o nounset -set -o pipefail - -# Include shell font styles and some basic information -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. - -config_file="${OPENIM_ROOT}/config/config.yaml" - -# Initialize flags -FORCE=false -SKIP=false - -show_help() { - echo "Usage: init-config.sh [options]" - echo "Options:" - echo " -h, --help Show this help message" - echo " --force Overwrite existing files without prompt" - echo " --skip Skip generation if file exists" - echo " --clean-config Clean all configuration files" -} - -clean_config() { - echo "Cleaning configuration files..." - rm -f "${config_file}" - echo "Configuration files cleaned." -} - -generate_config() { - echo "Generating configuration file..." - cp "${OPENIM_ROOT}/deployments/templates/config.yaml" "${config_file}" - echo "Configuration file generated." -} - -overwrite_prompt() { - while true; do - read -p "Configuration file exists. Overwrite? [Y/N]: " yn - case $yn in - [Yy]* ) generate_config; break;; - [Nn]* ) echo "Skipping generation."; exit;; - * ) echo "Please answer yes or no.";; - esac - done -} - -# Parse command line arguments -for i in "$@" -do -case $i in - -h|--help) - show_help - exit 0 - ;; - --force) - FORCE=true - shift - ;; - --skip) - SKIP=true - shift - ;; - --clean-config) - clean_config - exit 0 - ;; - *) - # unknown option - show_help - exit 1 - ;; -esac -done - -if [[ "${FORCE}" == "true" ]]; then - generate_config -elif [[ "${SKIP}" == "true" ]] && [[ -f "${config_file}" ]]; then - echo "Configuration file already exists. Skipping generation." -else - if [[ -f "${config_file}" ]]; then - overwrite_prompt - else - generate_config - fi -fi diff --git a/scripts/init-githooks.sh b/scripts/init-githooks.sh deleted file mode 100755 index 399054bb8..000000000 --- a/scripts/init-githooks.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -# 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. -# -# ----------------------------------------------------------------------------- -# init-githooks.sh -# -# This script assists in managing Git hooks for the OpenIM project. -# When executed: -# 1. It prompts the user to enable git hooks. -# 2. If the user accepts, it copies predefined hook scripts to the appropriate -# Git directory, making them executable. -# 3. If requested, it can delete the added hooks. -# -# This script equal runs `make init-githooks` command. -# Usage: -# ./init-githooks.sh Prompt to enable git hooks. -# ./init-githooks.sh --delete Delete previously added git hooks. -# ./init-githooks.sh --help Show the help message. -# -# Example: `scripts/build-go.sh --help`. -# Documentation & related context can be found at: -# https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694 -# -# ----------------------------------------------------------------------------- - -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -HOOKS_DIR="${OPENIM_ROOT}/.git/hooks" - -help_info() { - echo "Usage: $0 [options]" - echo - echo "This script helps to manage git hooks." - echo - echo "Options:" - echo " -h, --help Show this help message and exit." - echo " -d, --delete Delete the hooks that have been added." - echo " By default, it will prompt to enable git hooks." -} - -delete_hooks() { - for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do - hook_name=$(basename "$file" .sh) # This removes the .sh extension - rm -f "$HOOKS_DIR/$hook_name" - done - echo "Git hooks have been deleted." -} - -enable_hooks() { - echo "Would you like to:" - echo "1) Enable git hooks mode" - echo "2) Delete existing git hooks" - echo "Please select a number (or any other key to exit):" - read -r choice - - case "$choice" in - 1) - for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do - hook_name=$(basename "$file" .sh) # This removes the .sh extension - cp -f "$file" "$HOOKS_DIR/$hook_name" - done - - chmod +x $HOOKS_DIR/* - - echo "Git hooks mode has been enabled." - echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically." - echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected." - ;; - 2) - delete_hooks - ;; - *) - echo "Exiting without making changes." - ;; - esac -} - - -case "$1" in - -h|--help) - help_info - ;; - -d|--delete) - delete_hooks - ;; - *) - enable_hooks - ;; -esac diff --git a/scripts/path-info.sh b/scripts/path-info.sh deleted file mode 100755 index 4f03d325c..000000000 --- a/scripts/path-info.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -# Copyright © 2023 OpenIM open source community. 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. - -#Don't put the space between "=" - -#Include shell font styles and some basic information -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. - -# Determine the architecture and version -architecture=$(uname -m) -version=$(uname -s | tr '[:upper:]' '[:lower:]') - -#Include shell font styles and some basic information -source $SCRIPTS_ROOT/style-info.sh - -cd $SCRIPTS_ROOT - -# Define the supported architectures and corresponding bin directories -declare -A supported_architectures=( - ["linux-amd64"]="_output/bin/platforms/linux/amd64" - ["linux-arm64"]="_output/bin/platforms/linux/arm64" - ["linux-mips64"]="_output/bin/platforms/linux/mips64" - ["linux-mips64le"]="_output/bin/platforms/linux/mips64le" - ["linux-ppc64le"]="_output/bin/platforms/linux/ppc64le" - ["linux-s390x"]="_output/bin/platforms/linux/s390x" - ["darwin-amd64"]="_output/bin/platforms/darwin/amd64" - ["darwin-arm64"]="_output/bin/platforms/darwin/arm64" - ["windows-amd64"]="_output/bin/platforms/windows/amd64" - ["linux-x86_64"]="_output/bin/platforms/linux/amd64" # Alias for linux-amd64 - ["darwin-x86_64"]="_output/bin/platforms/darwin/amd64" # Alias for darwin-amd64 - ["linux-aarch64"]="_output/bin/platforms/linux/arm64" # Alias for linux-arm64 -) - -# Check if the architecture and version are supported -if [[ -z ${supported_architectures["$version-$architecture"]} ]]; then - echo -e "${BLUE_PREFIX}================> Unsupported architecture: $architecture or version: $version${COLOR_SUFFIX}" - exit 1 -fi - -echo -e "${BLUE_PREFIX}================> Architecture: $architecture${COLOR_SUFFIX}" - -# Set the BIN_DIR based on the architecture and version -BIN_DIR=${SCRIPTS_ROOT}/../${supported_architectures["$version-$architecture"]} - -echo -e "${BLUE_PREFIX}================> BIN_DIR: $OPENIM_ROOT/$BIN_DIR${COLOR_SUFFIX}" - -#Global configuration file default dir -config_path="$OPENIM_ROOT/config/config.yaml" -configfile_path="$OPENIM_ROOT/config" -log_path="$OPENIM_ROOT/log" - -#servicefile dir path -service_source_root=( - #api service file - $OPENIM_ROOT/cmd/api/chat-api/ - $OPENIM_ROOT/cmd/api/admin-api/ - #rpc service file - $OPENIM_ROOT/cmd/rpc/admin-rpc/ - $OPENIM_ROOT/cmd/rpc/chat-rpc/ -) - -component_binary_full_path="${BIN_DIR}/component" - -mysql2mongo_full_path="${BIN_DIR}/mysql2mongo" - -#service filename -service_names=( - chat-api - admin-api - chat-rpc - admin-rpc -) - - - - -# Define the array to hold full paths -binary_full_paths=() - -# Loop through each service name and append its full path to the binary_full_paths array -for service_name in "${service_names[@]}"; do - binary_full_paths+=("${BIN_DIR}/${service_name}") -done - - - - diff --git a/scripts/start-all.sh b/scripts/start-all.sh deleted file mode 100755 index a2ae32a2a..000000000 --- a/scripts/start-all.sh +++ /dev/null @@ -1,279 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIM open source community. 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. - - - -#Include shell font styles and some basic information -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(dirname "${SCRIPTS_ROOT}")/.. - -source $SCRIPTS_ROOT/style-info.sh -source $SCRIPTS_ROOT/path-info.sh -source $SCRIPTS_ROOT/function.sh - -export SUPPRESS_OUTPUT=1 -source $SCRIPTS_ROOT/util.sh - -# if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then -# cd $OPENIM_ROOT -# # exec build-all-service.sh -# "${SCRIPTS_ROOT}/build-all-service.sh" -# fi - -bin_dir="$BIN_DIR" -logs_dir="$SCRIPTS_ROOT/../_output/logs" -DOCKER_LOG_FILE="$logs_dir/chat-docker.log" - -# Define the path to the configuration file -CONFIG_FILE="${OPENIM_ROOT}/config/config.yaml" - -# Automatically created when there is no bin, logs folder -if [[ ! -d "$logs_dir" ]]; then - mkdir -p "$logs_dir" -fi - -if [[ ! -f "$DOCKER_LOG_FILE" ]]; then - touch "$DOCKER_LOG_FILE" -fi - - - - -if is_running_in_container; then - exec > ${DOCKER_LOG_FILE} 2>&1 -fi - - -# Check if the configuration file exists -if [ -f "$CONFIG_FILE" ]; then - # The file exists - echo "Configuration file already exists at $CONFIG_FILE." -else - echo "" - # The file does not exist - echo "Error: Configuration file does not exist." $CONFIG_FILE - echo "+++ You need to execute 'make init' to generate the configuration file and then modify the configuration items." - echo "" - exit 1 -fi - -#service filename -service_filename=( - chat-api - admin-api - #rpc - admin-rpc - chat-rpc -) - -#service config port name -service_port_name=( -openImChatApiPort -openImAdminApiPort - openImAdminPort - openImChatPort -) - -service_prometheus_port_name=( - -) - - -#!/bin/bash - -# Reusing stop_services_with_name and check_services_with_name functions as provided - -check_and_stop_services() { - local services=("$@") - local service_stopped=0 - local attempts=0 - - # Step 1: Check and stop each service if running - for service in "${services[@]}"; do - check_services_with_name "$service" >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "Service running: $service. Attempting to stop." - stop_services_with_name "$service" - fi - done - - - # Step 2: Verify all services are stopped, retry up to 15 times if necessary - while [ $attempts -lt 15 ]; do - service_stopped=1 - - for service in "${services[@]}"; do - result=$(check_services_with_name "$service") - if [ $? -eq 0 ]; then - service_stopped=0 - break - fi - done - if [ $service_stopped -eq 1 ]; then - echo "All services have been successfully stopped." - return 0 - fi - - sleep 1 - ((attempts++)) - done - - if [ $service_stopped -eq 0 ]; then - echo "Failed to stop all services after 15 seconds." - return 1 - fi -} - - - -# Call the function with your full binary paths -check_and_stop_services "${binary_full_paths[@]}" -exit_status=$? - -# Check the exit status and proceed accordingly -if [ $exit_status -eq 0 ]; then - print_blue "Start component check for Chat services." -else - echo "Exiting due to failure in stopping services." - exit 1 -fi - - - - - - - -cd $SCRIPTS_ROOT - -rm -rf ${logs_dir}/chat_tmp_$(date '+%Y%m%d').log -LOG_FILE=${logs_dir}/chat_$(date '+%Y%m%d').log -STDERR_LOG_FILE=${logs_dir}/chat_err_$(date '+%Y%m%d').log -TMP_LOG_FILE=${logs_dir}/chat_tmp_$(date '+%Y%m%d').log -cmd="${component_binary_full_path} --config_folder_path ${config_path}" -${cmd} >> "${LOG_FILE}" 2> >(tee -a "$TMP_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) - -if [ $? -eq 0 ]; then - echo -e "\033[32mAll components checked successful\033[0m" - # Add the commands that should be executed next if the binary component was successful -else - echo -e "\033[31mComponent check failed, program exiting\033[0m" - exit 1 -fi - - - -print_blue "Starting MySQL to MongoDB data conversion" -cmd="${mysql2mongo_full_path} -c ${config_path}" -${cmd} >> "${LOG_FILE}" 2> >(tee -a "$TMP_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) -if [ $? -eq 0 ]; then - print_green "conversion successful" -else - print_red -e "Data conversion failed, program exiting" - exit 1 -fi - -print_blue "Starting Chat API and RPC services." - - -for ((i = 0; i < ${#service_filename[*]}; i++)); do - - cd $SCRIPTS_ROOT - - #Get the rpc port in the configuration file - portList=$(cat $config_path | grep ${service_port_name[$i]} | awk -F '[:]' '{print $NF}') - list_to_string ${portList} - service_ports=($ports_array) - - - #Start related rpc services based on the number of ports - for ((j = 0; j < ${#service_ports[*]}; j++)); do - if [ ! -e "$bin_dir/${service_filename[$i]}" ]; then - echo -e ${RED_PREFIX}"Error: ${service_filename[$i]} does not exist,Start fail!"${COLOR_SUFFIX} - echo "start build these binary" - "./build-all-service.sh" - fi - #Start the service in the background - cmd="$bin_dir/${service_filename[$i]} -port ${service_ports[$j]} --config_folder_path ${config_path}" - if [ $i -eq 0 -o $i -eq 1 ]; then - cmd="$bin_dir/${service_filename[$i]} -port ${service_ports[$j]} --config_folder_path ${config_path}" - fi - echo $cmd - - -nohup ${cmd} >> "${LOG_FILE}" 2> >(tee -a "$TMP_LOG_FILE" | while read line; do echo -e "\e[31m${line}\e[0m"; done >&2) >/dev/null & - -#nohup ${cmd} >>${LOG_FILE} 2> >(tee -a ${LOG_FILE} | while read line; do echo -e "\e[31m${line}\e[0m" >&2; done) >/dev/null & - done -done - -sleep 1 - - -all_services_running=true - -for binary_path in "${binary_full_paths[@]}"; do - check_services_with_name "$binary_path" - if [ $? -ne 0 ]; then - all_services_running=false - # Print the binary path in red for not running services - echo -e "\033[0;31mService not running: $binary_path\033[0m" - fi -done - -is_all_running=false -if $all_services_running; then - # Print "Startup successful" in green - is_all_running=true - print_blue "All chat services have been started, now beginning to check if the ports are listening properly." -else - # Print "all stop" and exit with status code 1 - exit 1 -fi - -all_ports_listening=true - - -ports=( - $(sed -n 's/.*openImChatApiPort: \[\(.*\)\].*/\1/p' ${config_path}) - $(sed -n 's/.*openImAdminApiPort: \[\(.*\)\].*/\1/p' ${config_path}) - $(sed -n 's/.*openImAdminPort: \[\(.*\)\].*/\1/p' ${config_path}) - $(sed -n 's/.*openImChatPort: \[\(.*\)\].*/\1/p' ${config_path}) -) - - -declare -a no_listen_ports=() - -for port in "${ports[@]}"; do - if ! check_services_with_port "$port"; then - all_ports_listening=false - no_listen_ports+=("$port") - fi -done - -if $all_ports_listening && $is_all_running; then - print_green "All chat services have started normally and the ports are listening properly" -else - if [ ${#no_listen_ports[@]} -gt 0 ]; then - echo -e "\033[31mThe following ports are not listening: ${no_listen_ports[*]}\033[0m" - fi -fi - - - - - - diff --git a/scripts/start.bat b/scripts/start.bat deleted file mode 100644 index 2c765f10d..000000000 --- a/scripts/start.bat +++ /dev/null @@ -1,5 +0,0 @@ -cd /d %~dp0../cmd -start admin-rpc.exe -start chat-rpc.exe -start chat-api.exe -start admin-api.exe \ No newline at end of file diff --git a/scripts/stop-all.sh b/scripts/stop-all.sh deleted file mode 100755 index 25b983703..000000000 --- a/scripts/stop-all.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -# Copyright © 2023 OpenIM open source community. 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. - -#fixme This scripts is to stop the service -SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -OPENIM_ROOT=$(cd $(dirname "${BASH_SOURCE[0]}")/.. &&pwd) - -source $OPENIM_ROOT/scripts/style-info.sh -source $OPENIM_ROOT/scripts/path-info.sh -source $SCRIPTS_ROOT/function.sh -source $SCRIPTS_ROOT/util.sh - - - -# Loop through each binary full path and attempt to stop the service -for binary_path in "${binary_full_paths[@]}"; do - result=$(stop_services_with_name "$binary_path") - ret_val=$? - if [ $ret_val -ne 0 ]; then - # Print detailed error log if stop_services_with_name function returns a non-zero value - echo "Error stopping service at path $binary_path" - fi -done - - -all_services_stopped=true - -for binary_path in "${binary_full_paths[@]}"; do - result=$(check_services_with_name "$binary_path") - if [ $? -eq 0 ]; then - all_services_stopped=false - # Print the binary path in red to indicate the service is still running - echo -e "\033[0;31mService still running: $binary_path\033[0m" - fi -done - -if $all_services_stopped; then - # Print "All services stopped" in green to indicate success - echo -e "\033[0;32mAll chat services stopped\033[0m" -else - # Print error message indicating not all services are stopped - echo -e "\033[0;31mError: Not all chat services have been stopped.\033[0m" -fi - - diff --git a/scripts/style-info.sh b/scripts/style-info.sh deleted file mode 100755 index 452240035..000000000 --- a/scripts/style-info.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -function style-info() { - COLOR_SUFFIX="\033[0m" # End all colors and special effects - - BLACK_PREFIX="\033[30m" # Black prefix - RED_PREFIX="\033[31m" # Red prefix - GREEN_PREFIX="\033[32m" # Green prefix - YELLOW_PREFIX="\033[33m" # Yellow prefix - BLUE_PREFIX="\033[34m" # Blue prefix - PURPLE_PREFIX="\033[35m" # Purple prefix - SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix - WHITE_PREFIX="\033[37m" # White prefix - BOLD_PREFIX="\033[1m" # Bold prefix - UNDERLINE_PREFIX="\033[4m" # Underline prefix - ITALIC_PREFIX="\033[3m" # Italic prefix - - CYAN_PREFIX="033[0;36m" # Cyan prefix - - BACKGROUND_BLACK="\033[40m" # Black background - BACKGROUND_RED="\033[41m" # Red background - BACKGROUND_GREEN="\033[42m" # Green background - BACKGROUND_YELLOW="\033[43m" # Yellow background - BACKGROUND_BLUE="\033[44m" # Blue background - BACKGROUND_PURPLE="\033[45m" # Purple background - BACKGROUND_SKY_BLUE="\033[46m" # Sky blue background - BACKGROUND_WHITE="\033[47m" # White background - - BLINK="\033[5m" # Blinking effect - INVERT="\033[7m" # Invert color - HIDE="\033[8m" # Hide text - - GRAY_PREFIX="\033[90m" # Gray prefix - LIGHT_RED_PREFIX="\033[91m" # Light red prefix - LIGHT_GREEN_PREFIX="\033[92m" # Light green prefix - LIGHT_YELLOW_PREFIX="\033[93m" # Light yellow prefix - LIGHT_BLUE_PREFIX="\033[94m" # Light blue prefix - LIGHT_PURPLE_PREFIX="\033[95m" # Light purple prefix - LIGHT_SKY_BLUE_PREFIX="\033[96m" # Light sky blue prefix - LIGHT_WHITE_PREFIX="\033[97m" # Light white prefix - - BACKGROUND_GRAY="\033[100m" # Gray background - BACKGROUND_LIGHT_RED="\033[101m" # Light red background - BACKGROUND_LIGHT_GREEN="\033[102m" # Light green background - BACKGROUND_LIGHT_YELLOW="\033[103m" # Light yellow background - BACKGROUND_LIGHT_BLUE="\033[104m" # Light blue background - BACKGROUND_LIGHT_PURPLE="\033[105m" # Light purple background - BACKGROUND_LIGHT_SKY_BLUE="\033[106m" # Light sky blue background - BACKGROUND_LIGHT_WHITE="\033[107m" # Light white background -} - -style-info \ No newline at end of file diff --git a/scripts/util.sh b/scripts/util.sh deleted file mode 100755 index 3fb0e6c48..000000000 --- a/scripts/util.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash -# 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. - -#!/bin/bash - -# Function definition -stop_services_with_name() { - # Check if an argument was provided - if [ -z "$1" ]; then - echo "Usage: stop_services_with_name " - return 1 - fi - - # Use pgrep with -f option to find process IDs by full path - # Note: macOS and most Linux distributions support these options - local pids=$(pgrep -f "$1") - - # Check if any processes were found - if [ -z "$pids" ]; then - echo "No process found with the path: $1" - return 0 - fi - - # Send the SIGTERM signal to each found process ID - for pid in $pids; do - echo "Sending SIGTERM to process ID $pid..." - kill -15 "$pid" - if [ $? -eq 0 ]; then - echo "Process $pid has been terminated." - else - echo "Failed to terminate process $pid." - return 1 - fi - done - - return 0 -} - - -#!/bin/bash - -check_services_with_name() { - local binary_path="$1" - pgrep -f "$binary_path" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - if [ -z "$SUPPRESS_OUTPUT" ]; then - echo "A process with the path $binary_path is running." - fi - return 0 - else - if [ -z "$SUPPRESS_OUTPUT" ]; then - echo "No process found with the path $binary_path." - fi - return 1 - fi -} - - -check_services_with_port() { - local port="$1" - lsof -i tcp:"$port" > /dev/null 2>&1 - - if [ $? -eq 0 ]; then - if [ -z "$SUPPRESS_OUTPUT" ]; then - echo "A service is listening on port $port." - fi - return 0 - else - if [ -z "$SUPPRESS_OUTPUT" ]; then - echo "No service is listening on port $port." - fi - return 1 - fi -} - -# Function to print text in yellow -print_blue() { - echo -e "\033[0;36m$1\033[0m" -} - -# Function to print text in green -print_green() { - echo -e "\033[0;32m$1\033[0m" -} - -# Function to print text in red -print_red() { - echo -e "\033[0;31m$1\033[0m" -} - - -# Example usage of check_services_with_name -# Replace "/full/path/to/binary" with the actual full path of the binary you want to check -# check_services_with_name "/full/path/to/binary" - - - -function is_running_in_container() { - if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then - return 0 - else - return 1 - fi -} - - diff --git a/test/common.sh b/test/common.sh deleted file mode 100644 index 5673bf3c2..000000000 --- a/test/common.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# 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. diff --git a/tools/check-component/main.go b/tools/check-component/main.go new file mode 100644 index 000000000..f0719943e --- /dev/null +++ b/tools/check-component/main.go @@ -0,0 +1,151 @@ +// 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 + +import ( + "context" + "flag" + "fmt" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/imapi" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/discovery/zookeeper" + "github.com/openimsdk/tools/mcontext" + "github.com/openimsdk/tools/system/program" + "github.com/openimsdk/tools/utils/idutil" + "path/filepath" + "time" +) + +const maxRetry = 180 + +func CheckZookeeper(ctx context.Context, config *config.ZooKeeper) error { + return zookeeper.Check(ctx, config.Address, config.Schema, zookeeper.WithUserNameAndPassword(config.Username, config.Password)) +} + +func CheckMongo(ctx context.Context, config *config.Mongo) error { + return mongoutil.Check(ctx, config.Build()) +} + +func CheckRedis(ctx context.Context, config *config.Redis) error { + return redisutil.Check(ctx, config.Build()) +} + +func CheckOpenIM(ctx context.Context, apiURL, secret, adminUserID string) error { + api2 := imapi.New(apiURL, secret, adminUserID) + _, err := api2.UserToken(mcontext.SetOperationID(ctx, "CheckOpenIM"+idutil.OperationIDGenerator()), adminUserID, constant.AdminPlatformID) + return err +} + +func initConfig(configDir string) (*config.Mongo, *config.Redis, *config.ZooKeeper, *config.Share, error) { + var ( + mongoConfig = &config.Mongo{} + redisConfig = &config.Redis{} + zookeeperConfig = &config.ZooKeeper{} + shareConfig = &config.Share{} + ) + err := config.LoadConfig(filepath.Join(configDir, cmd.MongodbConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig) + if err != nil { + return nil, nil, nil, nil, err + } + + err = config.LoadConfig(filepath.Join(configDir, cmd.RedisConfigFileName), cmd.ConfigEnvPrefixMap[cmd.RedisConfigFileName], redisConfig) + if err != nil { + return nil, nil, nil, nil, err + } + + err = config.LoadConfig(filepath.Join(configDir, cmd.ZookeeperConfigFileName), cmd.ConfigEnvPrefixMap[cmd.ZookeeperConfigFileName], zookeeperConfig) + if err != nil { + return nil, nil, nil, nil, err + } + err = config.LoadConfig(filepath.Join(configDir, cmd.ShareFileName), cmd.ConfigEnvPrefixMap[cmd.ShareFileName], shareConfig) + if err != nil { + return nil, nil, nil, nil, err + } + + return mongoConfig, redisConfig, zookeeperConfig, shareConfig, nil +} + +func main() { + var index int + var configDir string + flag.IntVar(&index, "i", 0, "Index number") + defaultConfigDir := filepath.Join("..", "..", "..", "..", "..", "config") + flag.StringVar(&configDir, "c", defaultConfigDir, "Configuration dir") + flag.Parse() + + fmt.Printf("Index: %d, Config Path: %s\n", index, configDir) + + mongoConfig, redisConfig, zookeeperConfig, shareConfig, err := initConfig(configDir) + if err != nil { + program.ExitWithError(err) + } + + ctx := context.Background() + err = performChecks(ctx, mongoConfig, redisConfig, zookeeperConfig, shareConfig, maxRetry) + if err != nil { + // Assume program.ExitWithError logs the error and exits. + // Replace with your error handling logic as necessary. + program.ExitWithError(err) + } +} + +func performChecks(ctx context.Context, mongoConfig *config.Mongo, redisConfig *config.Redis, zookeeperConfig *config.ZooKeeper, shareConfig *config.Share, maxRetry int) error { + checksDone := make(map[string]bool) + + checks := map[string]func(ctx context.Context) error{ + "Zookeeper": func(ctx context.Context) error { + return CheckZookeeper(ctx, zookeeperConfig) + }, + "Mongo": func(ctx context.Context) error { + return CheckMongo(ctx, mongoConfig) + }, + "Redis": func(ctx context.Context) error { + return CheckRedis(ctx, redisConfig) + }, + "OpenIM": func(ctx context.Context) error { + return CheckOpenIM(ctx, shareConfig.OpenIM.ApiURL, shareConfig.OpenIM.Secret, shareConfig.OpenIM.AdminUserID) + }, + } + + for i := 0; i < maxRetry; i++ { + allSuccess := true + for name, check := range checks { + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + if !checksDone[name] { + if err := check(ctx); err != nil { + fmt.Printf("%s check failed: %v\n", name, err) + allSuccess = false + } else { + fmt.Printf("%s check succeeded.\n", name) + checksDone[name] = true + } + } + cancel() + } + + if allSuccess { + fmt.Println("All components checks passed successfully.") + return nil + } + + time.Sleep(1 * time.Second) + } + + return fmt.Errorf("not all components checks passed successfully after %d attempts", maxRetry) +} diff --git a/tools/component/component.go b/tools/component/component.go deleted file mode 100644 index 8abde4e96..000000000 --- a/tools/component/component.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 - -import ( - "flag" - "fmt" - "github.com/OpenIMSDK/tools/errs" - "os" - "strings" - "time" - - "github.com/OpenIMSDK/chat/pkg/common/config" - component "github.com/OpenIMSDK/tools/component" -) - -const ( - // defaultCfgPath is the default path of the configuration file. - defaultCfgPath = "../../../../../config/config.yaml" - MaxConnectTimes = 100 -) - -var ( - cfgPath = flag.String("config_folder_path", defaultCfgPath, "Path to the configuration file") -) - -type checkFunc struct { - name string - function func() error - flag bool -} - -func main() { - flag.Parse() - if err := config.InitConfig(*cfgPath); err != nil { - fmt.Printf("Read config failed: %v\n", err) - return - } - - if config.Config.Envs.Discovery != "k8s" { - checks := []checkFunc{ - {name: "Zookeeper", function: checkZookeeper}, - {name: "Redis", function: checkRedis}, - {name: "Mongo", function: checkMongo}, - } - - for i := 0; i < MaxConnectTimes; i++ { - if i != 0 { - time.Sleep(1 * time.Second) - } - fmt.Printf("Checking components Round %v...\n", i+1) - - var err error - allSuccess := true - for index, check := range checks { - if !check.flag { - err = check.function() - if err != nil { - allSuccess = false - component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error())) - if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") && - !strings.Contains(errs.Unwrap(err).Error(), "timeout") { - os.Exit(-1) - } - } else { - checks[index].flag = true - component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name)) - } - } - } - - if allSuccess { - component.SuccessPrint("All components started successfully!") - return - } - } - } - component.ErrorPrint("Some components started failed!") - os.Exit(-1) -} - -// checkZookeeper checks the Zookeeper connection -func checkZookeeper() error { - zkStu := &component.Zookeeper{ - Schema: config.Config.Zookeeper.Schema, - ZkAddr: config.Config.Zookeeper.ZkAddr, - Username: config.Config.Zookeeper.Username, - Password: config.Config.Zookeeper.Password, - } - err := component.CheckZookeeper(zkStu) - return err -} - -// checkRedis checks the Redis connection -func checkRedis() error { - redisStu := &component.Redis{ - Address: *config.Config.Redis.Address, - Username: config.Config.Redis.Username, - Password: config.Config.Redis.Password, - } - err := component.CheckRedis(redisStu) - return err -} - -// checkMongo checks the MongoDB connection without retries -func checkMongo() error { - mongoStu := &component.Mongo{ - URL: config.Config.Mongo.Uri, - Address: config.Config.Mongo.Address, - Database: config.Config.Mongo.Database, - Username: config.Config.Mongo.Username, - Password: config.Config.Mongo.Password, - MaxPoolSize: config.Config.Mongo.MaxPoolSize, - } - err := component.CheckMongo(mongoStu) - - return err -} diff --git a/tools/mysql2mongo/internal/admin.go b/tools/mysql2mongo/internal/admin.go deleted file mode 100644 index 024c3b5c3..000000000 --- a/tools/mysql2mongo/internal/admin.go +++ /dev/null @@ -1,105 +0,0 @@ -// 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 internal - -import ( - "github.com/OpenIMSDK/chat/pkg/common/db/table/admin" - oldadmin "github.com/OpenIMSDK/chat/tools/mysql2mongo/internal/mysql/table/admin" -) - -type convertAdmin struct{} - -func (convertAdmin) Admin(v oldadmin.Admin) admin.Admin { - return admin.Admin{ - Account: v.Account, - Password: v.Password, - FaceURL: v.FaceURL, - Nickname: v.Nickname, - UserID: v.UserID, - Level: v.Level, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) Applet(v oldadmin.Applet) admin.Applet { - return admin.Applet{ - ID: v.ID, - Name: v.Name, - AppID: v.AppID, - Icon: v.Icon, - URL: v.URL, - MD5: v.MD5, - Size: v.Size, - Version: v.Version, - Priority: v.Priority, - Status: v.Status, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) ClientConfig(v oldadmin.ClientConfig) admin.ClientConfig { - return admin.ClientConfig{ - Key: v.Key, - Value: v.Value, - } -} - -func (convertAdmin) ForbiddenAccount(v oldadmin.ForbiddenAccount) admin.ForbiddenAccount { - return admin.ForbiddenAccount{ - UserID: v.UserID, - Reason: v.Reason, - OperatorUserID: v.OperatorUserID, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) InvitationRegister(v oldadmin.InvitationRegister) admin.InvitationRegister { - return admin.InvitationRegister{ - InvitationCode: v.InvitationCode, - UsedByUserID: v.UsedByUserID, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) IPForbidden(v oldadmin.IPForbidden) admin.IPForbidden { - return admin.IPForbidden{ - IP: v.IP, - LimitRegister: v.LimitRegister, - LimitLogin: v.LimitLogin, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) LimitUserLoginIP(v oldadmin.LimitUserLoginIP) admin.LimitUserLoginIP { - return admin.LimitUserLoginIP{ - UserID: v.UserID, - IP: v.IP, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) RegisterAddFriend(v oldadmin.RegisterAddFriend) admin.RegisterAddFriend { - return admin.RegisterAddFriend{ - UserID: v.UserID, - CreateTime: v.CreateTime, - } -} - -func (convertAdmin) RegisterAddGroup(v oldadmin.RegisterAddGroup) admin.RegisterAddGroup { - return admin.RegisterAddGroup{ - GroupID: v.GroupID, - CreateTime: v.CreateTime, - } -} diff --git a/tools/mysql2mongo/internal/chat.go b/tools/mysql2mongo/internal/chat.go deleted file mode 100644 index 13a43b589..000000000 --- a/tools/mysql2mongo/internal/chat.go +++ /dev/null @@ -1,90 +0,0 @@ -// 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 internal - -import ( - "github.com/OpenIMSDK/chat/pkg/common/db/table/chat" - oldchat "github.com/OpenIMSDK/chat/tools/mysql2mongo/internal/mysql/table/chat" -) - -type convertChat struct{} - -func (convertChat) Account(v oldchat.Account) chat.Account { - return chat.Account{ - UserID: v.UserID, - Password: v.Password, - CreateTime: v.CreateTime, - ChangeTime: v.ChangeTime, - OperatorUserID: v.OperatorUserID, - } -} - -func (convertChat) Attribute(v oldchat.Attribute) chat.Attribute { - return chat.Attribute{ - UserID: v.UserID, - Account: v.Account, - PhoneNumber: v.PhoneNumber, - AreaCode: v.AreaCode, - Email: v.Email, - Nickname: v.Nickname, - FaceURL: v.FaceURL, - Gender: v.Gender, - CreateTime: v.CreateTime, - ChangeTime: v.ChangeTime, - BirthTime: v.BirthTime, - Level: v.Level, - AllowVibration: v.AllowVibration, - AllowBeep: v.AllowBeep, - AllowAddFriend: v.AllowAddFriend, - GlobalRecvMsgOpt: v.GlobalRecvMsgOpt, - RegisterType: v.RegisterType, - } -} - -func (convertChat) Log(v oldchat.Log) chat.Log { - return chat.Log{ - LogID: v.LogID, - Platform: v.Platform, - UserID: v.UserID, - CreateTime: v.CreateTime, - Url: v.Url, - FileName: v.FileName, - SystemType: v.SystemType, - Version: v.Version, - Ex: v.Ex, - } -} - -func (convertChat) Register(v oldchat.Register) chat.Register { - return chat.Register{ - UserID: v.UserID, - DeviceID: v.DeviceID, - IP: v.IP, - Platform: v.Platform, - AccountType: v.AccountType, - Mode: v.Mode, - CreateTime: v.CreateTime, - } -} - -func (convertChat) UserLoginRecord(v oldchat.UserLoginRecord) chat.UserLoginRecord { - return chat.UserLoginRecord{ - UserID: v.UserID, - LoginTime: v.LoginTime, - IP: v.IP, - DeviceID: v.DeviceID, - Platform: v.Platform, - } -} diff --git a/tools/mysql2mongo/internal/main.go b/tools/mysql2mongo/internal/main.go deleted file mode 100644 index a0d952aef..000000000 --- a/tools/mysql2mongo/internal/main.go +++ /dev/null @@ -1,203 +0,0 @@ -package internal - -import ( - "context" - "errors" - "fmt" - "github.com/OpenIMSDK/chat/pkg/common/config" - "github.com/OpenIMSDK/chat/pkg/common/db/model/admin" - "github.com/OpenIMSDK/chat/pkg/common/db/model/chat" - "github.com/OpenIMSDK/chat/pkg/common/dbconn" - "github.com/go-sql-driver/mysql" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "gopkg.in/yaml.v3" - gormmysql "gorm.io/driver/mysql" - "gorm.io/gorm" - "gorm.io/gorm/logger" - "os" - "reflect" - "strconv" -) - -const ( - versionTable = "chatver" - versionKey = "data_version" - versionValue = 1 -) - -func SetMongoDataVersion(db *mongo.Database, curver string) error { - filter := bson.M{"key": versionKey, "value": curver} - update := bson.M{"$set": bson.M{"key": versionKey, "value": strconv.Itoa(versionValue)}} - _, err := db.Collection(versionTable).UpdateOne(context.Background(), filter, update, options.Update().SetUpsert(true)) - return err -} - -func InitConfig(path string) error { - data, err := os.ReadFile(path) - if err != nil { - return err - } - return yaml.Unmarshal(data, &config.Config) -} - -func GetMysql() (*gorm.DB, error) { - conf := config.Config.Mysql - mysqlDSN := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", *conf.Username, *conf.Password, (*conf.Address)[0], *conf.Database) - return gorm.Open(gormmysql.Open(mysqlDSN), &gorm.Config{Logger: logger.Discard}) -} - -func getColl(obj any) (_ *mongo.Collection, err error) { - defer func() { - if e := recover(); e != nil { - err = fmt.Errorf("not found %+v", e) - } - }() - stu := reflect.ValueOf(obj).Elem() - typ := reflect.TypeOf(&mongo.Collection{}).String() - for i := 0; i < stu.NumField(); i++ { - field := stu.Field(i) - if field.Type().String() == typ { - return (*mongo.Collection)(field.UnsafePointer()), nil - } - } - return nil, errors.New("not found model collection") -} - -// NewTask A mysql table B mongodb model C mongodb table -func NewTask[A interface{ TableName() string }, B any, C any](gormDB *gorm.DB, mongoDB *mongo.Database, mongoDBInit func(db *mongo.Database) (B, error), convert func(v A) C) error { - var zero A - tableName := zero.TableName() - obj, err := mongoDBInit(mongoDB) - if err != nil { - return fmt.Errorf("init mongo table %s failed, err: %w", tableName, err) - } - coll, err := getColl(obj) - if err != nil { - return fmt.Errorf("get mongo collection %s failed, err: %w", tableName, err) - } - var count int - defer func() { - fmt.Printf("completed convert chat %s total %d\n", tableName, count) - }() - const batch = 100 - for page := 0; ; page++ { - res := make([]A, 0, batch) - if err := gormDB.Limit(batch).Offset(page * batch).Find(&res).Error; err != nil { - if mysqlErr, ok := err.(*mysql.MySQLError); ok && mysqlErr.Number == 1146 { - return nil // table not exist - } - return fmt.Errorf("find mysql table %s failed, err: %w", tableName, err) - } - if len(res) == 0 { - return nil - } - temp := make([]any, len(res)) - for i := range res { - temp[i] = convert(res[i]) - } - if err := insertMany(coll, temp); err != nil { - return fmt.Errorf("insert mongo table %s failed, err: %w", tableName, err) - } - count += len(res) - if len(res) < batch { - return nil - } - fmt.Printf("current convert chat %s completed %d\n", tableName, count) - } -} - -func insertMany(coll *mongo.Collection, objs []any) error { - if _, err := coll.InsertMany(context.Background(), objs); err != nil { - if !mongo.IsDuplicateKeyError(err) { - return err - } - } - for i := range objs { - _, err := coll.InsertOne(context.Background(), objs[i]) - switch { - case err == nil: - case mongo.IsDuplicateKeyError(err): - default: - return err - } - } - return nil -} - -func Main(path string) error { - defer fmt.Println("mysql2mongo return") - if err := InitConfig(path); err != nil { - return err - } - if config.Config.Mysql == nil { - fmt.Println("mysql config is nil") - return nil - } - mongoDB, err := dbconn.NewMongo() - if err != nil { - return err - } - var version struct { - Key string `bson:"key"` - Value string `bson:"value"` - } - switch err := mongoDB.Collection(versionTable).FindOne(context.Background(), bson.M{"key": versionKey}).Decode(&version); err { - case nil: - if ver, _ := strconv.Atoi(version.Value); ver >= versionValue { - return nil - } - case mongo.ErrNoDocuments: - default: - return err - } - mysqlDB, err := GetMysql() - if err != nil { - if mysqlErr, ok := err.(*mysql.MySQLError); ok && mysqlErr.Number == 1049 { - if err := SetMongoDataVersion(mongoDB, version.Value); err != nil { - return err - } - fmt.Println("set chat version config") - return nil // database not exist - } - return err - } - - var ( - cc convertChat - ca convertAdmin - ) - - var tasks []func() error - tasks = append(tasks, - // chat - func() error { return NewTask(mysqlDB, mongoDB, chat.NewAccount, cc.Account) }, - func() error { return NewTask(mysqlDB, mongoDB, chat.NewAttribute, cc.Attribute) }, - func() error { return NewTask(mysqlDB, mongoDB, chat.NewLogs, cc.Log) }, - func() error { return NewTask(mysqlDB, mongoDB, chat.NewRegister, cc.Register) }, - func() error { return NewTask(mysqlDB, mongoDB, chat.NewUserLoginRecord, cc.UserLoginRecord) }, - // admin - func() error { return NewTask(mysqlDB, mongoDB, admin.NewAdmin, ca.Admin) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewApplet, ca.Applet) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewClientConfig, ca.ClientConfig) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewForbiddenAccount, ca.ForbiddenAccount) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewInvitationRegister, ca.InvitationRegister) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewIPForbidden, ca.IPForbidden) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewLimitUserLoginIP, ca.LimitUserLoginIP) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewRegisterAddFriend, ca.RegisterAddFriend) }, - func() error { return NewTask(mysqlDB, mongoDB, admin.NewRegisterAddGroup, ca.RegisterAddGroup) }, - ) - - for _, task := range tasks { - if err := task(); err != nil { - return err - } - } - - if err := SetMongoDataVersion(mongoDB, version.Value); err != nil { - return err - } - - return nil -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/admin.go b/tools/mysql2mongo/internal/mysql/table/admin/admin.go deleted file mode 100644 index 377db4cc6..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/admin.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// Admin 后台管理员. -type Admin struct { - Account string `gorm:"column:account;primary_key;type:varchar(64)"` - Password string `gorm:"column:password;type:varchar(64)"` - FaceURL string `gorm:"column:face_url;type:varchar(255)"` - Nickname string `gorm:"column:nickname;type:varchar(64)"` - UserID string `gorm:"column:user_id;type:varchar(64)"` // openIM userID - Level int32 `gorm:"column:level;default:1"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func (Admin) TableName() string { - return "admins" -} - -type AdminInterface interface { - Create(ctx context.Context, admin *Admin) error - Take(ctx context.Context, account string) (*Admin, error) - TakeUserID(ctx context.Context, userID string) (*Admin, error) - Update(ctx context.Context, account string, update map[string]any) error - ChangePassword(ctx context.Context, userID string, newPassword string) error - Delete(ctx context.Context, userIDs []string) error - Search(ctx context.Context, page, size int32) (uint32, []*Admin, error) - InitAdmin(ctx context.Context) error -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/applet.go b/tools/mysql2mongo/internal/mysql/table/admin/applet.go deleted file mode 100644 index 3bd3c0293..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/applet.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -type Applet struct { - ID string `gorm:"column:id;primary_key;size:64"` - Name string `gorm:"column:name;size:64"` - AppID string `gorm:"column:app_id;uniqueIndex;size:255"` - Icon string `gorm:"column:icon;size:255"` - URL string `gorm:"column:url;size:255"` - MD5 string `gorm:"column:md5;size:255"` - Size int64 `gorm:"column:size"` - Version string `gorm:"column:version;size:64"` - Priority uint32 `gorm:"column:priority;size:64"` - Status uint8 `gorm:"column:status"` - CreateTime time.Time `gorm:"column:create_time;autoCreateTime;size:64"` -} - -func (Applet) TableName() string { - return "applets" -} - -type AppletInterface interface { - Create(ctx context.Context, applets ...*Applet) error - Del(ctx context.Context, ids []string) error - Update(ctx context.Context, id string, data map[string]any) error - Take(ctx context.Context, id string) (*Applet, error) - Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*Applet, error) - FindOnShelf(ctx context.Context) ([]*Applet, error) - FindID(ctx context.Context, ids []string) ([]*Applet, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/client_config.go b/tools/mysql2mongo/internal/mysql/table/admin/client_config.go deleted file mode 100644 index 70a2993b1..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/client_config.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import "context" - -// ClientConfig 客户端相关配置项. -type ClientConfig struct { - Key string `gorm:"column:key;primary_key;type:varchar(255)"` - Value string `gorm:"column:value;not null;type:text"` -} - -func (ClientConfig) TableName() string { - return "client_config" -} - -type ClientConfigInterface interface { - NewTx(tx any) ClientConfigInterface - Set(ctx context.Context, config map[string]string) error - Get(ctx context.Context) (map[string]string, error) - Del(ctx context.Context, keys []string) error -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/forbidden_account.go b/tools/mysql2mongo/internal/mysql/table/admin/forbidden_account.go deleted file mode 100644 index dda7bd21e..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/forbidden_account.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// ForbiddenAccount 封号表. -type ForbiddenAccount struct { - UserID string `gorm:"column:user_id;index:userID;primary_key;type:char(64)"` - Reason string `gorm:"column:reason;type:varchar(255)" ` - OperatorUserID string `gorm:"column:operator_user_id;type:varchar(255)"` - CreateTime time.Time `gorm:"column:create_time" ` -} - -func (ForbiddenAccount) TableName() string { - return "forbidden_accounts" -} - -type ForbiddenAccountInterface interface { - Create(ctx context.Context, ms []*ForbiddenAccount) error - Take(ctx context.Context, userID string) (*ForbiddenAccount, error) - Delete(ctx context.Context, userIDs []string) error - Find(ctx context.Context, userIDs []string) ([]*ForbiddenAccount, error) - Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*ForbiddenAccount, error) - FindAllIDs(ctx context.Context) ([]string, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/invitation_register.go b/tools/mysql2mongo/internal/mysql/table/admin/invitation_register.go deleted file mode 100644 index 8ac4f6a05..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/invitation_register.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// 邀请码被注册使用. -type InvitationRegister struct { - InvitationCode string `gorm:"column:invitation_code;primary_key;type:char(32)"` - UsedByUserID string `gorm:"column:user_id;index:userID;type:char(64)"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func (InvitationRegister) TableName() string { - return "invitation_registers" -} - -type InvitationRegisterInterface interface { - NewTx(tx any) InvitationRegisterInterface - Find(ctx context.Context, codes []string) ([]*InvitationRegister, error) - Del(ctx context.Context, codes []string) error - Create(ctx context.Context, v ...*InvitationRegister) error - Take(ctx context.Context, code string) (*InvitationRegister, error) - Update(ctx context.Context, code string, data map[string]any) error - Search(ctx context.Context, keyword string, state int32, userIDs []string, codes []string, page int32, size int32) (uint32, []*InvitationRegister, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/ip_forbidden.go b/tools/mysql2mongo/internal/mysql/table/admin/ip_forbidden.go deleted file mode 100644 index 74f17eda0..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/ip_forbidden.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// 禁止ip登录 注册. -type IPForbidden struct { - IP string `gorm:"column:ip;primary_key;type:char(32)"` - LimitRegister bool `gorm:"column:limit_register"` - LimitLogin bool `gorm:"column:limit_login"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func (IPForbidden) TableName() string { - return "ip_forbiddens" -} - -type IPForbiddenInterface interface { - NewTx(tx any) IPForbiddenInterface - Take(ctx context.Context, ip string) (*IPForbidden, error) - Find(ctx context.Context, ips []string) ([]*IPForbidden, error) - Search(ctx context.Context, keyword string, state int32, page int32, size int32) (uint32, []*IPForbidden, error) - Create(ctx context.Context, ms []*IPForbidden) error - Delete(ctx context.Context, ips []string) error -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/limit_user_login_ip.go b/tools/mysql2mongo/internal/mysql/table/admin/limit_user_login_ip.go deleted file mode 100644 index 8a47a3094..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/limit_user_login_ip.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// 限制userID只能在某些ip登录. -type LimitUserLoginIP struct { - UserID string `gorm:"column:user_id;primary_key;type:char(64)"` - IP string `gorm:"column:ip;primary_key;type:char(32)"` - CreateTime time.Time `gorm:"column:create_time" ` -} - -func (LimitUserLoginIP) TableName() string { - return "limit_user_login_ips" -} - -type LimitUserLoginIPInterface interface { - Create(ctx context.Context, ms []*LimitUserLoginIP) error - Delete(ctx context.Context, ms []*LimitUserLoginIP) error - Count(ctx context.Context, userID string) (uint32, error) - Take(ctx context.Context, userID string, ip string) (*LimitUserLoginIP, error) - Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*LimitUserLoginIP, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/register_add_friend.go b/tools/mysql2mongo/internal/mysql/table/admin/register_add_friend.go deleted file mode 100644 index 9601fda84..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/register_add_friend.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// RegisterAddFriend 注册时默认好友. -type RegisterAddFriend struct { - UserID string `gorm:"column:user_id;primary_key;type:char(64)"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func (RegisterAddFriend) TableName() string { - return "register_add_friends" -} - -type RegisterAddFriendInterface interface { - Add(ctx context.Context, registerAddFriends []*RegisterAddFriend) error - Del(ctx context.Context, userIDs []string) error - FindUserID(ctx context.Context, userIDs []string) ([]string, error) - Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*RegisterAddFriend, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/admin/register_add_group.go b/tools/mysql2mongo/internal/mysql/table/admin/register_add_group.go deleted file mode 100644 index 5474929f7..000000000 --- a/tools/mysql2mongo/internal/mysql/table/admin/register_add_group.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 admin - -import ( - "context" - "time" -) - -// RegisterAddGroup 注册时默认群组. -type RegisterAddGroup struct { - GroupID string `gorm:"column:group_id;primary_key;type:char(64)"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func (RegisterAddGroup) TableName() string { - return "register_add_groups" -} - -type RegisterAddGroupInterface interface { - Add(ctx context.Context, registerAddGroups []*RegisterAddGroup) error - Del(ctx context.Context, userIDs []string) error - FindGroupID(ctx context.Context, userIDs []string) ([]string, error) - Search(ctx context.Context, keyword string, page int32, size int32) (uint32, []*RegisterAddGroup, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/account.go b/tools/mysql2mongo/internal/mysql/table/chat/account.go deleted file mode 100644 index ed633070e..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/account.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -// Account 账号密码表. -type Account struct { - UserID string `gorm:"column:user_id;primary_key;type:char(64)"` - Password string `gorm:"column:password;type:varchar(32)"` - CreateTime time.Time `gorm:"column:create_time;autoCreateTime"` - ChangeTime time.Time `gorm:"column:change_time;autoUpdateTime"` - OperatorUserID string `gorm:"column:operator_user_id;type:varchar(64)"` -} - -func (Account) TableName() string { - return "accounts" -} - -type AccountInterface interface { - NewTx(tx any) AccountInterface - Create(ctx context.Context, accounts ...*Account) error - Take(ctx context.Context, userId string) (*Account, error) - Update(ctx context.Context, userID string, data map[string]any) error - UpdatePassword(ctx context.Context, userId string, password string) error -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/attribute.go b/tools/mysql2mongo/internal/mysql/table/chat/attribute.go deleted file mode 100644 index f271043bb..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/attribute.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -// Attribute 用户属性表. -type Attribute struct { - UserID string `gorm:"column:user_id;primary_key;type:char(64)"` - Account string `gorm:"column:account;type:char(64)"` - PhoneNumber string `gorm:"column:phone_number;type:varchar(32)"` - AreaCode string `gorm:"column:area_code;type:varchar(8)"` - Email string `gorm:"column:email;type:varchar(64)" ` - Nickname string `gorm:"column:nickname;type:varchar(64)" ` - FaceURL string `gorm:"column:face_url;type:varchar(255)" ` - Gender int32 `gorm:"column:gender"` - CreateTime time.Time `gorm:"column:create_time"` - ChangeTime time.Time `gorm:"column:change_time"` - BirthTime time.Time `gorm:"column:birth_time"` - Level int32 `gorm:"column:level;default:1"` - AllowVibration int32 `gorm:"column:allow_vibration;default:1"` - AllowBeep int32 `gorm:"column:allow_beep;default:1"` - AllowAddFriend int32 `gorm:"column:allow_add_friend;default:1"` - GlobalRecvMsgOpt int32 `gorm:"column:global_recv_msg_opt;default:0"` - RegisterType int32 `gorm:"column:register_type"` -} - -func (Attribute) TableName() string { - return "attributes" -} - -type AttributeInterface interface { - NewTx(tx any) AttributeInterface - Create(ctx context.Context, attribute ...*Attribute) error - Update(ctx context.Context, userID string, data map[string]any) error - Find(ctx context.Context, userIds []string) ([]*Attribute, error) - FindAccount(ctx context.Context, accounts []string) ([]*Attribute, error) - Search(ctx context.Context, keyword string, genders []int32, page int32, size int32) (uint32, []*Attribute, error) - TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*Attribute, error) - TakeEmail(ctx context.Context, email string) (*Attribute, error) - TakeAccount(ctx context.Context, account string) (*Attribute, error) - Take(ctx context.Context, userID string) (*Attribute, error) - SearchNormalUser(ctx context.Context, keyword string, forbiddenID []string, gender int32, page int32, size int32) (uint32, []*Attribute, error) - SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pageNumber int32, showNumber int32) (uint32, []*Attribute, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/log.go b/tools/mysql2mongo/internal/mysql/table/chat/log.go deleted file mode 100644 index dc8fbef5a..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/log.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -type Log struct { - LogID string `gorm:"column:log_id;primary_key;type:char(64)"` - Platform string `gorm:"column:platform;type:varchar(32)"` - UserID string `gorm:"column:user_id;type:char(64)"` - CreateTime time.Time `gorm:"index:,sort:desc"` - Url string `gorm:"column:url;type varchar(255)"` - FileName string `gorm:"column:filename;type varchar(255)"` - SystemType string `gorm:"column:system_type;type varchar(255)"` - Version string `gorm:"column:version;type varchar(255)"` - Ex string `gorm:"column:ex;type varchar(255)"` -} - -func (Log) TableName() string { - return "logs" -} - -type LogInterface interface { - Create(ctx context.Context, log []*Log) error - Search(ctx context.Context, keyword string, start time.Time, end time.Time, pageNumber int32, showNumber int32) (uint32, []*Log, error) - Delete(ctx context.Context, logID []string, userID string) error - Get(ctx context.Context, logIDs []string, userID string) ([]*Log, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/register.go b/tools/mysql2mongo/internal/mysql/table/chat/register.go deleted file mode 100644 index 2fd6408f7..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/register.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -// Register 注册信息表. -type Register struct { - UserID string `gorm:"column:user_id;primary_key;type:char(64)"` - DeviceID string `gorm:"column:device_id;type:varchar(255)"` - IP string `gorm:"column:ip;type:varchar(64)"` - Platform string `gorm:"column:platform;type:varchar(32)"` - AccountType string `gorm:"column:account_type;type:varchar(32)"` // email phone account - Mode string `gorm:"column:mode;type:varchar(32)"` // user admin - CreateTime time.Time `gorm:"column:create_time"` -} - -func (Register) TableName() string { - return "registers" -} - -type RegisterInterface interface { - NewTx(tx any) RegisterInterface - Create(ctx context.Context, registers ...*Register) error - CountTotal(ctx context.Context, before *time.Time) (int64, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/user_login_record.go b/tools/mysql2mongo/internal/mysql/table/chat/user_login_record.go deleted file mode 100644 index aeb5f795c..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/user_login_record.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -// 用户登录信息表. -type UserLoginRecord struct { - UserID string `gorm:"column:user_id;size:64"` - LoginTime time.Time `gorm:"column:login_time"` - IP string `gorm:"column:ip;type:varchar(32)"` - DeviceID string `gorm:"column:device_id;type:varchar(255)"` - Platform string `gorm:"column:platform;type:varchar(32)"` -} - -func (UserLoginRecord) TableName() string { - return "user_login_records" -} - -type UserLoginRecordInterface interface { - NewTx(tx any) UserLoginRecordInterface - Create(ctx context.Context, records ...*UserLoginRecord) error - CountTotal(ctx context.Context, before *time.Time) (int64, error) - CountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error) -} diff --git a/tools/mysql2mongo/internal/mysql/table/chat/verify_code.go b/tools/mysql2mongo/internal/mysql/table/chat/verify_code.go deleted file mode 100644 index 995c1ebb8..000000000 --- a/tools/mysql2mongo/internal/mysql/table/chat/verify_code.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright © 2023 OpenIM open source community. 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 chat - -import ( - "context" - "time" -) - -type VerifyCode struct { - ID uint `gorm:"column:id;primary_key;autoIncrement"` - Account string `gorm:"column:account;type:char(64)"` - Platform string `gorm:"column:platform;type:varchar(32)"` - Code string `gorm:"column:verify_code;type:varchar(16)"` - Duration uint `gorm:"column:duration;type:int(11)"` - Count int `gorm:"column:count;type:int(11)"` - Used bool `gorm:"column:used"` - CreateTime time.Time `gorm:"column:create_time;autoCreateTime"` -} - -func (VerifyCode) TableName() string { - return "verify_codes" -} - -type VerifyCodeInterface interface { - NewTx(tx any) VerifyCodeInterface - Add(ctx context.Context, ms []*VerifyCode) error - RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (uint32, error) - TakeLast(ctx context.Context, account string) (*VerifyCode, error) - Incr(ctx context.Context, id uint) error - Delete(ctx context.Context, id uint) error -} diff --git a/tools/mysql2mongo/mysql2mongo.go b/tools/mysql2mongo/mysql2mongo.go deleted file mode 100644 index b840feeff..000000000 --- a/tools/mysql2mongo/mysql2mongo.go +++ /dev/null @@ -1,19 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "github.com/OpenIMSDK/chat/pkg/util" - "github.com/OpenIMSDK/chat/tools/mysql2mongo/internal" -) - -func main() { - var path string - flag.StringVar(&path, "c", "", "path config file") - flag.Parse() - if err := internal.Main(path); err != nil { - util.ExitWithError(err) - } - fmt.Println("chat mysql2mongo success!") - return -}