-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e1ef786
Showing
367 changed files
with
39,425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Refer to https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file | ||
|
||
* @trpc-ecosystem/tRPC-Go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[default] | ||
extend-ignore-identifiers-re = [ | ||
"AttributeID.*Supress.*", | ||
] | ||
|
||
[default.extend-identifiers] | ||
AttributeIDSupressMenu = "AttributeIDSupressMenu" | ||
|
||
[default.extend-words] | ||
WRONLY = "WRONLY" | ||
|
||
[files] | ||
extend-exclude = ["install/submodules/*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "CLA Assistant" | ||
on: | ||
issue_comment: | ||
types: [created] | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings | ||
permissions: | ||
actions: write | ||
contents: write | ||
pull-requests: write | ||
statuses: write | ||
|
||
jobs: | ||
CLAAssistant: | ||
runs-on: self-hosted | ||
steps: | ||
- name: "CLA Assistant" | ||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' | ||
uses: contributor-assistant/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_DATABASE_ACCESS_TOKEN }} | ||
with: | ||
remote-organization-name: trpc-group | ||
remote-repository-name: cla-database | ||
path-to-signatures: 'signatures/${{ github.event.repository.name }}-${{ github.repository_id }}/cla.json' | ||
path-to-document: 'https://github.com/trpc-group/cla-database/blob/main/Tencent-Contributor-License-Agreement.md' | ||
# branch should not be protected | ||
branch: 'main' | ||
allowlist: bot* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Pull Request Check | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
pull-requests: read # Use with `only-new-issues` option. | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# with: | ||
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
# submodules: 'recursive' | ||
- name: Checkout submodules using a PAT | ||
run: | | ||
git config --file .gitmodules --get-regexp url | while read url; do | ||
git config --file=.gitmodules $(echo "$url" | sed -E "s/[email protected]:|https:\/\/github.com\//https:\/\/${{ secrets.TRPC_PAT }}:${{ secrets.TRPC_PAT }}@github.com\//") | ||
done | ||
git submodule sync | ||
git submodule update --init --recursive | ||
- run: ls install/submodules/trpc-protocol | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
- name: Build | ||
run: go build -v ./... | ||
- name: Set env | ||
run: echo "$HOME/go/bin" >> $GITHUB_PATH | ||
- name: Install protoc | ||
run: PB_REL="https://github.com/protocolbuffers/protobuf/releases" && curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip && unzip -o protoc-3.15.8-linux-x86_64.zip -d $HOME/.local && ~/.local/bin/protoc --version | ||
- name: Install flatc | ||
run: wget https://github.com/google/flatbuffers/releases/download/v23.5.26/Linux.flatc.binary.g++-10.zip && unzip Linux.flatc.binary.g++-10.zip && mv flatc ~/go/bin/ && ~/go/bin/flatc --version | ||
- name: Install protoc-gen-go | ||
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
- name: Install goimports | ||
run: go install golang.org/x/tools/cmd/goimports@latest | ||
- name: install mockgen | ||
run: go install go.uber.org/mock/mockgen@latest | ||
- run: echo $PATH | ||
- run: export PATH=$HOME/.local/bin:$HOME/go/bin:$PATH && echo $PATH && go run ./trpc setup -f && ls -la /home/ubuntu/go/bin && file $HOME/go/bin/flatc && file $HOME/go/bin/protoc | ||
- name: Test | ||
run: export PATH=$HOME/.local/bin:$HOME/go/bin:$PATH && echo $PATH && go test -v -coverprofile=coverage.out ./... | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: coverage.out | ||
flags: unittests | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
golangci: | ||
name: lint | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
only-new-issues: true | ||
skip-cache: true | ||
typos: | ||
name: typos | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: typos | ||
uses: crate-ci/typos@master | ||
with: | ||
config: ./.github/typosconfig.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ignore tempfiles generated by IDE... | ||
.DS_Store | ||
.idea | ||
.vscode | ||
*.iml | ||
|
||
# ignore ./bin rather than install/asset_dart/bin/ | ||
/bin | ||
|
||
# ignore generated files when run go test | ||
testcase/create/generated | ||
testcase/create/generated-non-protocol-type/ | ||
docs/examples/**/bin | ||
util/pb/testcase/*.go | ||
util/pb/testcase/generated/ | ||
|
||
# ignore generated binaries when run go build | ||
/trpc/trpc | ||
/trpc/trpc.exe | ||
|
||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "install/submodules/trpc-protocol"] | ||
path = install/submodules/trpc-protocol | ||
url = [email protected]:trpc-group/trpc.git | ||
branch = main |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# Community Code of Conduct | ||
|
||
Welcome to our open source project! | ||
|
||
We are committed to creating a friendly, respectful, and inclusive community. | ||
|
||
To ensure a positive experience in our project, we have established the following code of conduct, which we require all participants to abide by, and provide a safe and inclusive environment for all community members. | ||
|
||
## Our Pledge | ||
|
||
As participants, contributors, and maintainers of our community, we pledge to: | ||
- Treat everyone with openness, inclusivity, and collaboration; | ||
- Respect individuals with different backgrounds and viewpoints, regardless of gender, sexual orientation, disability, race, ethnicity, religion, age, or any other factor; | ||
- Focus on contributing and improving the project, rather than attacking or criticizing individuals; | ||
- Build trust with community members and promote our project through constructive feedback; | ||
- Provide a safe, supportive, and encouraging environment for community members to promote learning and personal growth. | ||
|
||
## Our standards | ||
|
||
Our community members should adhere to the following standards: | ||
- Respect the opinions, viewpoints, and experiences of others; | ||
- Avoid using insulting, discriminatory, or harmful language; | ||
- Do not harass, intimidate, or threaten others; | ||
- Do not publicly or privately disclose others' private information, such as contact information or addresses; | ||
- Respect the privacy of others; | ||
- Establish a safe, inclusive, and respectful environment for community members. | ||
|
||
## Our responsibility | ||
|
||
Project maintainers have a responsibility to create a friendly, respectful, and inclusive environment for our community members. | ||
|
||
They should: | ||
- Clearly and publicly explain the community guidelines; | ||
- Handle reports of guideline violations and resolve disputes appropriately; | ||
- Protect the privacy and security of all community members; | ||
- Maintain a fair, transparent, and responsible attitude. | ||
|
||
## Scope | ||
|
||
This code of conduct applies to all project spaces, including GitHub, mailing lists, forums, social media, gatherings, and conferences. | ||
|
||
Violations of the code of conduct will be dealt with, including but not limited to warnings, temporary or permanent bans, revocation of contribution rights, and revocation of project access rights. | ||
|
||
## Implementation guidelines | ||
|
||
If you encounter behavior that violates this code of conduct, you can: | ||
- Communicate privately with the relevant person to try to resolve the issue; | ||
- Report the violation to the project maintainers(maintainer mailing list), who will take necessary action based on the situation; | ||
- If you are not satisfied with the way the maintainers handle the situation, you can seek help from higher-level organizations or institutions. | ||
|
||
Our community is a diverse, open, and inclusive community, and we welcome everyone's participation and contribution. | ||
|
||
We believe that only in a safe, respectful, and inclusive environment can we create the best project together. | ||
|
||
--- | ||
|
||
# 社区行为准则 | ||
|
||
欢迎来到我们的开源项目!我们致力于创建一个友好、尊重和包容的社区,我们希望所有人都能为此做出贡献。 | ||
|
||
为了确保在我们的项目中有一个积极的体验,我们制定了以下行为准则,我们要求所有参与者遵守这些准则,并向所有社区成员提供一个安全和包容的环境。 | ||
|
||
## 我们的承诺 | ||
|
||
作为我们社区的参与者、贡献者和维护者,我们承诺: | ||
- 以开放、包容和合作的态度对待所有人; | ||
- 尊重不同背景和观点的人,不论是性别、性取向、残疾、种族、民族、宗教、年龄或任何其他因素; | ||
- 专注于对项目的贡献和改进,而不是对个人的攻击或抨击; | ||
- 与社区成员建立互信关系,通过积极的反馈来推动我们的项目发展; | ||
- 为社区成员提供一个安全、支持和鼓励的环境,以促进学习和个人成长。 | ||
|
||
## 我们的标准 | ||
|
||
我们的社区成员应该遵守以下标准: | ||
- 尊重他人的意见、观点和经验; | ||
- 避免使用侮辱性、歧视性或有损的语言; | ||
- 不要骚扰、恐吓或威胁他人; | ||
- 不要公开或私下发布他人的私人信息,例如联系方式或地址; | ||
- 尊重他人的隐私权; | ||
- 为社区成员建立安全、包容和尊重的环境。 | ||
|
||
## 我们的责任 | ||
|
||
项目维护者有责任为我们的社区成员创造一个友好、尊重和包容的环境。 | ||
|
||
他们应该: | ||
- 明确和公开地说明社区准则; | ||
- 处理准则违规行为的举报,通过适当的方式解决纠纷; | ||
- 保护所有社区成员的隐私和安全; | ||
- 保持公正、透明和负责任的态度。 | ||
|
||
## 管理范围 | ||
|
||
本行为准则适用于所有的项目空间,包括 GitHub、邮件列表、论坛、社交媒体、聚会和会议等。 | ||
|
||
违反准则的行为将受到处理,包括但不限于警告、暂时或永久禁言、撤销贡献权、撤销项目访问权等。 | ||
|
||
## 实施指南 | ||
|
||
如果你遇到了违反本准则的行为,你可以: | ||
- 私下与相关人员沟通,以尝试解决问题; | ||
- 向项目维护者报告违规行为,维护者会根据情况采取必要的行动; | ||
- 如果你不满意维护者的处理方式,你可以向更高级别的机构或组织寻求帮助。 | ||
|
||
我们的社区是一个多样化、开放和包容的社区,我们欢迎所有人的参与和贡献。 | ||
|
||
我们相信,只有在一个安全、尊重和包容的环境中,我们才能共同创造出最优秀的项目。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# How to Contribute | ||
|
||
Thank you for your interest and support in tRPC! | ||
|
||
We welcome and appreciate any form of contribution, including but not limited to submitting issues, providing improvement suggestions, improving documentation, fixing bugs, and adding features. | ||
|
||
This document aims to provide you with a detailed contribution guide to help you better participate in the project. | ||
|
||
Please read this guide carefully before contributing and make sure to follow the rules here. | ||
|
||
We look forward to working with you to make this project better together! | ||
|
||
## Before submitting an issue | ||
|
||
Please make sure that you have reviewed the project's documentation, FAQ, and existing issues. | ||
|
||
This can avoid submitting known issues repeatedly and save your and the project maintainer's time. | ||
|
||
When you decide to submit an issue, please follow these rules: | ||
- Select appropriate labels for the issue. This helps us to quickly locate the problem and solve it as soon as possible. | ||
- Ensure that the issue title is concise and accurately summarizes the problem. Avoid using vague words such as "problem" or "error". | ||
|
||
In the issue description, please provide a detailed description of the problem you encountered. | ||
|
||
This includes but is not limited to the following: | ||
- Problem description: briefly describe the symptoms and impact of the problem. | ||
- Reproduction steps: describe in detail how to reproduce the problem, so that we can locate and solve the problem more quickly. | ||
- Environment information: relevant information including operating system, browser, project version, etc. | ||
- Error log: if there are relevant error logs, please provide them. | ||
- Expected results: describe what the correct result should be. | ||
- Screenshots or screen recordings: if possible, provide screenshots or screen recordings of the problem. | ||
|
||
Please be polite and friendly. | ||
|
||
We attach great importance to the environment of the project and hope that everyone can grow together in a friendly and inclusive environment. | ||
|
||
## Rules for submitting PRs | ||
|
||
We welcome you to submit code for the project. | ||
|
||
Before submitting a PR, please make sure that you have read this contribution guide. | ||
|
||
Here are some suggestions and rules regarding submitting PRs. | ||
|
||
Please read them carefully before submitting: | ||
- Ensure that your code conforms to the project's code specifications. This includes but is not limited to code style, comment specifications, etc. This helps us to maintain the cleanliness and consistency of the project. | ||
- Before submitting a PR, please make sure that you have tested your code locally. Ensure that the code has no obvious errors and can run normally. | ||
- Please select appropriate labels for your PR. This helps us to process your PR more quickly. | ||
- Ensure that your PR title is concise and accurately summarizes your changes. Avoid using vague words such as "update" or "modify". | ||
- In the PR description, please provide a detailed description of your changes. This includes but is not limited to the following: | ||
- Reason for modification: briefly explain why this modification is necessary. | ||
- Modification content: describe in detail what you have modified and how you have implemented it. | ||
- Scope of impact: describe the functions or modules that may be affected by the modification. | ||
- Testing: describe the testing you have done locally and the results. | ||
- If your PR resolves a certain issue, please associate the corresponding issue in the PR description. For example: Fixes #123. | ||
|
||
## Communication and Consultation | ||
|
||
We welcome you to participate in the project's communication and consultation. | ||
|
||
You can interact with us through the following channels: | ||
- Submit your questions or suggestions in the project's discussions. | ||
- Join our technical communication group. | ||
|
||
--- | ||
|
||
# 如何作出贡献 | ||
|
||
首先,感谢您对本开源项目的关注和支持! | ||
|
||
我们非常欢迎和感谢任何形式的贡献,包括但不限于提交问题、提出改进意见、完善文档、修复缺陷以及新增功能。 | ||
|
||
本文档旨在为您提供一份详尽的贡献指南,以便您更好地参与到项目中。 | ||
|
||
请在参与贡献之前仔细阅读本指南,并确保遵循其中的规则和建议。 | ||
|
||
我们期待与您一起打造一个更加完善的开源项目! | ||
|
||
## 提交 issue 的规则 | ||
|
||
在提交 issue 之前,请先确保您已经查看了项目的文档、常见问题解答以及已有的 issue。 | ||
|
||
这样可以避免重复提交已知问题,节省您和项目维护者的时间。 | ||
|
||
当您确定需要提交一个 issue 时,请遵循以下规则: | ||
- 为 issue 选择合适的标签。这有助于我们更快地找到问题所在,以便尽快解决。 | ||
- 请确保您的 issue 标题简洁明了,能够准确概括问题所在。避免使用模糊的词语,如“问题”、“错误”等。 | ||
|
||
在 issue 描述中,请详细说明您遇到的问题。 | ||
|
||
包括但不限于以下内容: | ||
- 问题描述:简要说明问题的现象和影响。 | ||
- 复现步骤:详细描述如何复现问题,让我们能够更快地定位和解决问题。 | ||
- 环境信息:包括操作系统、浏览器、项目版本等相关信息。 | ||
- 错误日志:如果有相关错误日志,请一并提供。 | ||
- 期望结果:描述您期望的正确结果是什么。 | ||
- 截图或录屏:如果可能,请提供问题现象的截图或录屏。 | ||
|
||
请保持礼貌和友好。我们非常重视项目的氛围,希望每个人都能够在友好、包容的环境中共同成长。 | ||
|
||
## 提交 PR 的规则 | ||
|
||
我们非常欢迎您为项目提交代码。 | ||
|
||
在提交 PR 之前,请确保您已经阅读了项目的文档以及本贡献指南。 | ||
|
||
以下是关于提交 PR 的一些建议和规则,请在提交前仔细阅读: | ||
|
||
- 请确保您的代码符合项目的代码规范。这包括但不限于代码风格、注释规范等。这有助于我们保持项目的整洁和一致性。 | ||
- 在提交 PR 之前,请确保您已经在本地测试过您的代码。确保代码没有明显的错误,并能够正常运行。 | ||
- 请为您的 PR 选择合适的标签。这有助于我们更快地处理您的 PR。 | ||
- 请确保您的 PR 标题简洁明了,能够准确概括您的修改。避免使用模糊的词语,如“更新”、“修改”等。 | ||
- 在 PR 描述中,请详细说明您的修改内容。包括但不限于以下内容: | ||
- 修改原因:简要说明为什么要进行这次修改。 | ||
- 修改内容:详细描述您修改了哪些内容,以及修改的具体实现。 | ||
- 影响范围:说明修改可能影响到的功能或模块。 | ||
- 测试情况:描述您在本地测试的情况,以及测试结果。 | ||
- 如果您的 PR 解决了某个 issue,请在 PR 描述中关联对应的 issue。例如:Fixes #123。 | ||
|
||
## 技术交流与问题咨询 | ||
|
||
我们非常欢迎您参与到项目的技术交流和问题咨询中来。 | ||
|
||
您可以通过以下途径与我们互动: | ||
- 在项目的 discussions 中提交您的问题或建议 | ||
- 加入我们的技术交流群 |
Oops, something went wrong.