From a00a7fa5245b27c37666e5cf50737f631af97c8d Mon Sep 17 00:00:00 2001
From: "Xinwei Xiong(cubxxw)" <3293172751nss@gmail.com>
Date: Fri, 16 Jun 2023 17:01:00 +0800
Subject: [PATCH] feat(main): initialize the OpenKF architecture
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
---
.github/.codecov.yml | 9 +
.github/labels.yml | 29 +
.github/sync.yml | 69 ++
.github/workflows/auto-invite.yml | 39 ++
.github/workflows/check-coverage.yml | 46 ++
.github/workflows/codeql-analysis.yml | 72 ++
.github/workflows/e2e-test.yml | 1 +
.github/workflows/gosec.yml | 30 +
.github/workflows/issue-robot.yml | 17 +
.github/workflows/link-pr.yml | 47 ++
.github/workflows/opencommit.yml | 39 ++
.github/workflows/stale.yml | 34 +
.github/workflows/sync.yml | 43 ++
.gitignore | 350 ++++++++++
.golangci.yml | 927 ++++++++++++++++++++++++++
CONTRIBUTING.md | 439 ++++++++++++
LICENSE | 201 ++++++
Makefile | 452 +++++++++++++
README.md | 97 +++
README_zh-CN.md | 0
api/OWNERS | 4 +
api/README.md | 11 +
assets/README.md | 3 +
build/OWNERS | 4 +
build/README.md | 11 +
cmd/OWNERS | 4 +
cmd/README.md | 19 +
configs/OWNERS | 4 +
configs/README.md | 5 +
configs/config.yaml | 3 +
deploy/OWNERS | 4 +
deploy/README.md | 3 +
docs/CODEOWNERS | 59 ++
docs/OWNERS | 4 +
docs/README.md | 9 +
examples/OWNERS | 4 +
examples/README.md | 9 +
go.mod | 3 +
init/OWNERS | 4 +
init/README.md | 3 +
internal/OWNERS | 4 +
internal/README.md | 34 +
internal/utils/utils.go | 5 +
pkg/OWNERS | 4 +
pkg/README.md | 55 ++
pkg/version/version.go | 1 +
scripts/LICENSE/LICENSE.md | 21 +
scripts/LICENSE/LICENSE_TEMPLATES | 13 +
scripts/OWNERS | 6 +
scripts/README.md | 11 +
scripts/githooks/commit-msg | 70 ++
scripts/githooks/pre-commit | 90 +++
scripts/githooks/pre-push | 41 ++
test/OWNERS | 4 +
test/README.md | 8 +
third_party/README.md | 3 +
tools/README.md | 9 +
web/OWNERS | 4 +
web/README.md | 3 +
59 files changed, 3497 insertions(+)
create mode 100644 .github/.codecov.yml
create mode 100644 .github/labels.yml
create mode 100644 .github/sync.yml
create mode 100644 .github/workflows/auto-invite.yml
create mode 100644 .github/workflows/check-coverage.yml
create mode 100644 .github/workflows/codeql-analysis.yml
create mode 100644 .github/workflows/e2e-test.yml
create mode 100644 .github/workflows/gosec.yml
create mode 100644 .github/workflows/issue-robot.yml
create mode 100644 .github/workflows/link-pr.yml
create mode 100644 .github/workflows/opencommit.yml
create mode 100644 .github/workflows/stale.yml
create mode 100644 .github/workflows/sync.yml
create mode 100644 .gitignore
create mode 100644 .golangci.yml
create mode 100644 CONTRIBUTING.md
create mode 100644 LICENSE
create mode 100644 Makefile
create mode 100644 README.md
create mode 100644 README_zh-CN.md
create mode 100644 api/OWNERS
create mode 100644 api/README.md
create mode 100644 assets/README.md
create mode 100644 build/OWNERS
create mode 100644 build/README.md
create mode 100644 cmd/OWNERS
create mode 100644 cmd/README.md
create mode 100644 configs/OWNERS
create mode 100644 configs/README.md
create mode 100644 configs/config.yaml
create mode 100644 deploy/OWNERS
create mode 100644 deploy/README.md
create mode 100644 docs/CODEOWNERS
create mode 100644 docs/OWNERS
create mode 100644 docs/README.md
create mode 100644 examples/OWNERS
create mode 100644 examples/README.md
create mode 100644 go.mod
create mode 100644 init/OWNERS
create mode 100644 init/README.md
create mode 100644 internal/OWNERS
create mode 100644 internal/README.md
create mode 100644 internal/utils/utils.go
create mode 100644 pkg/OWNERS
create mode 100644 pkg/README.md
create mode 100644 pkg/version/version.go
create mode 100644 scripts/LICENSE/LICENSE.md
create mode 100644 scripts/LICENSE/LICENSE_TEMPLATES
create mode 100644 scripts/OWNERS
create mode 100644 scripts/README.md
create mode 100644 scripts/githooks/commit-msg
create mode 100644 scripts/githooks/pre-commit
create mode 100644 scripts/githooks/pre-push
create mode 100644 test/OWNERS
create mode 100644 test/README.md
create mode 100644 third_party/README.md
create mode 100644 tools/README.md
create mode 100644 web/OWNERS
create mode 100644 web/README.md
diff --git a/.github/.codecov.yml b/.github/.codecov.yml
new file mode 100644
index 0000000..45e2131
--- /dev/null
+++ b/.github/.codecov.yml
@@ -0,0 +1,9 @@
+coverage:
+ status:
+ project:
+ default: false # disable the default status that measures entire project
+ pkg: # declare a new status context "pkg"
+ paths:
+ - pkg/* # only include coverage in "pkg/" folder
+ informational: true # Always pass check
+ patch: off # disable the commit only checks
\ No newline at end of file
diff --git a/.github/labels.yml b/.github/labels.yml
new file mode 100644
index 0000000..0377905
--- /dev/null
+++ b/.github/labels.yml
@@ -0,0 +1,29 @@
+# Refer to Kubernetes for size/* Settings
+# https://github.com/Kubernetes/Kubernetes
+XS:
+ name: size/XS
+ lines: 0
+ color: 3CBF00
+S:
+ name: size/S
+ lines: 10
+ color: 5D9801
+M:
+ name: size/M
+ lines: 30
+ color: 7F7203
+L:
+ name: size/L
+ lines: 100
+ color: A14C05
+XL:
+ name: size/XL
+ lines: 500
+ color: C32607
+XXL:
+ name: size/XXL
+ lines: 1000
+ color: E50009
+ comment: |
+ # Whoa! Easy there, Partner!
+ This PR is too big. Please break it up into smaller PRs.
\ No newline at end of file
diff --git a/.github/sync.yml b/.github/sync.yml
new file mode 100644
index 0000000..c3efaf2
--- /dev/null
+++ b/.github/sync.yml
@@ -0,0 +1,69 @@
+# https://github.com/BetaHuhn/repo-file-sync-action
+# Synchronization for the.github repository
+OpenIMSDK/.github:
+ - source: LICENSE
+ dest: LICENSE
+ - source: script/LICENSE/
+ dest: scripts/LICENSE/
+ replace: true
+ - source: .github/
+ dest: .github/
+ replace: true
+ exclude: |
+ workflows/
+ sync.yml
+
+OpenIMSDK/community:
+ - source: LICENSE
+ dest: LICENSE
+ - source: script/LICENSE/
+ dest: scripts/LICENSE/
+ replace: true
+ - source: .github/workflows/
+ dest: .github/workflows/
+ exclude:
+ - e2e-test.yml
+ - sync.yml
+ - source: .github/
+ dest: .github/
+ replace: true
+ exclude: |
+ sync.yml
+
+OpenIMSDK/openim-sdk-core:
+ - source: LICENSE
+ dest: LICENSE
+ - source: script/LICENSE/
+ dest: scripts/LICENSE/
+ replace: true
+ - source: .github/workflows/
+ dest: .github/workflows/
+ exclude:
+ - e2e-test.yml
+ - sync.yml
+ - source: .github/
+ dest: .github/
+ replace: true
+ exclude: |
+ sync.yml
+
+group:
+ # first group:common to all warehouses
+ # TODO: add the required warehouse here
+ - repos: |
+ OpenIMSDK/OpenIM-Docs@main
+ files:
+ # - source: .gitingore
+ # dest: .gitingore
+ # replace: false
+ - source: LICENSE
+ dest: LICENSE
+ replace: false
+ - source: .github/workflows/
+ dest: .github/workflows/
+ exclude: |
+ e2e-test.yml
+ sync.yml
+ - source: script/githooks/
+ dest: scripts/githooks/
+ replace: false
\ No newline at end of file
diff --git a/.github/workflows/auto-invite.yml b/.github/workflows/auto-invite.yml
new file mode 100644
index 0000000..f776570
--- /dev/null
+++ b/.github/workflows/auto-invite.yml
@@ -0,0 +1,39 @@
+name: Invite users to join our group
+on:
+ issue_comment:
+ types:
+ - created
+jobs:
+ issue_comment:
+ name: Invite users to join our group
+ if: ${{ github.event.comment.body == '/invite' || github.event.comment.body == '/close' || github.event.comment.body == '/comment' }}
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ steps:
+
+ - name: Invite user to join our group
+ uses: peter-evans/create-or-update-comment@v1
+ with:
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ body: |
+ We value close connections with our users, developers, and contributors here at OpenKF. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.
+
+ Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg). Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of OpenKF. You can ask technical questions, seek help, or share your experiences with other users of OpenKF.
+
+ 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 [👀 OpenKF 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 OpenKF 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 OpenKF. We will process your request as soon as possible.
+
+ - name: Close Issue
+ uses: peter-evans/close-issue@v3
+ with:
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ comment: 🤖 Auto-closing issue, if you still need help please reopen the issue or ask for help in the community above
+ labels: |
+ triage/accepted
\ No newline at end of file
diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml
new file mode 100644
index 0000000..b4a6a69
--- /dev/null
+++ b/.github/workflows/check-coverage.yml
@@ -0,0 +1,46 @@
+# name: Check-Coverage
+
+
+# on:
+# workflow_dispatch:
+# push:
+# branches: [ "main" ]
+# paths-ignore:
+# - "docs/**"
+# - "**/*.md"
+# - "**/*.yaml"
+# - "CONTRIBUTORS"
+# - "CHANGELOG/**"
+# pull_request:
+# branches: [ "*" ]
+# paths-ignore:
+# - "docs/**"
+# - "**/*.md"
+# - "**/*.yaml"
+# - "CONTRIBUTORS"
+# - "CHANGELOG/**"
+# env:
+# # Common versions
+# GO_VERSION: "1.20"
+
+# jobs:
+# coverage:
+# runs-on: ubuntu-20.04
+# steps:
+# - name: Checkout
+# uses: actions/checkout@v3
+
+# - name: Setup Golang with cache
+# uses: magnetikonline/action-golang-cache@v3
+# with:
+# go-version: ${{ env.GO_VERSION }}
+# token: ${{ secrets.BOT_GITHUB_TOKEN }}
+
+# - name: Install Dependencies
+# run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
+
+# - name: Run Cover
+# run: make cover
+
+# - name: Upload Coverage to Codecov
+# uses: codecov/codecov-action@v3
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000..55cceff
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,72 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: "*"
+# schedule:
+# - cron: '23 2 * * 2'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'go' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+ # Learn more:
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v1
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 https://git.io/JvXDl
+
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
new file mode 100644
index 0000000..4e768b5
--- /dev/null
+++ b/.github/workflows/e2e-test.yml
@@ -0,0 +1 @@
+#
\ No newline at end of file
diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml
new file mode 100644
index 0000000..60f42ae
--- /dev/null
+++ b/.github/workflows/gosec.yml
@@ -0,0 +1,30 @@
+# name: Run gosec
+
+# # gosec is a source code security audit tool for the Go language. It performs a static
+# # analysis of the Go code, looking for potential security problems. The main functions of gosec are:
+# # 1. Find common security vulnerabilities, such as SQL injection, command injection, and cross-site scripting (XSS).
+# # 2. Audit codes according to common security standards and find non-standard codes.
+# # 3. Assist the Go language engineer to write safe and reliable code.
+
+# on:
+# push:
+# branches: "*"
+# pull_request:
+# branches: "*"
+# paths-ignore:
+# - '*.md'
+# - '*.yml'
+# - '.github'
+
+# jobs:
+# golang-security-action:
+# runs-on: ubuntu-latest
+# env:
+# GO111MODULE: on
+# steps:
+# - name: Check out code
+# uses: actions/checkout@v3
+# - name: Run Gosec Security Scanner
+# uses: securego/gosec@master
+# with:
+# args: ./...
\ No newline at end of file
diff --git a/.github/workflows/issue-robot.yml b/.github/workflows/issue-robot.yml
new file mode 100644
index 0000000..74927a0
--- /dev/null
+++ b/.github/workflows/issue-robot.yml
@@ -0,0 +1,17 @@
+name: 'issue translator'
+on:
+ issue_comment:
+ types: [created]
+ issues:
+ types: [opened]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: usthe/issues-translate-action@v2.7
+ with:
+ # it is not necessary to decide whether you need to modify the issue header content
+ IS_MODIFY_TITLE: true
+ BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
+ # Required, input your bot github token
\ No newline at end of file
diff --git a/.github/workflows/link-pr.yml b/.github/workflows/link-pr.yml
new file mode 100644
index 0000000..4b47609
--- /dev/null
+++ b/.github/workflows/link-pr.yml
@@ -0,0 +1,47 @@
+name: Github Rebot for Link check error
+
+on:
+ pull_request:
+ branches: [ main ]
+ paths:
+ - '**.md'
+ - 'docs/**'
+ - '.lycheeignore'
+ push:
+ branches: [ main ]
+
+ schedule:
+ - cron: '0 11 * * *'
+
+jobs:
+ linkChecker:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Link Checker
+ id: lychee
+ uses: lycheeverse/lychee-action@v1.7.0
+ with:
+ # For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
+ # Actions Link address -> https://github.com/lycheeverse/lychee-action
+ # -E, --exclude-all-private Exclude all private IPs from checking.
+ # -i, --insecure Proceed for server connections considered insecure (invalid TLS)
+ # -n, --no-progress Do not show progress bar.
+ # -t, --timeout Website timeout in seconds from connect to response finished [default:20]
+ # --max-concurrency Maximum number of concurrent network requests [default: 128]
+ # -a --accept Comma-separated list of accepted status codes for valid links
+ # docs/.vitepress/dist the site directory to check
+ # ./*.md all markdown files in the root directory
+ args: --verbose -E -i --no-progress --exclude-path './CHANGELOG' './**/*.md'
+ env:
+ GITHUB_TOKEN: ${{secrets.GH_PAT}}
+
+ - name: Create Issue From File
+ if: env.lychee_exit_code != 0
+ uses: peter-evans/create-issue-from-file@v4
+ with:
+ title: Bug reports for links in OpenIM docs
+ content-filepath: ./lychee/out.md
+ labels: kind/documentation, triage/unresolved, report
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
diff --git a/.github/workflows/opencommit.yml b/.github/workflows/opencommit.yml
new file mode 100644
index 0000000..d3d5250
--- /dev/null
+++ b/.github/workflows/opencommit.yml
@@ -0,0 +1,39 @@
+name: 'OpenCommit Action'
+
+on:
+ push:
+ # this list of branches is often enough,
+ # but you may still ignore other public branches
+ branches-ignore: [main master dev development release]
+
+jobs:
+ opencommit:
+ timeout-minutes: 10
+ name: OpenCommit
+ runs-on: ubuntu-latest
+ permissions: write-all
+ steps:
+ - name: Setup Node.js Environment
+ uses: actions/setup-node@v2
+ with:
+ node-version: '16'
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - uses: di-sukharev/opencommit@github-action-v1.0.4
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ env:
+ # set openAI api key in repo actions secrets,
+ # for openAI keys go to: https://platform.openai.com/account/api-keys
+ # for repo secret go to: https://github.com/kuebcub/settings/secrets/actions
+ OCO_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+
+ # customization
+ OCO_OPENAI_MAX_TOKENS: 500
+ OCO_OPENAI_BASE_PATH: ''
+ OCO_DESCRIPTION: false
+ OCO_EMOJI: false
+ OCO_MODEL: gpt-3.5-turbo
+ OCO_LANGUAGE: en
\ No newline at end of file
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644
index 0000000..2cad62c
--- /dev/null
+++ b/.github/workflows/stale.yml
@@ -0,0 +1,34 @@
+# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
+#
+# You can adjust the behavior by modifying this file.
+# For more information, see:
+# https://github.com/actions/stale
+name: Mark stale issues and pull requests
+
+on:
+ schedule:
+ - cron: '0 8 * * *'
+
+jobs:
+ stale:
+
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ pull-requests: write
+
+ steps:
+ - uses: actions/stale@v5
+ with:
+ repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
+ days-before-stale: 60
+ days-before-close: 7
+ stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
+ stale-pr-message: 'This issue is stale because it has been open 60 days with no activity.'
+ close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
+ close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity. You can reopen it if you want.'
+ stale-pr-label: lifecycle/stale
+ stale-issue-label: lifecycle/stale
+ exempt-issue-labels: 'openim'
+ exempt-pr-labels: 'openim'
+ exempt-draft-pr: true
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
new file mode 100644
index 0000000..871e400
--- /dev/null
+++ b/.github/workflows/sync.yml
@@ -0,0 +1,43 @@
+# Copyright © 2023 KubeCub open source community. All rights reserved.
+# Licensed under the MIT License (the "License");
+# you may not use this file except in compliance with the License.
+
+# https://github.com/BetaHuhn/repo-file-sync-action
+name: Synchronize kubecub public code to other repositories
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ sync:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Run GitHub File Sync
+ uses: BetaHuhn/repo-file-sync-action@latest
+ with:
+ GH_INSTALLATION_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}"
+ CONFIG_PATH: .github/sync.yml
+ GH_PAT: "${{ secrets.BOT_GITHUB_TOKEN }}"
+ ORIGINAL_MESSAGE: true
+ SKIP_PR: true
+ COMMIT_EACH_FILE: false
+ COMMIT_BODY: "🤖 kubbot to synchronize the warehouse"
+ GIT_EMAIL: "3293172751ysy@gmail.com"
+ GIT_USERNAME: "kubbot"
+ PR_BODY: 👌 kubecub provides automated community services
+ REVIEWERS: |
+ kubbot
+ cubxxw
+ PR_LABELS: |
+ file-sync
+ automerge
+ ASSIGNEES: |
+ kubbot
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..451b7d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,350 @@
+# Created by https://www.toptal.com/developers/gitignore/api/vim,jetbrains,vscode,git,go,tags,backup,test,emacs
+# Edit at https://www.toptal.com/developers/gitignore?templates=vim,jetbrains,vscode,git,go,tags,backup,test,emacs
+
+### Backup ###
+*.bak
+*.gho
+*.ori
+*.orig
+*.tmp
+
+### Git ###
+# Created by git for backups. To disable backups in Git:
+# $ git config --global mergetool.keepBackup false
+
+# Created by git when using merge tools for conflicts
+*.BACKUP.*
+*.BASE.*
+*.LOCAL.*
+*.REMOTE.*
+*_BACKUP_*.txt
+*_BASE_*.txt
+*_LOCAL_*.txt
+*_REMOTE_*.txt
+
+### Go ###
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, built with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+# Dependency directories (remove the comment below to include it)
+# vendor/
+
+### Go Patch ###
+/vendor/
+/Godeps/
+
+### JetBrains ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+.idea
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### JetBrains Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+### Tags ###
+# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
+TAGS
+.TAGS
+!TAGS/
+tags
+.tags
+!tags/
+gtags.files
+GTAGS
+GRTAGS
+GPATH
+GSYMS
+cscope.files
+cscope.out
+cscope.in.out
+cscope.po.out
+
+
+### Test ###
+### Ignore all files that could be used to test your code and
+### you wouldn't want to push
+
+# Reference https://en.wikipedia.org/wiki/Metasyntactic_variable
+
+# Most common
+*foo
+*bar
+*fubar
+*foobar
+*baz
+
+# Less common
+*qux
+*quux
+*bongo
+*bazola
+*ztesch
+
+# UK, Australia
+*wibble
+*wobble
+*wubble
+*flob
+*blep
+*blah
+*boop
+*beep
+
+# Japanese
+*hoge
+*piyo
+*fuga
+*hogera
+*hogehoge
+
+# Portugal, Spain
+*fulano
+*sicrano
+*beltrano
+*mengano
+*perengano
+*zutano
+
+# France, Italy, the Netherlands
+*toto
+*titi
+*tata
+*tutu
+*pipppo
+*pluto
+*paperino
+*aap
+*noot
+*mies
+
+# Other names that would make sense
+*tests
+*testsdir
+*testsfile
+*testsfiles
+*testdir
+*testfile
+*testfiles
+*testing
+*testingdir
+*testingfile
+*testingfiles
+*temp
+*tempdir
+*tempfile
+*tempfiles
+*tmp
+*tmpdir
+*tmpfile
+*tmpfiles
+*lol
+
+### Vim ###
+# Swap
+[._]*.s[a-v][a-z]
+!*.svg # comment out if you don't need vector files
+[._]*.sw[a-p]
+[._]s[a-rt-v][a-z]
+[._]ss[a-gi-z]
+[._]sw[a-p]
+
+# Session
+Session.vim
+Sessionx.vim
+
+# Temporary
+.netrwhist
+*~
+# Auto-generated tag files
+# Persistent undo
+[._]*.un~
+
+### Emacs ###
+# -*- mode: gitignore; -*-
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+ltximg/**
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+
+# cask packages
+.cask/
+dist/
+
+# Flycheck
+flycheck_*.el
+
+# server auth directory
+/server/
+
+# projectiles files
+.projectile
+
+# directory configuration
+.dir-locals.el
+
+# network security
+/network-security.data
+
+### vscode ###
+.vscode
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# End of https://www.toptal.com/developers/gitignore/api/vim,jetbrains,vscode,git,go,tags,backup,test
+
+# Start by iam
+
+# log
+*.log
+
+# Output of backend and frontend
+/_output
+/_debug
+
+# Misc
+.DS_Store
+*.env
+.env.*
+dist
+
+# files used by the developer
+.idea.md
+.todo.md
+.note.md
+
+# config files, may contain sensitive information
\ No newline at end of file
diff --git a/.golangci.yml b/.golangci.yml
new file mode 100644
index 0000000..fa8db3e
--- /dev/null
+++ b/.golangci.yml
@@ -0,0 +1,927 @@
+# This file contains all available configuration options
+# with their default values.
+
+# options for analysis running
+run:
+ # default concurrency is a available CPU number
+ concurrency: 4
+
+ # timeout for analysis, e.g. 30s, 5m, default is 1m
+ timeout: 5m
+
+ # exit code when at least one issue was found, default is 1
+ issues-exit-code: 1
+
+ # include test files or not, default is true
+ tests: true
+
+ # list of build tags, all linters use it. Default is empty list.
+ build-tags:
+ - mytag
+
+ # which dirs to skip: issues from them won't be reported;
+ # can use regexp here: generated.*, regexp is applied on full path;
+ # default value is empty list, but default dirs are skipped independently
+ # from this option's value (see skip-dirs-use-default).
+ # "/" will be replaced by current OS file path separator to properly work
+ # on Windows.
+ skip-dirs:
+ - util
+ - .*~
+ - api/swagger/docs
+
+ # default is true. Enables skipping of directories:
+ # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
+ skip-dirs-use-default: true
+
+ # which files to skip: they will be analyzed, but issues from them
+ # won't be reported. Default value is empty list, but there is
+ # no need to include all autogenerated files, we confidently recognize
+ # autogenerated files. If it's not please let us know.
+ # "/" will be replaced by current OS file path separator to properly work
+ # on Windows.
+ skip-files:
+ - ".*\\.my\\.go$"
+ - _test.go
+
+ # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
+ # If invoked with -mod=readonly, the go command is disallowed from the implicit
+ # automatic updating of go.mod described above. Instead, it fails when any changes
+ # to go.mod are needed. This setting is most useful to check that go.mod does
+ # not need updates, such as in a continuous integration and testing system.
+ # If invoked with -mod=vendor, the go command assumes that the vendor
+ # directory holds the correct copies of dependencies and ignores
+ # the dependency descriptions in go.mod.
+ #modules-download-mode: release|readonly|vendor
+
+ # Allow multiple parallel golangci-lint instances running.
+ # If false (default) - golangci-lint acquires file lock on start.
+ allow-parallel-runners: true
+
+
+# output configuration options
+output:
+ # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
+ format: colored-line-number
+
+ # print lines of code with issue, default is true
+ print-issued-lines: true
+
+ # print linter name in the end of issue text, default is true
+ print-linter-name: true
+
+ # make issues output unique by line, default is true
+ uniq-by-line: true
+
+ # add a prefix to the output file references; default is no prefix
+ path-prefix: ""
+
+ # sorts results by: filepath, line and column
+ sort-results: true
+
+# all available settings of specific linters
+linters-settings:
+ bidichk:
+ # The following configurations check for all mentioned invisible unicode
+ # runes. It can be omitted because all runes are enabled by default.
+ left-to-right-embedding: true
+ right-to-left-embedding: true
+ pop-directional-formatting: true
+ left-to-right-override: true
+ right-to-left-override: true
+ left-to-right-isolate: true
+ right-to-left-isolate: true
+ first-strong-isolate: true
+ pop-directional-isolate: true
+ dogsled:
+ # checks assignments with too many blank identifiers; default is 2
+ max-blank-identifiers: 2
+ dupl:
+ # tokens count to trigger issue, 150 by default
+ threshold: 100
+ errcheck:
+ # report about not checking of errors in type assertions: `a := b.(MyStruct)`;
+ # default is false: such cases aren't reported by default.
+ check-type-assertions: false
+
+ # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
+ # default is false: such cases aren't reported by default.
+ check-blank: false
+
+ # [deprecated] comma-separated list of pairs of the form pkg:regex
+ # the regex is used to ignore names within pkg. (default "fmt:.*").
+ # see https://github.com/kisielk/errcheck#the-deprecated-method for details
+ #ignore: GenMarkdownTree,os:.*,BindPFlags,WriteTo,Help
+ #ignore: (os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv
+
+ # path to a file containing a list of functions to exclude from checking
+ # see https://github.com/kisielk/errcheck#excluding-functions for details
+ #exclude: errcheck.txt
+
+ errorlint:
+ # Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats
+ errorf: true
+ # Check for plain type assertions and type switches
+ asserts: true
+ # Check for plain error comparisons
+ comparison: true
+
+ exhaustive:
+ # check switch statements in generated files also
+ check-generated: false
+ # indicates that switch statements are to be considered exhaustive if a
+ # 'default' case is present, even if all enum members aren't listed in the
+ # switch
+ default-signifies-exhaustive: false
+ # enum members matching the supplied regex do not have to be listed in
+ # switch statements to satisfy exhaustiveness
+ ignore-enum-members: ""
+ # consider enums only in package scopes, not in inner scopes
+ package-scope-only: false
+ exhaustivestruct:
+ struct-patterns:
+ - '*.Test'
+ - '*.Test2'
+ - '*.Embedded'
+ - '*.External'
+
+ forbidigo:
+ # Forbid the following identifiers (identifiers are written using regexp):
+ forbid:
+ - ^print.*$
+ - 'fmt\.Print.*'
+ - fmt.Println.* # too much log noise
+ - ginkgo\\.F.* # these are used just for local development
+ # Exclude godoc examples from forbidigo checks. Default is true.
+ exclude_godoc_examples: false
+ funlen:
+ lines: 150
+ statements: 50
+ gci:
+ # put imports beginning with prefix after 3rd-party packages;
+ # only support one prefix
+ # if not set, use goimports.local-prefixes
+ prefix: github.com/marmotedu/iam
+ gocognit:
+ # minimal code complexity to report, 30 by default (but we recommend 10-20)
+ min-complexity: 30
+ goconst:
+ # minimal length of string constant, 3 by default
+ min-len: 3
+ # minimal occurrences count to trigger, 3 by default
+ min-occurrences: 3
+ # ignore test files, false by default
+ ignore-tests: false
+ # look for existing constants matching the values, true by default
+ match-constant: true
+ # search also for duplicated numbers, false by default
+ numbers: false
+ # minimum value, only works with goconst.numbers, 3 by default
+ min: 3
+ # maximum value, only works with goconst.numbers, 3 by default
+ max: 3
+ # ignore when constant is not used as function argument, true by default
+ ignore-calls: true
+
+ gocritic:
+ # Which checks should be enabled; can't be combined with 'disabled-checks';
+ # See https://go-critic.github.io/overview#checks-overview
+ # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
+ # By default list of stable checks is used.
+ enabled-checks:
+ #- rangeValCopy
+ - nestingreduce
+ - truncatecmp
+ - unnamedresult
+ - ruleguard
+
+ # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
+ disabled-checks:
+ - regexpMust
+ - ifElseChain
+ #- exitAfterDefer
+
+ # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
+ # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
+ enabled-tags:
+ - performance
+ disabled-tags:
+ - experimental
+
+ # Settings passed to gocritic.
+ # The settings key is the name of a supported gocritic checker.
+ # The list of supported checkers can be find in https://go-critic.github.io/overview.
+ settings:
+ captLocal: # must be valid enabled check name
+ # whether to restrict checker to params only (default true)
+ paramsOnly: true
+ elseif:
+ # whether to skip balanced if-else pairs (default true)
+ skipBalanced: true
+ hugeParam:
+ # size in bytes that makes the warning trigger (default 80)
+ sizeThreshold: 80
+ nestingReduce:
+ # min number of statements inside a branch to trigger a warning (default 5)
+ bodyWidth: 5
+ rangeExprCopy:
+ # size in bytes that makes the warning trigger (default 512)
+ sizeThreshold: 512
+ # whether to check test functions (default true)
+ skipTestFuncs: true
+ rangeValCopy:
+ # size in bytes that makes the warning trigger (default 128)
+ sizeThreshold: 32
+ # whether to check test functions (default true)
+ skipTestFuncs: true
+ ruleguard:
+ # path to a gorules file for the ruleguard checker
+ rules: ''
+ truncateCmp:
+ # whether to skip int/uint/uintptr types (default true)
+ skipArchDependent: true
+ underef:
+ # whether to skip (*x).method() calls where x is a pointer receiver (default true)
+ skipRecvDeref: true
+ unnamedResult:
+ # whether to check exported functions
+ checkExported: true
+ gocyclo:
+ # minimal code complexity to report, 30 by default (but we recommend 10-20)
+ min-complexity: 30
+ cyclop:
+ # the maximal code complexity to report
+ max-complexity: 50
+ # the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
+ package-average: 0.0
+ # should ignore tests (default false)
+ skip-tests: false
+ godot:
+ # comments to be checked: `declarations`, `toplevel`, or `all`
+ scope: declarations
+ # list of regexps for excluding particular comment lines from check
+ exclude:
+ # example: exclude comments which contain numbers
+ # - '[0-9]+'
+ # check that each sentence starts with a capital letter
+ capital: false
+ godox:
+ # report any comments starting with keywords, this is useful for TODO or FIXME comments that
+ # might be left in the code accidentally and should be resolved before merging
+ keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
+ #- TODO
+ - BUG
+ - FIXME
+ #- NOTE
+ - OPTIMIZE # marks code that should be optimized before merging
+ - HACK # marks hack-arounds that should be removed before merging
+ gofmt:
+ # simplify code: gofmt with `-s` option, true by default
+ simplify: true
+
+ gofumpt:
+ # Select the Go version to target. The default is `1.15`.
+ lang-version: "1.15"
+
+ # Choose whether or not to use the extra rules that are disabled
+ # by default
+ extra-rules: false
+
+ goheader:
+ values:
+ const:
+ # define here const type values in format k:v, for example:
+ # COMPANY: MY COMPANY
+ regexp:
+ # define here regexp type values, for example
+ # AUTHOR: .*@mycompany\.com
+ template: # |-
+ # put here copyright header template for source code files, for example:
+ # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time.
+ #
+ # {{ AUTHOR }} {{ COMPANY }} {{ YEAR }}
+ # SPDX-License-Identifier: Apache-2.0
+
+ # 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.
+ template-path:
+ # also as alternative of directive 'template' you may put the path to file with the template source
+ goimports:
+ # put imports beginning with prefix after 3rd-party packages;
+ # it's a comma-separated list of prefixes
+ local-prefixes: github.com/marmotedu/iam
+ golint:
+ # minimal confidence for issues, default is 0.8
+ min-confidence: 0.9
+ gomnd:
+ settings:
+ mnd:
+ # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
+ checks: argument,case,condition,operation,return,assign
+ # ignored-numbers: 1000
+ # ignored-files: magic_.*.go
+ # ignored-functions: math.*
+ gomoddirectives:
+ # Allow local `replace` directives. Default is false.
+ replace-local: true
+ # List of allowed `replace` directives. Default is empty.
+ replace-allow-list:
+ - google.golang.org/grpc
+ - github.com/marmotedu/api
+ - github.com/marmotedu/component-base
+ - github.com/marmotedu/marmotedu-sdk-go
+
+ # Allow to not explain why the version has been retracted in the `retract` directives. Default is false.
+ retract-allow-no-explanation: false
+ # Forbid the use of the `exclude` directives. Default is false.
+ exclude-forbidden: false
+ gomodguard:
+ allowed:
+ modules: # List of allowed modules
+ - gorm.io/gorm
+ - gorm.io/driver/mysql
+ - k8s.io/klog
+ # - gopkg.in/yaml.v2
+ domains: # List of allowed module domains
+ - google.golang.org
+ - gopkg.in
+ - golang.org
+ - github.com
+ - go.uber.org
+ - go.etcd.io
+ blocked:
+ modules:
+ - github.com/pkg/errors:
+ recommendations:
+ - github.com/marmotedu/errors
+ reason: "`github.com/marmotedu/errors` is the log package used by marmotedu projects."
+ versions:
+ - github.com/MakeNowJust/heredoc:
+ version: "> 2.0.9"
+ reason: "use the latest version"
+ local_replace_directives: false # Set to true to raise lint issues for packages that are loaded from a local path via replace directive
+
+ gosec:
+ # To select a subset of rules to run.
+ # Available rules: https://github.com/securego/gosec#available-rules
+ includes:
+ - G401
+ - G306
+ - G101
+ # To specify a set of rules to explicitly exclude.
+ # Available rules: https://github.com/securego/gosec#available-rules
+ excludes:
+ - G204
+ # Exclude generated files
+ exclude-generated: true
+ # Filter out the issues with a lower severity than the given value. Valid options are: low, medium, high.
+ severity: "low"
+ # Filter out the issues with a lower confidence than the given value. Valid options are: low, medium, high.
+ confidence: "low"
+ # To specify the configuration of rules.
+ # The configuration of rules is not fully documented by gosec:
+ # https://github.com/securego/gosec#configuration
+ # https://github.com/securego/gosec/blob/569328eade2ccbad4ce2d0f21ee158ab5356a5cf/rules/rulelist.go#L60-L102
+ config:
+ G306: "0600"
+ G101:
+ pattern: "(?i)example"
+ ignore_entropy: false
+ entropy_threshold: "80.0"
+ per_char_threshold: "3.0"
+ truncate: "32"
+
+ gosimple:
+ # Select the Go version to target. The default is '1.13'.
+ go: "1.15"
+ # https://staticcheck.io/docs/options#checks
+ checks: [ "all" ]
+
+ govet:
+ # report about shadowed variables
+ check-shadowing: true
+
+ # settings per analyzer
+ settings:
+ printf: # analyzer name, run `go tool vet help` to see all analyzers
+ funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
+ - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
+ - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
+ - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
+ - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
+
+ # enable or disable analyzers by name
+ enable:
+ - atomicalign
+ enable-all: false
+ disable:
+ - shadow
+ disable-all: false
+ depguard:
+ list-type: blacklist
+ include-go-root: false
+ packages:
+ - github.com/Sirupsen/logrus
+ packages-with-error-message:
+ # specify an error message to output when a blacklisted package is used
+ - github.com/Sirupsen/logrus: "logging is allowed only by logutils.Log"
+ ifshort:
+ # Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
+ # Has higher priority than max-decl-chars.
+ max-decl-lines: 1
+ # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
+ max-decl-chars: 30
+
+ importas:
+ # if set to `true`, force to use alias.
+ no-unaliased: true
+ # List of aliases
+ alias:
+ # using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package
+ - pkg: knative.dev/serving/pkg/apis/serving/v1
+ alias: servingv1
+ # using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package
+ - pkg: knative.dev/serving/pkg/apis/autoscaling/v1alpha1
+ alias: autoscalingv1alpha1
+ # You can specify the package path by regular expression,
+ # and alias by regular expression expansion syntax like below.
+ # see https://github.com/julz/importas#use-regular-expression for details
+ - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+)
+ alias: $1$2
+ # using `jwt` alias for `github.com/appleboy/gin-jwt/v2` package
+ jwt: github.com/appleboy/gin-jwt/v2
+ # using `metav1` alias for `github.com/marmotedu/component-base/pkg/meta/v1` package
+ metav1: github.com/marmotedu/component-base/pkg/meta/v1
+
+ ireturn:
+ # ireturn allows using `allow` and `reject` settings at the same time.
+ # Both settings are lists of the keywords and regular expressions matched to interface or package names.
+ # keywords:
+ # - `empty` for `interface{}`
+ # - `error` for errors
+ # - `stdlib` for standard library
+ # - `anon` for anonymous interfaces
+
+ # By default, it allows using errors, empty interfaces, anonymous interfaces,
+ # and interfaces provided by the standard library.
+ allow:
+ - anon
+ - error
+ - empty
+ - stdlib
+ # You can specify idiomatic endings for interface
+ - (or|er)$
+
+ # Reject patterns
+ reject:
+ - github.com\/user\/package\/v4\.Type
+
+ lll:
+ # max line length, lines longer will be reported. Default is 120.
+ # '\t' is counted as 1 character by default, and can be changed with the tab-width option
+ line-length: 240
+ # tab width in spaces. Default to 1.
+ tab-width: 4
+ maligned:
+ # print struct with more effective memory layout or not, false by default
+ suggest-new: true
+ misspell:
+ # Correct spellings using locale preferences for US or UK.
+ # Default is to use a neutral variety of English.
+ # Setting locale to US will correct the British spelling of 'colour' to 'color'.
+ locale: US
+ ignore-words:
+ - someword
+ nakedret:
+ # make an issue if func has more lines of code than this setting and it has naked returns; default is 30
+ max-func-lines: 30
+
+ nestif:
+ # minimal complexity of if statements to report, 5 by default
+ min-complexity: 4
+
+ nilnil:
+ # By default, nilnil checks all returned types below.
+ checked-types:
+ - ptr
+ - func
+ - iface
+ - map
+ - chan
+
+ nlreturn:
+ # size of the block (including return statement that is still "OK")
+ # so no return split required.
+ block-size: 1
+
+ nolintlint:
+ # Disable to ensure that all nolint directives actually have an effect. Default is true.
+ allow-unused: false
+ # Disable to ensure that nolint directives don't have a leading space. Default is true.
+ allow-leading-space: true
+ # Exclude following linters from requiring an explanation. Default is [].
+ allow-no-explanation: [ ]
+ # Enable to require an explanation of nonzero length after each nolint directive. Default is false.
+ require-explanation: false
+ # Enable to require nolint directives to mention the specific linter being suppressed. Default is false.
+ require-specific: true
+
+ prealloc:
+ # XXX: we don't recommend using this linter before doing performance profiling.
+ # For most programs usage of prealloc will be a premature optimization.
+
+ # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
+ # True by default.
+ simple: true
+ range-loops: true # Report preallocation suggestions on range loops, true by default
+ for-loops: false # Report preallocation suggestions on for loops, false by default
+
+ promlinter:
+ # Promlinter cannot infer all metrics name in static analysis.
+ # Enable strict mode will also include the errors caused by failing to parse the args.
+ strict: false
+ # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage.
+ disabled-linters:
+ # - "Help"
+ # - "MetricUnits"
+ # - "Counter"
+ # - "HistogramSummaryReserved"
+ # - "MetricTypeInName"
+ # - "ReservedChars"
+ # - "CamelCase"
+ # - "lintUnitAbbreviations"
+
+ predeclared:
+ # comma-separated list of predeclared identifiers to not report on
+ ignore: ""
+ # include method names and field names (i.e., qualified names) in checks
+ q: false
+ rowserrcheck:
+ packages:
+ - github.com/jmoiron/sqlx
+ revive:
+ # see https://github.com/mgechev/revive#available-rules for details.
+ ignore-generated-header: true
+ severity: warning
+ rules:
+ - name: indent-error-flow
+ severity: warning
+ staticcheck:
+ # Select the Go version to target. The default is '1.13'.
+ go: "1.16"
+ # https://staticcheck.io/docs/options#checks
+ checks: [ "all" ]
+
+ stylecheck:
+ # Select the Go version to target. The default is '1.13'.
+ go: "1.16"
+
+ # https://staticcheck.io/docs/options#checks
+ checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
+ # https://staticcheck.io/docs/options#dot_import_whitelist
+ dot-import-whitelist:
+ - fmt
+ # https://staticcheck.io/docs/options#initialisms
+ initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS" ]
+ # https://staticcheck.io/docs/options#http_status_code_whitelist
+ http-status-code-whitelist: [ "200", "400", "404", "500" ]
+
+
+ tagliatelle:
+ # check the struck tag name case
+ case:
+ # use the struct field name to check the name of the struct tag
+ use-field-name: true
+ rules:
+ # any struct tag type can be used.
+ # support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
+ json: camel
+ yaml: camel
+ xml: camel
+ bson: camel
+ avro: snake
+ mapstructure: kebab
+
+ testpackage:
+ # regexp pattern to skip files
+ skip-regexp: (id|export|internal)_test\.go
+ thelper:
+ # The following configurations enable all checks. It can be omitted because all checks are enabled by default.
+ # You can enable only required checks deleting unnecessary checks.
+ test:
+ first: true
+ name: true
+ begin: true
+ benchmark:
+ first: true
+ name: true
+ begin: true
+ tb:
+ first: true
+ name: true
+ begin: true
+
+ tenv:
+ # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
+ # By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
+ all: false
+
+ unparam:
+ # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
+ # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
+ # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
+ # with golangci-lint call it on a directory with the changed file.
+ check-exported: false
+ unused:
+ # treat code as a program (not a library) and report unused exported identifiers; default is false.
+ # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
+ # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
+ # with golangci-lint call it on a directory with the changed file.
+ check-exported: false
+ whitespace:
+ multi-if: false # Enforces newlines (or comments) after every multi-line if statement
+ multi-func: false # Enforces newlines (or comments) after every multi-line function signature
+
+ wrapcheck:
+ # An array of strings that specify substrings of signatures to ignore.
+ # If this set, it will override the default set of ignored signatures.
+ # See https://github.com/tomarrell/wrapcheck#configuration for more information.
+ ignoreSigs:
+ - .Errorf(
+ - errors.New(
+ - errors.Unwrap(
+ - .Wrap(
+ - .Wrapf(
+ - .WithMessage(
+ - .WithMessagef(
+ - .WithStack(
+ ignorePackageGlobs:
+ - encoding/*
+ - github.com/pkg/*
+
+ wsl:
+ # If true append is only allowed to be cuddled if appending value is
+ # matching variables, fields or types on line above. Default is true.
+ strict-append: true
+ # Allow calls and assignments to be cuddled as long as the lines have any
+ # matching variables, fields or types. Default is true.
+ allow-assign-and-call: true
+ # Allow assignments to be cuddled with anything. Default is false.
+ allow-assign-and-anything: false
+ # Allow multiline assignments to be cuddled. Default is true.
+ allow-multiline-assign: true
+ # Allow declarations (var) to be cuddled.
+ allow-cuddle-declarations: false
+ # Allow trailing comments in ending of blocks
+ allow-trailing-comment: false
+ # Force newlines in end of case at this limit (0 = never).
+ force-case-trailing-whitespace: 0
+ # Force cuddling of err checks with err var assignment
+ force-err-cuddling: false
+ # Allow leading comments to be separated with empty liens
+ allow-separated-leading-comment: false
+ makezero:
+ # Allow only slices initialized with a length of zero. Default is false.
+ always: false
+
+
+ # The custom section can be used to define linter plugins to be loaded at runtime. See README doc
+ # for more info.
+ #custom:
+ # Each custom linter should have a unique name.
+ #example:
+ # The path to the plugin *.so. Can be absolute or local. Required for each custom linter
+ #path: /path/to/example.so
+ # The description of the linter. Optional, just for documentation purposes.
+ #description: This is an example usage of a plugin linter.
+ # Intended to point to the repo location of the linter. Optional, just for documentation purposes.
+ #original-url: github.com/golangci/example-linter
+
+linters:
+ # please, do not use `enable-all`: it's deprecated and will be removed soon.
+ # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
+ # enable-all: true
+ disable-all: true
+ enable:
+ - typecheck
+ - asciicheck
+ - bodyclose
+ - cyclop
+ - deadcode
+ - depguard
+ - dogsled
+ - dupl
+ - durationcheck
+ - errcheck
+ - errorlint
+ - exhaustive
+ - exportloopref
+ - forbidigo
+ - funlen
+ #- gci
+ - gochecknoinits
+ - gocognit
+ - goconst
+ - gocyclo
+ - godot
+ - godox
+ - gofmt
+ - gofumpt
+ - goheader
+ - goimports
+ - gomoddirectives
+ - gomodguard
+ - goprintffuncname
+ - gosec
+ - gosimple
+ - govet
+ - ifshort
+ - importas
+ - ineffassign
+ - lll
+ - makezero
+ - misspell
+ - nakedret
+ - nestif
+ - nilerr
+ - nlreturn
+ - noctx
+ - nolintlint
+ - paralleltest
+ - prealloc
+ - predeclared
+ - promlinter
+ - revive
+ - rowserrcheck
+ - sqlclosecheck
+ - staticcheck
+ - structcheck
+ - stylecheck
+ - thelper
+ - tparallel
+ - unconvert
+ - unparam
+ - unused
+ - varcheck
+ - wastedassign
+ - whitespace
+ - bidichk
+ - wastedassign
+ - golint
+ - execinquery
+ - nosprintfhostport
+ - grouper
+ - decorder
+ - errchkjson
+ - maintidx
+ #- containedctx
+ #- tagliatelle
+ #- nonamedreturns
+ #- nilnil
+ #- tenv
+ #- varnamelen
+ #- contextcheck
+ #- errname
+ #- ForceTypeAssert
+ #- nilassign
+ fast: false
+
+issues:
+ # List of regexps of issue texts to exclude, empty list by default.
+ # But independently from this option we use default exclude patterns,
+ # it can be disabled by `exclude-use-default: false`. To list all
+ # excluded by default patterns execute `golangci-lint run --help`
+ exclude:
+ - tools/.*
+ - test/.*
+ - third_party/.*
+
+ # Excluding configuration per-path, per-linter, per-text and per-source
+ exclude-rules:
+ - linters:
+ - errorlint
+ path: (pkg/validator/.*)\.go
+ - linters:
+ - revive
+ path: (log/.*)\.go
+
+ - linters:
+ - wrapcheck
+ path: (cmd/.*|pkg/.*)\.go
+
+ - linters:
+ - typecheck
+ #path: (pkg/storage/.*)\.go
+ path: (internal/.*|pkg/.*)\.go
+
+ - path: (cmd/.*|test/.*|tools/.*|internal/pump/pumps/.*)\.go
+ linters:
+ - forbidigo
+
+ - path: (cmd/[a-z]*/.*|store/.*)\.go
+ linters:
+ - dupl
+
+ - linters:
+ - gocritic
+ text: (hugeParam:|rangeValCopy:)
+
+ - path: (cmd/[a-z]*/.*)\.go
+ linters:
+ - lll
+
+ - path: (validator/.*|code/.*|validator/.*|watcher/watcher/.*)
+ linters:
+ - gochecknoinits
+
+ - path: (internal/.*/options|internal/pump|pkg/log/options.go|internal/authzserver|tools/)
+ linters:
+ - tagliatelle
+
+ - path: (pkg/app/.*)\.go
+ linters:
+ - deadcode
+ - unused
+ - varcheck
+ - forbidigo
+
+ # Exclude some staticcheck messages
+ - linters:
+ - staticcheck
+ text: "SA9003:"
+
+ # Exclude lll issues for long lines with go:generate
+ - linters:
+ - lll
+ source: "^//go:generate "
+
+ # Independently from option `exclude` we use default exclude patterns,
+ # it can be disabled by this option. To list all
+ # excluded by default patterns execute `golangci-lint run --help`.
+ # Default value for this option is true.
+ exclude-use-default: true
+
+ # The default value is false. If set to true exclude and exclude-rules
+ # regular expressions become case sensitive.
+ exclude-case-sensitive: false
+
+ # The list of ids of default excludes to include or disable. By default it's empty.
+ include:
+ - EXC0002 # disable excluding of issues about comments from golint
+
+ # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
+ max-issues-per-linter: 0
+
+ # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
+ max-same-issues: 0
+
+ # Show only new issues: if there are unstaged changes or untracked files,
+ # only those changes are analyzed, else only changes in HEAD~ are analyzed.
+ # It's a super-useful option for integration of golangci-lint into existing
+ # large codebase. It's not practical to fix all existing issues at the moment
+ # of integration: much better don't allow issues in new code.
+ # Default is false.
+ new: false
+
+ # Show only new issues created after git revision `REV`
+ # new-from-rev: REV
+
+ # Show only new issues created in git patch with set file path.
+ #new-from-patch: path/to/patch/file
+
+ # Fix found issues (if it's supported by the linter)
+ fix: true
+
+severity:
+ # Default value is empty string.
+ # Set the default severity for issues. If severity rules are defined and the issues
+ # do not match or no severity is provided to the rule this will be the default
+ # severity applied. Severities should match the supported severity names of the
+ # selected out format.
+ # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity
+ # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity
+ # - Github: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
+ default-severity: error
+
+ # The default value is false.
+ # If set to true severity-rules regular expressions become case sensitive.
+ case-sensitive: false
+
+ # Default value is empty list.
+ # When a list of severity rules are provided, severity information will be added to lint
+ # issues. Severity rules have the same filtering capability as exclude rules except you
+ # are allowed to specify one matcher per severity rule.
+ # Only affects out formats that support setting severity information.
+ rules:
+ - linters:
+ - dupl
+ severity: info
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..8e34456
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,439 @@
+# Contributing to OpenFY
+
+So, you want to hack on OpenFY? Yay!
+
+First of all, thank you for considering contributing to our project! We appreciate your time and effort, and we value any contribution, whether it's reporting a bug, suggesting a new feature, or submitting a pull request.
+
+This document provides guidelines and best practices to help you contribute effectively.
+
+## 📇Topics
+
+- [What we expect of you](#What-we-expect-of-you)
+- [Code of Conduct](#Code-of-Conduct)
+- [Getting Started](#Getting-Started)
+- [Style and Specification](#Style-and-Specification)
+- [Engage to help anything](#Engage-to-help-anything)
+- [Release version](#Release-version)
+- [Contact Us](#Contact-Us)
+
+
+
+## What we expect of you
+
+We hope that anyone can join OpenFY , even if you are a student, writer, translator
+
+Please meet the minimum version of the Go language published in [go.mod](./go.mod). If you want to manage the Go language version, we provide tools to install [gvm](https://github.com/moovweb/gvm) in our [Makefile](./Makefile)
+
+You'd better use Linux as the development environment, Linux with [Makefile](./Makefile) can help you quickly build and test OpenFY project.
+
+If you are familiar with [Makefile](./Makefile) , you can easily see the clever design of the OpenFY Makefile. Storing the necessary tools such as golangci in the `/tools` directory can avoid some tool version issues.
+
+The [Makefile](./Makefile) is for every developer, even if you don't know how to use the Makefile tool, don't worry, we provide two great commands to get you up to speed with the Makefile architecture, `make help` and `make help-all`, it can reduce problems of the developing environment.
+
+
+
+## Code of Conduct
+
+#### Code and doc contribution
+
+Every action to make project OpenFY better is encouraged. On GitHub, every improvement for OpenFY could be via a [PR](https://github.com/OpenFY/pulls) (short for pull request).
+
++ If you find a typo, try to fix it!
++ If you find a bug, try to fix it!
++ If you find some redundant codes, try to remove them!
++ If you find some test cases missing, try to add them!
++ If you could enhance a feature, please **DO NOT** hesitate!
++ If you find code implicit, try to add comments to make it clear!
++ If you find code ugly, try to refactor that!
++ If you can help to improve documents, it could not be better!
++ If you find document incorrect, just do it and fix that!
++ ...
+
+#### Where should I start?
+
+Getting good at GitHub is the first step, we have a [list of labes](https://github.com/OpenIMSDK/OpenFY/labels) and reading some of the [common tags](https://github.com/OpenIMSDK/OpenFY/labels?sort=count-desc) helps us get involved in the community quickly.GitHub allows you to filter out types of issues and pull requests, which helps you discover items in need of triaging. This table includes some predetermined searches for convenience:
+
+| Search | What it sorts |
+| ------------------------------------------------------------ | ------------------------------------------------------- |
+| [created-asc](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+sort%3Acreated-asc) | Untriaged issues by age |
+| [needs-triage](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+no%3Alabel) | Issues that need to be assigned to a Labels |
+| [`is:open is:issue`](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aopen+is%3Aissue+sort%3Aupdated-desc) | Newest incoming issues |
+| [comments-desc](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-desc) | Busiest untriaged issues, sorted by # of comments |
+| [comments-asc](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-asc) | Issues that need more attention, based on # of comments |
+
+We suggest preparing your triage by filtering out the oldest, unlabelled issues and pull requests first.
+
+1. If you are new to the project, don't know how to contribute OpenFY, please check out the [good first issue](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label and [help wanted](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted"+sort%3Aupdated-desc).
+2. You should be good at filtering the OpenFY issue tags and finding the ones you like, such as [RFC](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+label%3Akind%2Ffeature+sort%3Aupdated-desc+) proposals, and [bug](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+label%3Akind%2Fbug+sort%3Aupdated-desc+) fixes.
+3. If you are looking for something to work on, check out our [open issues](https://github.com/OpenIMSDK/OpenFY/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc).
+4. If you have an idea for a new feature, please [open an issue](https://github.com/OpenIMSDK/OpenFY/issues/new/choose), and we can discuss it.
+
+> **Note**
+> Reply to `/assign` or `/assign @yourself` with a question you wish to resolve, and we'll assign the question to you and your name will be listed under `Assignees`
+
+
+
+#### 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/OpenFY/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/OpenIMSDK/OpenFY/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.
+
+In addition to that, we'd love to invite you to [Join Our Slack]({slack}) where you can play with your imagination, tell us what you're working on, and get a quick response.
+
+When documenting a new design, we recommend a 2-step approach:
+
+1. Use the short-form **RFC** template to outline your ideas and get early feedback.
+2. Once you have received sufficient feedback and consensus, you may use the **longer-form design doc template** to specify and discuss your design in more details.
+
+**In order to contribute a feature to OpenFY you'll need to go through the following steps:**
+
++ Discuss your idea with the appropriate [working groups]({slack}) on the working group's Slack channel.
++ Once there is general agreement that the feature is useful, create a GitHub issue to track the discussion. The issue should include information about the requirements and use cases that it is trying to address.
++ Include a discussion of the proposed design and technical details of the implementation in the issue.
+
+But keep in mind that there is no guarantee of it being accepted and so it is usually best to get agreement on the **idea/design** before time is spent coding it. However, sometimes seeing the exact code change can help focus discussions, so the choice is up to you.
+
+
+
+## Getting Started
+
+> **Note**
+>
+> A simple example allows you to quickly contribute your first **PR** to OpenFY.
+> To propose PR for the OpenFY item, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps:
+
+1. **Fork** the repository(OpenFY)
+
+2. **CLONE** your own repository to master locally. Use `git clone https://github.com//OpenFY.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/OpenFY.git` using the following two commands:
+
+ ```bash
+ ❯ git remote add upstream https://github.com/OpenIMSDK/OpenFY.git
+ ❯ git remote set-url --push upstream no-pushing
+ ```
+
+ With this remote setting, you can check your **git remote configuration** like this:
+
+ ```go
+ ❯ git remote -v
+ origin https://github.com//OpenFY.git (fetch)
+ origin https://github.com//OpenFY.git (push)
+ upstream https://github.com/OpenIMSDK/OpenFY.git (fetch)
+ upstream no-pushing (push)
+ ```
+
+ Adding this, we can easily synchronize local branches with upstream branches.
+
+4. Create a new branch for your changes (use a descriptive name, such as `fix/bug-123` or `feature/add-new-xxx` and `release/xxx`).
+
+ ```bash
+ ❯ cd OpenFY
+ ❯ git fetch upstream
+ ❯ git checkout upstream/main
+ ```
+
+ > **Note**
+ >
+ > Please don't use `git pull` instead of the above `fetch` and `rebase`. Since `git pull` executes a merge, it creates merge commits. These make the commit history messy and violate the principle that commits ought to be individually understandable and useful.
+ >
+ > You might also consider changing your `.git/config` file via `git config branch.autoSetupRebase always` to change the behavior of `git pull`, or another non-merge option such as `git pull --rebase`.
+
+ Create a new branch:
+
+ ```bash
+ ❯ git checkout -b
+ ```
+
+ Make any change on the `new-branch` then use [Makefile](./Makefile) **build** and **test** your codes.
+
+5. **Commit your changes** to your local branch, lint before committing and commit with sign-off
+
+ ```bash
+ ❯ git rebase upstream/main
+ ❯ make lint # golangci-lint run -c .golangci.yml
+ ❯ git add -A # add changes to staging
+ ❯ git commit -a -s -m "fix: message for your changes" # -s adds a Signed-off-by trailer
+ ```
+
+6. **Push your branch** to your forked repository, it is recommended to have only one commit for a **PR**.
+
+ ```bash
+ # sync up with upstream
+ ❯ git fetch upstream
+ ❯ git rebase upstream/main
+ ❯ git rebase -i # rebase with interactive mode to `squash` your commits into a single one
+ ❯ git push # push to the remote repository, if it's a first time push, run git push --set-upstream origin
+ ```
+
+ You can also use `git commit -s --amend && git push -f` to update modifications on the previous commit.
+
+ If you have developed multiple features in the same branch, you should create PR separately by rebasing to the main branch between each push:
+
+ ```bash
+ # create new branch, for example git checkout -b feature/infra
+ ❯ git checkout -b
+ # update some code, feature1
+ ❯ git add -A
+ ❯ git commit -m -s "feat: feature one"
+ ❯ git push # if it's first time push, run git push --set-upstream origin
+ # then create pull request, and merge
+ # update some new feature, feature2, rebase main branch first.
+ ❯ git rebase upstream/main # rebase the current branch to upstream/main branch
+ ❯ git add -A
+ ❯ git commit -m -s "feat: feature two"
+ # then create pull request, and merge
+ ```
+
+7. **Open a pull request** to `OpenIMSDK/OpenFY:main`
+
+ It is recommended to review your changes before filing a pull request. Check if your code doesn't conflict with the main branch and no redundant code is included.
+
+
+
+## Style and Specification
+
+We divide the problem into security and general problems:
+
+#### Reporting security issues
+
+Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of OpenFY, please do not discuss it in public and even do not open a public issue.
+
+Instead we encourage you to send us a private email to {email} to report this.
+
+#### Reporting general issues
+
+To be honest, we regard every user of OpenFYas a very kind contributor. After experiencing OpenFY, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/OpenIMSDK/OpenFY/issues/new/choose).
+
+Since we collaborate project OpenFY 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/OpenFY/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:**
+
++ bug report
++ feature request
++ OpenFY performance issues
++ feature proposal
++ feature design
++ help wanted
++ doc incomplete
++ test improvement
++ any questions on OpenFY project
++ and so on
+
+Also, we must be reminded when submitting a new question about OpenFY, please remember to remove the sensitive data from your post. Sensitive data could be password, secret key, network locations, private business data and so on.
+
+> **Note**
+> We have requirements for **Commits**, **PR**, **Docs**, and good standards help us collaborate better and understand what you're doing.
+
+#### Commit Rules
+
+Actually in OpenFY, we take two rules serious when committing:
+
+**🥇 Commit Message:**
+
+Commit message could help reviewers better understand what the purpose of submitted PR is. It could help accelerate the code review procedure as well. We encourage contributors to use **EXPLICIT** commit message rather than ambiguous message. In general, we advocate the following commit message type:
+
+We use [Semantic Commits](https://www.conventionalcommits.org/en/v1.0.0/) to make it easier to understand what a commit does and to build pretty changelogs. Please use the following prefixes for your commits:
+
++ `docs: xxxx`. For example, "docs: add docs about storage installation".
++ `feature: xxxx`.For example, "feature: make result show in sorted order".
++ `bugfix: xxxx`. For example, "bugfix: fix panic when input nil parameter".
++ `style: xxxx`. For example, "style: format the code style of Constants.java".
++ `refactor: xxxx.` For example, "refactor: simplify to make codes more readable".
++ `test: xxx`. For example, "test: add unit test case for func InsertIntoArray".
++ `chore: xxx.` For example, "chore: integrate travis-ci". It's the type of mantainance change.
++ other readable and explicit expression ways.
+
+On the other side, we discourage contributors from committing message like the following ways:
+
++ ~~fix bug~~
++ ~~update~~
++ ~~add doc~~
+
+**🥈 Commit Content:**
+
+Commit content represents all content changes included in one commit. We had better include things in one single commit which could support reviewer's complete review without any other commits' help.
+
+In another word, contents in one single commit can pass the CI to avoid code mess. In brief, there are two minor rules for us to keep in mind:
+
+1. avoid very large change in a commit.
+2. complete and reviewable for each commit.
+3. words are written in lowercase English, not uppercase English or other languages such as Chinese.
+
+No matter what the commit message, or commit content is, we do take more emphasis on code review.
+
+An example for this could be:
+
+```bash
+❯ git commit -a -s -m "docs: add a new section to the readme"
+```
+
+#### PR Description
+
+PR is the only way to make change to OpenFY 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/OpenFY/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/OpenFY/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them.
+
+**📖 Opening PRs:**
+
++ As long as you are working on your **PR**, please mark it as a draft.
++ Please make sure that your **PR** is up-to-date with the latest changes in `main`
++ Mention the issue that your **PR** is addressing. For example, `Fixes: #{ID_1}, #{ID_2}`
++ Make sure that your **PR** passes all checks.
+
+**🈴 Reviewing PRs:**
+
++ Be respectful and constructive.
++ Assign yourself to the **PR**.
++ Check if all checks are passing.
++ Suggest changes instead of simply commenting on found issues.
++ If you are unsure about something, ask the author.
++ If you are not sure if the changes work, try them out.
++ Reach out to other reviewers if you are unsure about something.
++ If you are happy with the changes, approve the **PR**.
++ Merge the **PR** once it has all approvals and the checks are passing.
+
+**⚠️ DCO check:**
+
+We have a [DCO check](https://github.com/apps/dco) which runs on every **PR** to verify that the commit has been signed off.
+
+Once [installed](https://github.com/apps/dco#usage), this integration will set the [status](https://developer.github.com/v3/repos/statuses/) to `failed` if commits in a **Pull Request** do not contain a valid `Signed-off-by` line.
+
+To sign off the last commit you made, you can use:
+
+```bash
+❯ git commit --amend --signoff
+```
+
+Contributors *sign-off* that they adhere to these requirements by adding a `Signed-off-by` line to commit messages.
+
+Git even has a `-s` command line option to append this automatically to your commit message:
+
+```bash
+❯ git commit -s -m "docs: this is my commit message"
+```
+
+You can also automate signing off your commits by adding the following to your `.zshrc` or `.bashrc`:
+
+```bash
+❯ cat ~/.bashrc || cat ~/.zshrc
+git() {
+ if [ $# -gt 0 ] && [[ "$1" == "commit" ]] ; then
+ shift
+ command git commit --signoff "$@"
+ else
+ command git "$@"
+ fi
+}
+```
+
+
+#### CI actions
+
+We host CI on [GitHub Actions](https://github.com/OpenIMSDK/OpenFY/actions), we will make sure PR pass tests before we can merge it.
+
+These two kind of tests: `lint` and `unit test`
+
+`lint` tests if your code matches our code conventions, please consult [golangci-lint](https://golangci-lint.run/) and [lint config](https://github.com/OpenIMSDK/OpenFY/blob/main/.golangci.yml)
+
+> **Note**
+>
+> You can use the [Makefile](./Makefile) to run Lint with the command `make lint`.
+
+
+`unit test` runs all the test in code, and the code coverage should not less than 60 percent, record us in [codeclimate](https://codeclimate.com/github/OpenIMSDK/OpenFY) OpenFY the unit test coverage data.
+
+
+> **Note**
+>
+> We use the [Makefile](./Makefile) utility, `make tese` to run the unit tests, and the `make cover` utility to check the unit test coverage.
+
+Try your best to keep every function has been tested, it keeps the function behaves as intended.
+
+#### Docs Contribution
+
+**The documentation for OpenFY includes:**
+
++ [README.md](https://github.com/OpenIMSDK/OpenFY/blob/main/README.md): This file includes the basic information and instructions for getting started with OpenFY.
++ [CONTRIBUTING.md](https://github.com/OpenIMSDK/OpenFY/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to OpenFY's codebase, such as how to submit issues, pull requests, and code reviews.
++ [DEVELOPGUIDE.md](https://github.com/OpenIMSDK/OpenFY/blob/main/DEVELOPGUIDE.md): This file provides a more in-depth guide to developing OpenFY, including information on the project's architecture, coding conventions, and testing practices.
++ [Official Documentation]({blog}): This is the official documentation for OpenFY, 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.**
+
+1. Please do not use Chinese punctuations in English docs, and vice versa.
+2. Please use upper case letters where applicable, like the first letter of sentences / headings, etc.
+3. Please specify a language for each Markdown code blocks, unless there's no associated languages.
+4. Please insert a whitespace between Chinese and English words.
+5. Please use the correct case for technical terms, such as using `HTTP` instead of http, `MySQL` rather than mysql, `Kubernetes` instead of kubernetes, etc.
+6. Please check if there's any typos in the docs before submitting PRs.
+
+**Markfile Lint:**
+We integrated in the CICD actions [markdownlint](https://github.com/markdownlint/markdownlint), it detects Markfile specification.
+
+> **Note**
+> We recommend reading [markdownlint rules](https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md), This document contains a description of all rules, what they are checking for, as well as an examples of documents that break the rule and corrected versions of the examples.
+
+
+
+
+## Engage to help anything
+
+We choose GitHub as the primary place for OpenFY to collaborate. So the latest updates of OpenFY 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/OpenFY/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/OpenFY/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design;
++ discuss about OpenFY to make things clearer;
++ advocate [OpenFY](google.com/search?q=OpenFY) technology beyond GitHub;
++ write blogs on OpenFY and so on.
+
+In a word, **ANY HELP IS CONTRIBUTION.**
+
+
+
+## Release version
+
+Releases of OpenFY are done using [Release Please](https://github.com/googleapis/release-please) and [GoReleaser](https://goreleaser.com/). The workflow looks like this:
+
+🎯 **A PR is merged to the `main` branch:**
+
++ Release please is triggered, creates or updates a new release PR
++ This is done with every merge to main, the current release PR is updated every time
+
+🎯 **Merging the 'release please' PR to `main`:**
+
++ Release please is triggered, creates a new release and updates the changelog based on the commit messages
++ GoReleaser is triggered, builds the binaries and attaches them to the release
++ Containers are created and pushed to the container registry
+
+With the next relevant merge, a new release PR will be created and the process starts again
+
+👀 **Manually setting the version:**
+
+If you want to manually set the version, you can create a PR with an empty commit message that contains the version number in the commit message. For example:
+
+Such a commit can get produced as follows:
+
+````bash
+❯ git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: 0.0.3
+````
+
+
+## Contact Us
+
+We value close connections with our users, developers, and contributors here at OpenKF. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.
+
+Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg). Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of OpenKF. You can ask technical questions, seek help, or share your experiences with other users of OpenKF.
+
+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 [👀 OpenKF 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 OpenKF 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 OpenKF. 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.
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f49a4e1
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ 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.
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..906f4a9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,452 @@
+# Copyright 2023 OpenIMSDK. 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/OpenIMSDK/OpenKF
+OUT_DIR=$(REPO_ROOT)/_output
+# ==============================================================================
+
+# 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 ?= ghcr.io/OpenIMSDK/OpenKF: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
+PLATFORMS ?= linux_amd64 linux_arm64
+# The OS can be linux/windows/darwin when building binaries
+# PLATFORMS ?= darwin_amd64 windows_amd64 linux_amd64 linux_arm64
+
+# 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
+
+# Copy githook scripts when execute makefile
+# TODO! GIT_FILE_SIZE_LIMIT=42000000 git commit -m "This commit is allowed file sizes up to 42MB"
+COPY_GITHOOK:=$(shell cp -f scripts/githooks/* .git/hooks/; chmod +x .git/hooks/*)
+
+# 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.18|1.19|1.20
+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 -u +'%Y-%m-%dT%H:%M:%SZ')
+ifneq ($(DLV),)
+ GO_BUILD_FLAGS += -gcflags "all=-N -l"
+ LDFLAGS = ""
+endif
+GO_BUILD_FLAGS += -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 ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/cmd/*))
+BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd}))
+
+ifeq (${COMMANDS},)
+ $(error Could not determine COMMANDS, set ROOT_DIR or run in source dir)
+endif
+ifeq (${BINS},)
+ $(error Could not determine BINS, set ROOT_DIR or run in source dir)
+endif
+
+EXCLUDE_TESTS=github.com/OpenIMSDK/OpenKF/test
+
+# ==============================================================================
+# Build
+
+## all: Build all the necessary targets.
+.PHONY: all
+all: copyright-verify build # tidy lint cover
+
+## 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)
+ @CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_PACKAGE)/cmd/$(COMMAND)
+
+## 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
+
+## 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:
+ @echo "===========> Run golangci to lint source codes"
+ @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
+ @$(GO) test -cover
+
+## docker-build: Build docker image with the manager.
+.PHONY: docker-build
+docker-build: test
+ 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 "OpenIMSDK 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)
+ @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
+install.go-gitlint:
+ @$(GO) install github.com/marmotedu/go-gitlint/cmd/go-gitlint@latest
+
+.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/OpenIMSDK/OpenKF/ cos://OpenIMSDK-1306374445/code/ -e cos.ap-hongkong.myqcloud.com
+# https://cloud.tencent.com/document/product/436/71763
+# OpenIMSDK/*
+# - 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/script/gvm"
+ @bash < <(curl -s -S -L https://raw.gitee.com/moovweb/gvm/master/binscripts/gvm-installer)
+ @$(shell source /root/.gvm/script/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)/script/install/install.sh iam::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
new file mode 100644
index 0000000..6a9ce4c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,97 @@
+
+
+ ⭐️ Template for a typical module written on Go. ⭐️
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ English •
+ 中文
+
+
+
+
+----
+
+## 🧩 Awesome features
+
+
+
+## 🛫 Quick start
+
+> **Note**: You can get started quickly with OpenKF.
+
+1. Generate a [new repository](https://github.com/OpenIMSDK/OpenKF/generate) from the template.
+2. Clone the repository locally.
+3. Update files, read the README files in each directory.
+4. Write your code and tests.
+
+
+
+
+```bash
+
+```
+
+
+
+
+
+## 🕋 architecture diagram
+```mermaid
+```
+
+**MVC Architecture Design:**
+```mermaid
+```
+
+## 🤖 File Directory Description
+
+Catalog standardization design structure:
+
+```bash
+```
+
+## 🗓️ community meeting
+
+We want anyone to get involved in our community, we offer gifts and rewards, and we welcome you to join us every Thursday night.
+
+We take notes of each [biweekly meeting](https://github.com/orgs/OpenIMSDK/discussions/categories/meeting) in [GitHub discussions](https://github.com/OpenIMSDK/OpenKF/discussions/categories/meeting), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing).
+
+
+## 🤼 Contributing & Development
+
+OpenIMSDK Our goal is to build a top-level open source community. We have a set of standards, in the [Community repository](https://github.com/OpenIMSDK/community).
+
+If you'd like to contribute to this OpenKF repository, please read our [contributor documentation](https://github.com/OpenIMSDK/OpenKF/blob/main/CONTRIBUTING.md).
+
+Before you start, please make sure your changes are in demand. The best for that is to create a [new discussion](https://github.com/OpenIMSDK/OpenKF/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg), or if you find an issue, [report it](https://github.com/OpenIMSDK/OpenKF/issues/new/choose) first.
+
+
+## 🚨 License
+
+OpenIMSDK is licensed under the Apache 2.0 license. See [LICENSE](https://github.com/OpenIMSDK/OpenKF/tree/main/LICENSE) for the full license text.
+
+[](https://app.fossa.com/projects/git%2Bgithub.com%2FOpenIMSDK%2FOpenKF?ref=badge_large)
+
+
+## 🔮 Thanks to our contributors!
+
+
+
+
diff --git a/README_zh-CN.md b/README_zh-CN.md
new file mode 100644
index 0000000..e69de29
diff --git a/api/OWNERS b/api/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/api/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/api/README.md b/api/README.md
new file mode 100644
index 0000000..94db6c9
--- /dev/null
+++ b/api/README.md
@@ -0,0 +1,11 @@
+# `/api`
+
+OpenAPI/Swagger specs, JSON schema files, protocol definition files.
+
+Examples:
+
+* https://github.com/kubernetes/kubernetes/tree/master/api
+* https://github.com/moby/moby/tree/master/api
+
+**recommended reading:**
++ [https://google.aip.dev/](https://google.aip.dev/)
\ No newline at end of file
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 0000000..f236483
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,3 @@
+# `/assets`
+
+Other assets to go along with your repository (images, logos, etc).
\ No newline at end of file
diff --git a/build/OWNERS b/build/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/build/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/build/README.md b/build/README.md
new file mode 100644
index 0000000..00bfce3
--- /dev/null
+++ b/build/README.md
@@ -0,0 +1,11 @@
+# `/build`
+
+Packaging and Continuous Integration.
+
+Put your cloud (AMI), container (Docker), OS (deb, rpm, pkg) package configurations and scripts in the `/build/package` directory.
+
+Put your CI (travis, circle, drone) configurations and scripts in the `/build/ci` directory. Note that some of the CI tools (e.g., Travis CI) are very picky about the location of their config files. Try putting the config files in the `/build/ci` directory linking them to the location where the CI tools expect them when possible (don't worry if it's not and if keeping those files in the root directory makes your life easier :-)).
+
+Examples:
+
+* https://github.com/cockroachdb/cockroach/tree/master/build
\ No newline at end of file
diff --git a/cmd/OWNERS b/cmd/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/cmd/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/cmd/README.md b/cmd/README.md
new file mode 100644
index 0000000..194e966
--- /dev/null
+++ b/cmd/README.md
@@ -0,0 +1,19 @@
+# `/cmd`
+
+Main applications for this project.
+
+The directory name for each application should match the name of the executable you want to have (e.g., `/cmd/myapp`).
+
+Don't put a lot of code in the application directory. If you think the code can be imported and used in other projects, then it should live in the `/pkg` directory. If the code is not reusable or if you don't want others to reuse it, put that code in the `/internal` directory. You'll be surprised what others will do, so be explicit about your intentions!
+
+It's common to have a small `main` function that imports and invokes the code from the `/internal` and `/pkg` directories and nothing else.
+
+Examples:
+
+* https://github.com/vmware-tanzu/velero/tree/main/cmd (just a really small `main` function with everything else in packages)
+* https://github.com/moby/moby/tree/master/cmd
+* https://github.com/prometheus/prometheus/tree/main/cmd
+* https://github.com/influxdata/influxdb/tree/master/cmd
+* https://github.com/kubernetes/kubernetes/tree/master/cmd
+* https://github.com/dapr/dapr/tree/master/cmd
+* https://github.com/ethereum/go-ethereum/tree/master/cmd
\ No newline at end of file
diff --git a/configs/OWNERS b/configs/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/configs/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/configs/README.md b/configs/README.md
new file mode 100644
index 0000000..136f8ad
--- /dev/null
+++ b/configs/README.md
@@ -0,0 +1,5 @@
+# `/configs`
+
+Configuration file templates or default configs.
+
+Put your `confd` or `consul-template` template files here.
\ No newline at end of file
diff --git a/configs/config.yaml b/configs/config.yaml
new file mode 100644
index 0000000..039a025
--- /dev/null
+++ b/configs/config.yaml
@@ -0,0 +1,3 @@
+# Copyright © 2023 OpenIMSDK open source community. All rights reserved.
+# Licensed under the MIT License (the "License");
+# you may not use this file except in compliance with the License.
diff --git a/deploy/OWNERS b/deploy/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/deploy/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/deploy/README.md b/deploy/README.md
new file mode 100644
index 0000000..eab36f1
--- /dev/null
+++ b/deploy/README.md
@@ -0,0 +1,3 @@
+# `/deployments`
+
+IaaS, PaaS, system and container orchestration deployment configurations and templates (docker-compose, kubernetes/helm, mesos, terraform, bosh).
\ No newline at end of file
diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS
new file mode 100644
index 0000000..3dfaee5
--- /dev/null
+++ b/docs/CODEOWNERS
@@ -0,0 +1,59 @@
+# This is a comment.
+# Each line is a file pattern followed by one or more owners.
+
+# These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence,
+# @cubxxw and @kubbot will be requested for
+# review when someone opens a pull request.
+* @cubxxw @kubbot
+
+# Order is important; the last matching pattern takes the most
+# precedence. When someone opens a pull request that only
+# modifies JS files, only @js-owner and not the global
+# owner(s) will be requested for a review.
+*.js @cubxxw #This is an inline comment.
+
+# You can also use email addresses if you prefer. They'll be
+# used to look up users just like we do for commit author
+# emails.
+*.go 3293172751nss@gmail.com
+
+# Teams can be specified as code owners as well. Teams should
+# be identified in the format @org/team-name. Teams must have
+# explicit write access to the repository. In this example,
+# the OpenIMSDK team in the github organization owns all .txt files.
+*.txt @cubxxw
+
+# In this example, @cubxxw owns any files in the build/
+# directory at the root of the repository and any of its
+# subdirectories.
+/build/* @cubxxw
+
+# The `docs/*` pattern will match files like
+# `docs/getting-started.md` but not further nested files like
+# `docs/build-app/troubleshooting.md`.
+docs/* 3293172751nss@gmail.com
+
+# In this example, @octocat owns any file in an apps directory
+# anywhere in your repository.
+api/ @cubxxw
+
+# In this example, @cubxxw owns any file in the `/docs`
+# directory in the root of your repository and any of its
+# subdirectories.
+/docs/ @cubxxw
+
+# In this example, any change inside the `/scripts` directory
+# will require approval from @cubxxw or @octocat.
+/scripts/ @cubxxw @kubbot
+
+# In this example, @octocat owns any file in a `/logs` directory such as
+# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
+# in a `/logs` directory will require approval from @octocat.
+**/logs @cubxxw
+
+# In this example, @octocat owns any file in the `/apps`
+# directory in the root of your repository except for the `/apps/github`
+# subdirectory, as its owners are left empty.
+/apps/ @cubxxw
+/apps/github
\ No newline at end of file
diff --git a/docs/OWNERS b/docs/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/docs/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..5933803
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,9 @@
+# `/docs`
+
+Design and user documents (in addition to your godoc generated documentation).
+
+Examples:
+
+* https://github.com/gohugoio/hugo/tree/master/docs
+* https://github.com/openshift/origin/tree/master/docs
+* https://github.com/dapr/dapr/tree/master/docs
\ No newline at end of file
diff --git a/examples/OWNERS b/examples/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/examples/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..ba10965
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,9 @@
+# `/examples`
+
+Examples for your applications and/or public libraries.
+
+Examples:
+
+* https://github.com/nats-io/nats.go/tree/master/examples
+* https://github.com/docker-slim/docker-slim/tree/master/examples
+* https://github.com/hashicorp/packer/tree/master/examples
\ No newline at end of file
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..aaf90e6
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module github.com/OpenIMSDK/OpenKF
+
+go 1.18
diff --git a/init/OWNERS b/init/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/init/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/init/README.md b/init/README.md
new file mode 100644
index 0000000..c805e22
--- /dev/null
+++ b/init/README.md
@@ -0,0 +1,3 @@
+# `/init`
+
+System init (systemd, upstart, sysv) and process manager/supervisor (runit, supervisord) configs.
\ No newline at end of file
diff --git a/internal/OWNERS b/internal/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/internal/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/internal/README.md b/internal/README.md
new file mode 100644
index 0000000..de4660a
--- /dev/null
+++ b/internal/README.md
@@ -0,0 +1,34 @@
+# `/internal`
+
+Private application and library code. This is the code you don't want others importing in their applications or libraries. Note that this layout pattern is enforced by the Go compiler itself. See the Go 1.4 [`release notes`](https://golang.org/doc/go1.4#internalpackages) for more details. Note that you are not limited to the top level `internal` directory. You can have more than one `internal` directory at any level of your project tree.
+
+You can optionally add a bit of extra structure to your internal packages to separate your shared and non-shared internal code. It's not required (especially for smaller projects), but it's nice to have visual clues showing the intended package use. Your actual application code can go in the `/internal/app` directory (e.g., `/internal/app/myapp`) and the code shared by those apps in the `/internal/pkg` directory (e.g., `/internal/pkg/myprivlib`).
+
+For example, if you have a directory structure like this:
+```go
+myapp/
+ internal/
+ util.go
+ main.go
+```
+
+myapp/internal/util.go can only be referenced within the myapp module. For example, main.go can import "myapp/internal/util".
+But code from other modules cannot import myapp/internal. If you try to import "myapp/internal/util", the compiler will report an error:
+```bash
+cannot use "myapp/internal/util" as external package name: myapp/internal/util.go: does not export package internal
+```
+
+Examples:
+
+* https://github.com/hashicorp/terraform/tree/main/internal
+* https://github.com/influxdata/influxdb/tree/master/internal
+* https://github.com/perkeep/perkeep/tree/master/internal
+* https://github.com/jaegertracing/jaeger/tree/main/internal
+* https://github.com/moby/moby/tree/master/internal
+* https://github.com/satellity/satellity/tree/main/internal
+
+## `/internal/pkg`
+
+Examples:
+
+* https://github.com/hashicorp/waypoint/tree/main/internal/pkg
\ No newline at end of file
diff --git a/internal/utils/utils.go b/internal/utils/utils.go
new file mode 100644
index 0000000..bdb77fa
--- /dev/null
+++ b/internal/utils/utils.go
@@ -0,0 +1,5 @@
+// Copyright © 2023 OpenIMSDK open source community. All rights reserved.
+// Licensed under the MIT License (the "License");
+// you may not use this file except in compliance with the License.
+
+package utils
diff --git a/pkg/OWNERS b/pkg/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/pkg/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/pkg/README.md b/pkg/README.md
new file mode 100644
index 0000000..8fff56d
--- /dev/null
+++ b/pkg/README.md
@@ -0,0 +1,55 @@
+# `/pkg`
+
+Library code that's ok to use by external applications (e.g., `/pkg/mypubliclib`). Other projects will import these libraries expecting them to work, so think twice before you put something here :-) Note that the `internal` directory is a better way to ensure your private packages are not importable because it's enforced by Go. The `/pkg` directory is still a good way to explicitly communicate that the code in that directory is safe for use by others. The [`I'll take pkg over internal`](https://travisjeffery.com/b/2019/11/i-ll-take-pkg-over-internal/) blog post by Travis Jeffery provides a good overview of the `pkg` and `internal` directories and when it might make sense to use them.
+
+It's also a way to group Go code in one place when your root directory contains lots of non-Go components and directories making it easier to run various Go tools (as mentioned in these talks: [`Best Practices for Industrial Programming`](https://www.youtube.com/watch?v=PTE4VJIdHPg) from GopherCon EU 2018, [GopherCon 2018: Kat Zien - How Do You Structure Your Go Apps](https://www.youtube.com/watch?v=oL6JBUk6tj0) and [GoLab 2018 - Massimiliano Pippi - Project layout patterns in Go](https://www.youtube.com/watch?v=3gQa1LWwuzk)).
+
+Note that this is not a universally accepted pattern and for every popular repo that uses it you can find 10 that don't. It's up to you to decide if you want to use this pattern or not. Regardless of whether or not it's a good pattern more people will know what you mean than not. It might a bit confusing for some of the new Go devs, but it's a pretty simple confusion to resolve and that's one of the goals for this project layout repo.
+
+Ok not to use it if your app project is really small and where an extra level of nesting doesn't add much value (unless you really want to). Think about it when it's getting big enough and your root directory gets pretty busy (especially if you have a lot of non-Go app components).
+
+
+Examples:
+
+* https://github.com/jaegertracing/jaeger/tree/master/pkg
+* https://github.com/istio/istio/tree/master/pkg
+* https://github.com/GoogleContainerTools/kaniko/tree/master/pkg
+* https://github.com/google/gvisor/tree/master/pkg
+* https://github.com/google/syzkaller/tree/master/pkg
+* https://github.com/perkeep/perkeep/tree/master/pkg
+* https://github.com/heptio/ark/tree/master/pkg
+* https://github.com/argoproj/argo/tree/master/pkg
+* https://github.com/heptio/sonobuoy/tree/master/pkg
+* https://github.com/helm/helm/tree/master/pkg
+* https://github.com/kubernetes/kubernetes/tree/master/pkg
+* https://github.com/kubernetes/kops/tree/master/pkg
+* https://github.com/moby/moby/tree/master/pkg
+* https://github.com/grafana/grafana/tree/master/pkg
+* https://github.com/influxdata/influxdb/tree/master/pkg
+* https://github.com/cockroachdb/cockroach/tree/master/pkg
+* https://github.com/derekparker/delve/tree/master/pkg
+* https://github.com/etcd-io/etcd/tree/master/pkg
+* https://github.com/oklog/oklog/tree/master/pkg
+* https://github.com/flynn/flynn/tree/master/pkg
+* https://github.com/jesseduffield/lazygit/tree/master/pkg
+* https://github.com/gopasspw/gopass/tree/master/pkg
+* https://github.com/sosedoff/pgweb/tree/master/pkg
+* https://github.com/GoogleContainerTools/skaffold/tree/master/pkg
+* https://github.com/knative/serving/tree/master/pkg
+* https://github.com/grafana/loki/tree/master/pkg
+* https://github.com/bloomberg/goldpinger/tree/master/pkg
+* https://github.com/Ne0nd0g/merlin/tree/master/pkg
+* https://github.com/jenkins-x/jx/tree/master/pkg
+* https://github.com/DataDog/datadog-agent/tree/master/pkg
+* https://github.com/dapr/dapr/tree/master/pkg
+* https://github.com/cortexproject/cortex/tree/master/pkg
+* https://github.com/dexidp/dex/tree/master/pkg
+* https://github.com/pusher/oauth2_proxy/tree/master/pkg
+* https://github.com/pdfcpu/pdfcpu/tree/master/pkg
+* https://github.com/weaveworks/kured/tree/master/pkg
+* https://github.com/weaveworks/footloose/tree/master/pkg
+* https://github.com/weaveworks/ignite/tree/master/pkg
+* https://github.com/tmrts/boilr/tree/master/pkg
+* https://github.com/kata-containers/runtime/tree/master/pkg
+* https://github.com/okteto/okteto/tree/master/pkg
+* https://github.com/solo-io/squash/tree/master/pkg
\ No newline at end of file
diff --git a/pkg/version/version.go b/pkg/version/version.go
new file mode 100644
index 0000000..f37d99d
--- /dev/null
+++ b/pkg/version/version.go
@@ -0,0 +1 @@
+package version
diff --git a/scripts/LICENSE/LICENSE.md b/scripts/LICENSE/LICENSE.md
new file mode 100644
index 0000000..65d5032
--- /dev/null
+++ b/scripts/LICENSE/LICENSE.md
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 OpenIMSDK open source community
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/scripts/LICENSE/LICENSE_TEMPLATES b/scripts/LICENSE/LICENSE_TEMPLATES
new file mode 100644
index 0000000..dbc5ce2
--- /dev/null
+++ b/scripts/LICENSE/LICENSE_TEMPLATES
@@ -0,0 +1,13 @@
+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/OWNERS b/scripts/OWNERS
new file mode 100644
index 0000000..c1327a0
--- /dev/null
+++ b/scripts/OWNERS
@@ -0,0 +1,6 @@
+reviewers:
+ - cubxxw
+ - kubbot
+approvers:
+ - cubxxw
+ - kubbot
\ No newline at end of file
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644
index 0000000..edb724e
--- /dev/null
+++ b/scripts/README.md
@@ -0,0 +1,11 @@
+# `/scripts`
+
+Scripts to perform various build, install, analysis, etc operations.
+
+These scripts keep the root level Makefile small and simple.
+
+Examples:
+
+* https://github.com/kubernetes/helm/tree/master/scripts
+* https://github.com/cockroachdb/cockroach/tree/master/scripts
+* https://github.com/hashicorp/terraform/tree/master/scripts
\ No newline at end of file
diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg
new file mode 100644
index 0000000..68b0e19
--- /dev/null
+++ b/scripts/githooks/commit-msg
@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+
+# Copyright © 2023 OpenIMSDK & Xinwei Xiong(cubxxw). All rights reserved.
+#
+# Licensed under the MIT License (the "License");
+# you may not use this file except in compliance with 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 script 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 script 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}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running the OpenIMSDK 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
+GITLINT_DIR="./_output/tools/go-gitlint"
+
+$GITLINT_DIR \
+ --msg-file=$1 \
+ --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|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 OpenIMSDK coding standards"
+ printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
+ exit 1
+fi
\ No newline at end of file
diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit
new file mode 100644
index 0000000..54c6dbb
--- /dev/null
+++ b/scripts/githooks/pre-commit
@@ -0,0 +1,90 @@
+#!/usr/bin/env bash
+
+# Copyright © 2023 OpenIMSDK & Xinwei Xiong(cubxxw). All rights reserved.
+#
+# Licensed under the MIT License (the "License");
+# you may not use this file except in compliance with 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"
+#
+# ==============================================================================
+
+
+YELLOW="\e[93m"
+GREEN="\e[32m"
+RED="\e[31m"
+ENDCOLOR="\e[0m"
+
+printMessage() {
+ printf "${YELLOW}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running local OpenIMSDK 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
\ No newline at end of file
diff --git a/scripts/githooks/pre-push b/scripts/githooks/pre-push
new file mode 100644
index 0000000..8c78998
--- /dev/null
+++ b/scripts/githooks/pre-push
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+# Copyright © 2023 OpenIMSDK & Xinwei Xiong(cubxxw). All rights reserved.
+#
+# Licensed under the MIT License (the "License");
+# you may not use this file except in compliance with the License.
+
+YELLOW="\e[93m"
+GREEN="\e[32m"
+RED="\e[31m"
+ENDCOLOR="\e[0m"
+
+printMessage() {
+ printf "${YELLOW}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}OpenIMSDK : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running local OpenIMSDK pre-push hook."
+
+if [[ `git status --porcelain` ]]; then
+ printError "This script needs to run against committed code only. Please commit or stash you changes."
+ 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/test/OWNERS b/test/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/test/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/test/README.md b/test/README.md
new file mode 100644
index 0000000..411e574
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,8 @@
+# `/test`
+
+Additional external test apps and test data. Feel free to structure the `/test` directory anyway you want. For bigger projects it makes sense to have a data subdirectory. For example, you can have `/test/data` or `/test/testdata` if you need Go to ignore what's in that directory. Note that Go will also ignore directories or files that begin with "." or "_", so you have more flexibility in terms of how you name your test data directory.
+
+Examples:
+
+* https://github.com/openshift/origin/tree/master/test (test data is in the `/testdata` subdirectory)
+
diff --git a/third_party/README.md b/third_party/README.md
new file mode 100644
index 0000000..ecd9930
--- /dev/null
+++ b/third_party/README.md
@@ -0,0 +1,3 @@
+# `/third_party`
+
+External helper tools, forked code and other 3rd party utilities (e.g., Swagger UI).
\ No newline at end of file
diff --git a/tools/README.md b/tools/README.md
new file mode 100644
index 0000000..3f729f8
--- /dev/null
+++ b/tools/README.md
@@ -0,0 +1,9 @@
+# `/tools`
+
+Supporting tools for this project. Note that these tools can import code from the `/pkg` and `/internal` directories.
+
+Examples:
+
+* https://github.com/istio/istio/tree/master/tools
+* https://github.com/openshift/origin/tree/master/tools
+* https://github.com/dapr/dapr/tree/master/tools
\ No newline at end of file
diff --git a/web/OWNERS b/web/OWNERS
new file mode 100644
index 0000000..a9521f7
--- /dev/null
+++ b/web/OWNERS
@@ -0,0 +1,4 @@
+reviewers:
+ - cubxxw
+approvers:
+ - cubxxw
\ No newline at end of file
diff --git a/web/README.md b/web/README.md
new file mode 100644
index 0000000..a5cb800
--- /dev/null
+++ b/web/README.md
@@ -0,0 +1,3 @@
+# `/web`
+
+Web application specific components: static web assets, server side templates and SPAs.
\ No newline at end of file