diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2c952a5 --- /dev/null +++ b/.env.example @@ -0,0 +1,16 @@ +# MinIO 配置 +MINIO_ENDPOINT=play.min.io +MINIO_ACCESS_KEY=youraccesskey +MINIO_SECRET_KEY=yoursecretkey +MINIO_USE_SSL=false + +# Azure 配置 +AZURE_STT_KEY=yourazuresttkey +AZURE_TTS_KEY=yourazurettskey + +# Google 配置 +GOOGLE_STT_KEY=yourgooglesttkey +GOOGLE_TTS_KEY=yourgooglettskey + +# OpenAI 配置 +OPENAI_API_KEY=youropenaiapikey \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ac95910..d8fbee6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,7 +21,7 @@ # 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 kubecub team in the github organization owns all .txt files. +# the telepace team in the github organization owns all .txt files. *.txt @cubxxw # In this example, @cubxxw owns any files in the build/ diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index b95d5e8..9caa1fe 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -4,42 +4,42 @@ 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 kubecub, please do not discuss it in public and even do not open a public issue. +Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of telepace, 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 [3293172751nss@gmail.com](mailto:3293172751nss@gmail.com) to report this. #### Reporting general issues -To be honest, we regard every user of kubecubas a very kind contributor. After experiencing kubecub, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/kubecub/kubecub/issues/new/choose). +To be honest, we regard every user of telepaceas a very kind contributor. After experiencing telepace, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/telepace/telepace/issues/new/choose). -Since we collaborate project kubecub 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. +Since we collaborate project telepace 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/kubecub/kubecub/tree/main/.github/ISSUE_TEMPLATE) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. +To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/telepace/telepace/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 -+ kubecub performance issues ++ telepace performance issues + feature proposal + feature design + help wanted + doc incomplete + test improvement -+ any questions on kubecub project ++ any questions on telepace project + and so on -Also, we must be reminded when submitting a new question about kubecub, 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. +Also, we must be reminded when submitting a new question about telepace, 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. #### Commit Rules -Actually in kubecub, we take two rules serious when committing: +Actually in telepace, 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 change kubecub. Please use the following prefixes for your commits: +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 change telepace. 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". @@ -76,9 +76,9 @@ An example for this could be: #### PR Description -PR is the only way to make change to kubecub 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/kubecub) to finish the pull request. +PR is the only way to make change to telepace 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/telepace) to finish the pull request. -You can find some very formal PR in [RFC](https://github.com/kubecub/kubecub/issues) issues and learn about them. +You can find some very formal PR in [RFC](https://github.com/telepace/telepace/issues) issues and learn about them. **📖 Opening PRs:** @@ -124,12 +124,12 @@ git() { #### Docs Contribution -The documentation for kubecub includes: +The documentation for telepace includes: -+ [README.md](https://github.com/kubecub/community/blob/main/README.md): This file includes the basic information and instructions for getting started with kubecub. -+ [CONTRIBUTING.md](https://github.com/kubecub/community/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to kubecub's codebase, such as how to submit issues, pull requests, and code reviews. -+ [DEVELOPGUIDE.md](https://github.com/kubecub/community/blob/main/DEVELOPGUIDE.md): This file provides a more in-depth guide to developing kubecub, including information on the project's architecture, coding conventions, and testing practices. -+ [Official Documentation](nsddd.top): This is the official documentation for kubecub, which includes comprehensive information on all of its features, configuration options, and troubleshooting tips. ++ [README.md](https://github.com/telepace/community/blob/main/README.md): This file includes the basic information and instructions for getting started with telepace. ++ [CONTRIBUTING.md](https://github.com/telepace/community/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to telepace's codebase, such as how to submit issues, pull requests, and code reviews. ++ [DEVELOPGUIDE.md](https://github.com/telepace/community/blob/main/DEVELOPGUIDE.md): This file provides a more in-depth guide to developing telepace, including information on the project's architecture, coding conventions, and testing practices. ++ [Official Documentation](nsddd.top): This is the official documentation for telepace, 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. @@ -142,20 +142,20 @@ Please obey the following rules to better format the docs, which would greatly i ## Engage to help anything -We choose GitHub as the primary place for kubecub to collaborate. So the latest updates of kubecub are always here. Although contributions via PR is an explicit way to help, we still call for any other ways. +We choose GitHub as the primary place for telepace to collaborate. So the latest updates of telepace 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/search?q=org%3Akubecub++&type=issues&s=comments&o=desc) if you could; ++ reply to other's [issues](https://github.com/search?q=org%3Atelepace++&type=issues&s=comments&o=desc) if you could; + help solve other user's problems; -+ help review other's [PR](https://github.com/search?q=org%3Akubecub++&type=pullrequests&s=comments&o=desc) design; -+ discuss about kubecub to make things clearer; -+ advocate [kubecub](google.com/search?q=kubecub) technokubecuby beyond GitHub; -+ write kubecubs on kubecub and so on. ++ help review other's [PR](https://github.com/search?q=org%3Atelepace++&type=pullrequests&s=comments&o=desc) design; ++ discuss about telepace to make things clearer; ++ advocate [telepace](google.com/search?q=telepace) technotelepacey beyond GitHub; ++ write telepaces on telepace and so on. In a word, **ANY HELP IS CONTRIBUTION.** ## Release version -Releases of kubecub are done using [Release Please](https://github.com/googleapis/release-please) and [GoReleaser](https://goreleaser.com/). The workflow looks like this: +Releases of telepace 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: @@ -164,7 +164,7 @@ Releases of kubecub are done using [Release Please](https://github.com/googleapi 🎯 Merging the 'release please' PR to `main`: -+ Release please is triggered, creates a new release and updates the change kubecub based on the commit messages ++ Release please is triggered, creates a new release and updates the change telepace 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 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 26e06db..e31985b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,4 +6,4 @@ Read the [contributor documentation](../CONTRIBUTING.md), which will teach you h ## Join community meetings for discussion -Keep a record of every discussion in [GitHub discussions](https://github.com/orgs/kubecub/discussions), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). +Keep a record of every discussion in [GitHub discussions](https://github.com/orgs/telepace/discussions), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6462512..24d2711 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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/.github/ISSUE_TEMPLATE/RFC.md b/.github/ISSUE_TEMPLATE/RFC.md index 89fe0d6..c0c52b3 100644 --- a/.github/ISSUE_TEMPLATE/RFC.md +++ b/.github/ISSUE_TEMPLATE/RFC.md @@ -1,15 +1,15 @@ --- name: 📇 RFC -about: The kubecub RFC design template, which you should use if you have a detailed and precise feature design in mind. +about: The telepace RFC design template, which you should use if you have a detailed and precise feature design in mind. title: "🔮[RFC #0000]: " labels: "proposal,RFC,kind/feature,enhancement" --- -# [RFC #0000] kubecub proposal template +# [RFC #0000] telepace proposal template ## Meta [meta]: #meta @@ -18,13 +18,13 @@ labels: "proposal,RFC,kind/feature,enhancement" - Author(s): (Github usernames) - Status: Draft - RFC Pull Request: (leave blank) -- kubecub Pull Request: (leave blank) -- kubecub Issue: (leave blank) +- telepace Pull Request: (leave blank) +- telepace Issue: (leave blank) - Supersedes: (put "N/A" unless this replaces an existing RFC, then link to that RFC) ## 📇Topics -- [\[RFC #0000\] kubecub proposal template](#rfc-0000-kubecub-proposal-template) +- [\[RFC #0000\] telepace proposal template](#rfc-0000-telepace-proposal-template) - [Meta](#meta) - [📇Topics](#topics) - [Summary](#summary) @@ -49,7 +49,7 @@ One paragraph explanation of the feature. ## Definitions [definitions]: #definitions -Make a list of the definitions that may be useful for those reviewing. Include phrases and words that kubecub authors or other interested parties may not be familiar with. +Make a list of the definitions that may be useful for those reviewing. Include phrases and words that telepace authors or other interested parties may not be familiar with. ## Motivation [motivation]: #motivation @@ -64,7 +64,7 @@ Make a list of the definitions that may be useful for those reviewing. Include p This provides a high level overview of the feature. - Define any new terminology. -- Define the target persona: kubecub author, kubecub user, platform operator, platform implementor, and/or project contributor. +- Define the target persona: telepace author, telepace user, platform operator, platform implementor, and/or project contributor. - Explaining the feature largely in terms of examples. - If applicable, provide sample error messages, deprecation warnings, or migration guidance. - If applicable, describe the differences between teaching this to existing users and new users. @@ -79,7 +79,7 @@ The section should return to the examples given in the previous section, and exp ## Migration [migration]: #migration -This section should document breaks to public API and breaks in compatibility due to this RFC's proposed changes. In addition, it should document the proposed steps that one would need to take to work through these changes. Care should be give to include all applicable personas, such as platform developers, kubecub developers, kubecub users and consumers of kubecub images. +This section should document breaks to public API and breaks in compatibility due to this RFC's proposed changes. In addition, it should document the proposed steps that one would need to take to work through these changes. Care should be give to include all applicable personas, such as platform developers, telepace developers, telepace users and consumers of telepace images. ## Drawbacks [drawbacks]: #drawbacks @@ -108,7 +108,7 @@ Discuss prior art, both the good and bad. ## Spec. Changes (OPTIONAL) [spec-changes]: #spec-changes Does this RFC entail any proposed changes to the core specifications or extensions? If so, please document changes here. -Examples of a spec. change might be new lifecycle flags, new `kubecub.toml` fields, new fields in the kubecubage label, etc. +Examples of a spec. change might be new lifecycle flags, new `telepace.toml` fields, new fields in the telepaceage label, etc. This section is not intended to be binding, but as discussion of an RFC unfolds, if spec changes are necessary, they should be documented here. ## History diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index af9f4c7..c60ebc8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -1,9 +1,9 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. name: 🐛 Bug Report -description: Report a bug encountered while operating kubecub +description: Report a bug encountered while operating telepace title: "Bug: " labels: ["kind/bug"] body: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 474649b..e9789bb 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,12 +1,12 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. blank_issues_enabled: false contact_links: - name: 📢 Connect on slack - url: https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ - about: Support kubecub-related requests or issues, get in touch with developers and help on slack - - name: 🌐 kubecub Blog - url: https://kubecub.nsddd.top - about: Open the kubecub community blog + url: https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ + about: Support telepace-related requests or issues, get in touch with developers and help on slack + - name: 🌐 telepace Blog + url: https://telepace.nsddd.top + about: Open the telepace community blog diff --git a/.github/ISSUE_TEMPLATE/docs.yml b/.github/ISSUE_TEMPLATE/docs.yml index 502a11a..8ad14dd 100644 --- a/.github/ISSUE_TEMPLATE/docs.yml +++ b/.github/ISSUE_TEMPLATE/docs.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. @@ -31,5 +31,5 @@ body: - type: markdown attributes: value: | - You can also join our Slack community [here](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) - Feel free to check out other cool repositories of the kubecub Community [here](https://github.com/kubecub) + You can also join our Slack community [here](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) + Feel free to check out other cool repositories of the telepace Community [here](https://github.com/telepace) diff --git a/.github/ISSUE_TEMPLATE/failing-test.yaml b/.github/ISSUE_TEMPLATE/failing-test.yaml index e384e32..7390ef9 100644 --- a/.github/ISSUE_TEMPLATE/failing-test.yaml +++ b/.github/ISSUE_TEMPLATE/failing-test.yaml @@ -1,9 +1,9 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. name: 🚨 Failing Test -description: Report continuously failing tests or jobs in kubecub CI +description: Report continuously failing tests or jobs in telepace CI title: "🤖Failing-test: " labels: ["kind/failing-test"] body: @@ -14,7 +14,7 @@ body: value: placeholder: | - Please only use this template for submitting reports about continuously failing tests or jobs in kubecub CI. + Please only use this template for submitting reports about continuously failing tests or jobs in telepace CI. validations: required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml index b19e831..33e44f8 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. @@ -7,13 +7,13 @@ description: Suggest and idea for this project title: "Feature: " labels: ["kind/feature"] assignees: - - kubecub/maintainers + - telepace/maintainers body: - type: markdown attributes: value: | Thank you for initiating this feature request !🤗 - Expected contribution? 📖 Read our [contributor documentation](https://github.com/kubecub/Open-IM-Server/blob/main/CONTRIBUTING.md) + Expected contribution? 📖 Read our [contributor documentation](https://github.com/telepace/Open-IM-Server/blob/main/CONTRIBUTING.md) - type: checkboxes id: checklist @@ -23,7 +23,7 @@ body: options: - label: I've searched for similar issues and couldn't find anything matching required: true - - label: I've discussed this feature request in the [kubecub Slack](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) and got positive feedback + - label: I've discussed this feature request in the [telepace Slack](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) and got positive feedback required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/other.yml b/.github/ISSUE_TEMPLATE/other.yml index d2a16cf..d24b645 100644 --- a/.github/ISSUE_TEMPLATE/other.yml +++ b/.github/ISSUE_TEMPLATE/other.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. @@ -27,5 +27,5 @@ body: - type: markdown attributes: value: | - You can also join our Discord community [here](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) - Feel free to check out other cool repositories of the kubecub Community [here](https://github.com/kubecub) + You can also join our Discord community [here](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) + Feel free to check out other cool repositories of the telepace Community [here](https://github.com/telepace) diff --git a/.github/OWNERS b/.github/OWNERS index 59f2f8b..00fb8c7 100644 --- a/.github/OWNERS +++ b/.github/OWNERS @@ -1 +1 @@ -# See the OWNERS docs at https://github.com/kubecub/community/tree/main/guide/owners.md +# See the OWNERS docs at https://github.com/telepace/community/tree/main/guide/owners.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 440053a..7982538 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ 🫰 Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: -📇 https://github.com/kubecub/community/blob/main/CONTRIBUTING.md +📇 https://github.com/telepace/community/blob/main/CONTRIBUTING.md 2. Ensure you have added or ran the appropriate tests for your PR: --> @@ -67,6 +67,6 @@ linking directly to the master branch. This ensures that links reference a specific point in time, rather than a document that may change over time. In the sharers Guide, we recommend the following documents: -1. Using GitHub RFCs template: https://github.com/kubecub/community/blob/main/0000-template.md +1. Using GitHub RFCs template: https://github.com/telepace/community/blob/main/0000-template.md 2. Use Google Docs OR Notion and share it with the community. --> \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml index 17d3415..71a9667 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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/.github/labels.yml b/.github/labels.yml index e98d16c..6b5de99 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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/.github/settings.yml b/.github/settings.yml index 2517625..0c84873 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,12 +1,12 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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. repository: - name: "kubecub" - description: "kubecub instant messaging" - homepage_url: "https://kubecub.nsddd.top" - topics: kubecub, kubernetes, chat, chatgpt + name: "telepace" + description: "telepace instant messaging" + homepage_url: "https://telepace.nsddd.top" + topics: telepace, kubernetes, chat, chatgpt default_branch: main allow_squash_merge: true @@ -18,9 +18,9 @@ repository: teams: - name: "maintainers" permission: "admin" - - name: "kubecub-maintainers" + - name: "telepace-maintainers" permission: "maintain" - - name: "kubecub-approvers" + - name: "telepace-approvers" permission: "push" - name: "contributors" permission: "push" diff --git a/.github/sync.yml b/.github/sync.yml index c49515d..79562f6 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -1,11 +1,11 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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 # Synchronization for the.github repository -kubecub/.github: +telepace/.github: - source: LICENSE dest: LICENSE - source: scripts/LICENSE/ @@ -18,7 +18,7 @@ kubecub/.github: workflows/ sync.yml -kubecub/community: +telepace/community: - source: LICENSE dest: LICENSE - source: scripts/LICENSE/ @@ -39,15 +39,15 @@ group: # first group:common to all warehouses # TODO: add the required warehouse here - repos: | - kubecub/github-label-syncer - kubecub/RemoteOps-scripts - kubecub/kube-im - kubecub/CloudBuildAI - kubecub/log - kubecub/automation - kubecub/kubecub - kubecub/feishu-sheet-parser - kubecub/docs + telepace/github-label-syncer + telepace/RemoteOps-scripts + telepace/kube-im + telepace/CloudBuildAI + telepace/log + telepace/automation + telepace/telepace + telepace/feishu-sheet-parser + telepace/docs files: # - source: .gitingore # dest: .gitingore @@ -70,10 +70,10 @@ group: # # second group:omplex layered architecture, common to go language projects # TODO: add the required warehouse here # - repos: | - # kubecub/github-label-syncer - # kubecub/kube-im - # kubecub/automation - # kubecub/kubecub + # telepace/github-label-syncer + # telepace/kube-im + # telepace/automation + # telepace/telepace # files: # # - source: .gitingore # # dest: .gitingore diff --git a/.github/workflows/auto-invite.yml b/.github/workflows/auto-invite.yml index f16687a..cd1744f 100644 --- a/.github/workflows/auto-invite.yml +++ b/.github/workflows/auto-invite.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. @@ -23,17 +23,17 @@ jobs: issue-number: ${{ github.event.issue.number }} token: "${{ secrets.BOT_GITHUB_TOKEN }}" body: | - We value close connections with our users, developers, and contributors here at kubecub. 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. + We value close connections with our users, developers, and contributors here at telepace. 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/c-ub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ). 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 kubecub. You can ask technical questions, seek help, or share your experiences with other users of kubecub. + Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/c-ub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ). 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 telepace. You can ask technical questions, seek help, or share your experiences with other users of telepace. 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 [👀 kubecub slack](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) team channel. - + Get in touch with us on [📨Gmail: 3293172751nss@gmail.com](mailto:3293172751nss@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 [🤖kubecub](nsddd.top). Our kubecub is a great place to stay up-to-date with kubecub projects and trends. On the kubecub, we share our latest developments, tech trends, and other interesting information. - + Add [🕊️Twitter](https://twitter.com/xxw3293172751) . If you prefer social media, our Twitter account is a great way to stay up-to-date with kubecub project news and trends. On Twitter, we share our latest tech and trends, as well as relevant news and events. - + Add [📲Wechat](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-smile-brightgreen?kubecubo=wechat&style=flat-square) and indicate that you are a user or developer of kubecub. We will process your request as soon as possible. + + We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 telepace slack](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) team channel. + + Get in touch with us on [📨Gmail: 3293172751nss@gmail.com](mailto:3293172751nss@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 [🤖telepace](nsddd.top). Our telepace is a great place to stay up-to-date with telepace projects and trends. On the telepace, we share our latest developments, tech trends, and other interesting information. + + Add [🕊️Twitter](https://twitter.com/xxw3293172751) . If you prefer social media, our Twitter account is a great way to stay up-to-date with telepace project news and trends. On Twitter, we share our latest tech and trends, as well as relevant news and events. + + Add [📲Wechat](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-smile-brightgreen?telepaceo=wechat&style=flat-square) and indicate that you are a user or developer of telepace. We will process your request as soon as possible. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us. diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index bda39f6..0000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: "OpenIM CLA Assistant" -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened,closed,synchronize] - -# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings -permissions: - actions: write - contents: write - pull-requests: write - statuses: write - -env: - # Define Open-IM-Server variables here - OPEN_IM_SERVER_REMOTE_ORGANIZATION: openim-sigs - REMOTE_REPOSITORY: cla - OPEN_IM_SERVER_CLA_DOCUMENT: https://github.com/openim-sigs/cla/blob/main/README.md - OPEN_IM_SERVER_SIGNATURES_PATH: signatures/${{ github.event.repository.name }}/cla.json - - OPEN_IM_SERVER_ALLOWLIST: kubbot,bot* - -jobs: - CLAAssistant: - runs-on: ubuntu-latest - steps: - - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@v2.3.0 - env: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} - PERSONAL_ACCESS_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }} - with: - path-to-signatures: ${{ env.OPEN_IM_SERVER_SIGNATURES_PATH }} - path-to-document: ${{ env.OPEN_IM_SERVER_CLA_DOCUMENT }} - branch: 'main' - allowlist: ${{ env.OPEN_IM_SERVER_ALLOWLIST }} - - remote-organization-name: ${{ env.OPEN_IM_SERVER_REMOTE_ORGANIZATION }} - remote-repository-name: ${{ env.REMOTE_REPOSITORY }} - - create-file-commit-message: '📚 Docs: Creating file for storing ${{ github.event.repository.name }} CLA Signatures' - custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md)' - custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA' - custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).\n 🤖 The signed information is recorded [here](https://github.com/openim-sigs/cla/tree/main/signatures/cla.json)' - # lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true) - # use-dco-flag: true - If you are using DCO instead of CLA diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index de86c18..dde66ba 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. diff --git a/.github/workflows/gpt-translate.yml b/.github/workflows/gpt-translate.yml index 1382bb3..d92e425 100644 --- a/.github/workflows/gpt-translate.yml +++ b/.github/workflows/gpt-translate.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. diff --git a/.github/workflows/issue-robot.yml b/.github/workflows/issue-robot.yml index de6daab..8704ec4 100644 --- a/.github/workflows/issue-robot.yml +++ b/.github/workflows/issue-robot.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 0e0c219..8daacba 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & Xinwei Xiong(cubxxw). 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. @@ -14,7 +14,7 @@ # # # /* -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. # */ diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 3fc42ad..fc6ab8c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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/.github/workflows/link-pr.yml b/.github/workflows/link-pr.yml index a5c7d49..bb6029d 100644 --- a/.github/workflows/link-pr.yml +++ b/.github/workflows/link-pr.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. @@ -43,7 +43,7 @@ jobs: if: env.lychee_exit_code != 0 uses: peter-evans/create-issue-from-file@v4 with: - title: Bug reports for links in kubecub docs + title: Bug reports for links in telepace docs content-filepath: ./lychee/out.md labels: kind/documentation, triage/unresolved, report token: ${{ secrets.BOT_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 56a1f1e..9f2a7f7 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -29,6 +29,6 @@ jobs: close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity. You can reopen it if you want.' stale-pr-label: lifecycle/stale stale-issue-label: lifecycle/stale - exempt-issue-labels: 'kubecub' - exempt-pr-labels: 'kubecub' + exempt-issue-labels: 'telepace' + exempt-pr-labels: 'telepace' exempt-draft-pr: true diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 871e400..9ae133f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,9 +1,9 @@ -# Copyright © 2023 KubeCub open source community. All rights reserved. +# Copyright © 2023 telepace 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 +name: Synchronize telepace public code to other repositories on: push: branches: @@ -32,7 +32,7 @@ jobs: COMMIT_BODY: "🤖 kubbot to synchronize the warehouse" GIT_EMAIL: "3293172751ysy@gmail.com" GIT_USERNAME: "kubbot" - PR_BODY: 👌 kubecub provides automated community services + PR_BODY: 👌 telepace provides automated community services REVIEWERS: | kubbot cubxxw diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b53454..f3b9845 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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. diff --git a/.gitignore b/.gitignore index 451b7d4..6b51a63 100644 --- a/.gitignore +++ b/.gitignore @@ -339,7 +339,6 @@ flycheck_*.el # Misc .DS_Store *.env -.env.* dist # files used by the developer diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6ab56a..0084e47 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to go-project-layout +# Contributing to voiceflow -So, you want to hack on go-project-layout? Yay! +So, you want to hack on voiceflow? 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. @@ -8,7 +8,7 @@ This document provides guidelines and best practices to help you contribute effe ## 📇Topics -- [Contributing to go-project-layout](#contributing-to-go-project-layout) +- [Contributing to voiceflow](#contributing-to-voiceflow) - [📇Topics](#topics) - [What we expect of you](#what-we-expect-of-you) - [Code of ConductCode of Conduct](#code-of-conductcode-of-conduct) @@ -28,13 +28,13 @@ This document provides guidelines and best practices to help you contribute effe ## What we expect of you -We hope that anyone can join go-project-layout , even if you are a student, writer, translator +We hope that anyone can join voiceflow , even if you are a student, writer, translator -Please meet the minimum version of the Go language published in [go.mod](https://github.com/kubecub/go-project-layout/tree/main/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) +Please meet the minimum version of the Go language published in [go.mod](https://github.com/telepace/voiceflow/tree/main/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 OR WSL as the development environment, Linux with [Makefile](./Makefile) can help you quickly build and test go-project-layout project. +You'd better use Linux OR WSL as the development environment, Linux with [Makefile](./Makefile) can help you quickly build and test voiceflow project. -If you are familiar with [Makefile](./Makefile) , you can easily see the clever design of the go-project-layout Makefile. Storing the necessary tools such as golangci in the `/tools` directory can avoid some tool version issues. +If you are familiar with [Makefile](./Makefile) , you can easily see the clever design of the voiceflow 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. @@ -42,7 +42,7 @@ The [Makefile](./Makefile) is for every developer, even if you don't know how to #### Code and doc contribution -Every action to make project go-project-layout better is encouraged. On GitHub, every improvement for go-project-layout could be via a [PR](https://github.com/kubecub/go-project-layout/pulls) (short for pull request). +Every action to make project voiceflow better is encouraged. On GitHub, every improvement for voiceflow could be via a [PR](https://github.com/telepace/voiceflow/pulls) (short for pull request). + If you find a typo, try to fix it! + If you find a bug, try to fix it! @@ -57,14 +57,14 @@ Every action to make project go-project-layout better is encouraged. On GitHub, #### Where should I start? -+ If you are new to the project, don't know how to contribute go-project-layout, please check out the [good first issue](https://github.com/kubecub/go-project-layout/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. -+ You should be good at filtering the go-project-layout issue tags and finding the ones you like, such as [RFC](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+label%3Abug+) fixes. -+ If you are looking for something to work on, check out our [open issues](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). -+ If you have an idea for a new feature, please [open an issue](https://github.com/kubecub/go-project-layout/issues/new/choose), and we can discuss it. ++ If you are new to the project, don't know how to contribute voiceflow, please check out the [good first issue](https://github.com/telepace/voiceflow/issues?q=is%3Aopen+label%3A"good+first+issue"+sort%3Aupdated-desc) label. ++ You should be good at filtering the voiceflow issue tags and finding the ones you like, such as [RFC](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) for big initiatives, features for [feature](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+label%3Afeature) proposals, and [bug](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+label%3Abug+) fixes. ++ If you are looking for something to work on, check out our [open issues](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). ++ If you have an idea for a new feature, please [open an issue](https://github.com/telepace/voiceflow/issues/new/choose), and we can discuss it. #### Design documents -For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/kubecub/go-project-layout/discussions) for better collaboration. Of course, after completing the design document, we should also add it to our [Shared Drive](https://drive.google.com/drive/) and notify the appropriate working group to let everyone know of its existence. Only by doing so can we maximize the effectiveness of the design document and provide strong support for the smooth progress of the project. +For any substantial design, there should be a well-crafted design document. This document is not just a simple record, but also a detailed description and manifestation, which can help team members better understand the design thinking and grasp the design direction. In the process of writing the design document, we can choose to use tools such as `Google Docs` or `Notion`, and even mark RFC in [issues](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) or [discussions](https://github.com/telepace/voiceflow/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. @@ -75,7 +75,7 @@ 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 go-project-layout you'll need to go through the following steps: +In order to contribute a feature to voiceflow you'll need to go through the following steps: + Discuss your idea with the appropriate [working groups](https://join.slack.com/t/c-ub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) 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. @@ -85,16 +85,16 @@ But keep in mind that there is no guarantee of it being accepted and so it is us ## Getting Started -To propose PR for the go-project-layout item, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps: +To propose PR for the voiceflow item, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps: -1. Fork the repository(go-project-layout) +1. Fork the repository(voiceflow) -2. **CLONE** your own repository to master locally. Use `git clone https://github.com//go-project-layout.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make. +2. **CLONE** your own repository to master locally. Use `git clone https://github.com//voiceflow.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/kubecub/go-project-layout.git` using the following two commands: +3. **Set Remote** upstream to be `https://github.com/telepace/voiceflow.git` using the following two commands: ```bash - ❯ git remote add upstream https://github.com/kubecub/go-project-layout.git + ❯ git remote add upstream https://github.com/telepace/voiceflow.git ❯ git remote set-url --push upstream no-pushing ``` @@ -102,9 +102,9 @@ To propose PR for the go-project-layout item, we assume you have registered a Gi ```bash ❯ git remote -v - origin https://github.com//go-project-layout.git (fetch) - origin https://github.com//go-project-layout.git (push) - upstream https://github.com/kubecub/go-project-layout.git (fetch) + origin https://github.com//voiceflow.git (fetch) + origin https://github.com//voiceflow.git (push) + upstream https://github.com/telepace/voiceflow.git (fetch) upstream no-pushing (push) ``` @@ -113,7 +113,7 @@ To propose PR for the go-project-layout item, we assume you have registered a Gi 4. Create a new branch for your changes (use a descriptive name, such as `fix-bug-123` or `add-new-feature`). ```bash - ❯ cd go-project-layout + ❯ cd voiceflow ❯ git fetch upstream ❯ git checkout upstream/main ``` @@ -165,7 +165,7 @@ To propose PR for the go-project-layout item, we assume you have registered a Gi # then create pull request, and merge ``` -7. **Open a pull request** to `kubecub/go-project-layout:main` +7. **Open a pull request** to `telepace/voiceflow: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. @@ -175,42 +175,42 @@ 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 go-project-layout, please do not discuss it in public and even do not open a public issue. +Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of voiceflow, 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 [3293172751nss@gmail.com](mailto:3293172751nss@gmail.com) to report this. #### Reporting general issues -To be honest, we regard every user of go-project-layoutas a very kind contributor. After experiencing go-project-layout, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/kubecub/go-project-layout/issues/new/choose). +To be honest, we regard every user of voiceflowas a very kind contributor. After experiencing voiceflow, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/telepace/voiceflow/issues/new/choose). -Since we collaborate project go-project-layout 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. +Since we collaborate project voiceflow 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/kubecub/go-project-layout/tree/main/.github/ISSUE_TEMPLATE) for issue reporters. You can find three kinds of issue templates there: question, bug report and feature request. Please **BE SURE** to follow the instructions to fill fields in template. +To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](https://github.com/telepace/voiceflow/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 -+ go-project-layout performance issues ++ voiceflow performance issues + feature proposal + feature design + help wanted + doc incomplete + test improvement -+ any questions on go-project-layout project ++ any questions on voiceflow project + and so on -Also, we must be reminded when submitting a new question about go-project-layout, 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. +Also, we must be reminded when submitting a new question about voiceflow, 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. #### Commit Rules -Actually in go-project-layout, we take two rules serious when committing: +Actually in voiceflow, 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 changego-project-layouts. Please use the following prefixes for your commits: +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 changevoiceflows. 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". @@ -247,9 +247,9 @@ An example for this could be: #### PR Description -PR is the only way to make change to go-project-layout 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/kubecub/go-project-layout/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. +PR is the only way to make change to voiceflow 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/telepace/voiceflow/tree/main/.github/PULL_REQUEST_TEMPLATE.md) to finish the pull request. -You can find some very formal PR in [RFC](https://github.com/kubecub/go-project-layout/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. +You can find some very formal PR in [RFC](https://github.com/telepace/voiceflow/issues?q=is%3Aissue+is%3Aopen+RFC+label%3ARFC) issues and learn about them. **📖 Opening PRs:** @@ -296,12 +296,12 @@ git() { #### Docs Contribution -The documentation for go-project-layout includes: +The documentation for voiceflow includes: -+ [README.md](https://github.com/kubecub/go-project-layout/blob/main/README.md): This file includes the basic information and instructions for getting started with go-project-layout. -+ [README_zh-CN.md](https://github.com/kubecub/go-project-layout/blob/main/README_zh-CN.md): This file includes the basic information and instructions for getting started with kubecub in Chinese. -+ [CONTRIBUTING.md](https://github.com/kubecub/go-project-layout/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to go-project-layout's codebase, such as how to submit issues, pull requests, and code reviews. -+ [Official Documentation](https://nsddd.top): This is the official documentation for go-project-layout, which includes comprehensive information on all of its features, configuration options, and troubleshooting tips. ++ [README.md](https://github.com/telepace/voiceflow/blob/main/README.md): This file includes the basic information and instructions for getting started with voiceflow. ++ [README_zh-CN.md](https://github.com/telepace/voiceflow/blob/main/README_zh-CN.md): This file includes the basic information and instructions for getting started with telepace in Chinese. ++ [CONTRIBUTING.md](https://github.com/telepace/voiceflow/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to voiceflow's codebase, such as how to submit issues, pull requests, and code reviews. ++ [Official Documentation](https://nsddd.top): This is the official documentation for voiceflow, 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. @@ -314,20 +314,20 @@ Please obey the following rules to better format the docs, which would greatly i ## Engage to help anything -We choose GitHub as the primary place for go-project-layout to collaborate. So the latest updates of go-project-layout are always here. Although contributions via PR is an explicit way to help, we still call for any other ways. +We choose GitHub as the primary place for voiceflow to collaborate. So the latest updates of voiceflow 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/kubecub/go-project-layout/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) if you could; ++ reply to other's [issues](https://github.com/telepace/voiceflow/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/kubecub/go-project-layout/pulls) design; -+ discuss about go-project-layout to make things clearer; -+ advocate [go-project-layout](https://google.com/search?q=go-project-layout) technogo-project-layouty beyond GitHub; -+ write bgo-project-layouts on go-project-layout and so on. ++ help review other's [PR](https://github.com/telepace/voiceflow/pulls) design; ++ discuss about voiceflow to make things clearer; ++ advocate [voiceflow](https://google.com/search?q=voiceflow) technovoiceflowy beyond GitHub; ++ write bvoiceflows on voiceflow and so on. In a word, **ANY HELP IS CONTRIBUTION.** ## Release version -Releases of go-project-layout are done using [Release Please](https://github.com/googleapis/release-please) and [GoReleaser](https://goreleaser.com/). The workflow looks like this: +Releases of voiceflow 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: @@ -336,7 +336,7 @@ Releases of go-project-layout are done using [Release Please](https://github.com 🎯 Merging the 'release please' PR to `main`: -+ Release please is triggered, creates a new release and updates the changego-project-layout based on the commit messages ++ Release please is triggered, creates a new release and updates the changevoiceflow 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 @@ -354,16 +354,16 @@ Such a commit can get produced as follows: ## Contact Us -We value close connections with our users, developers, and contributors here at kubecub. 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. +We value close connections with our users, developers, and contributors here at telepace. 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/c-ub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ). 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 kubecub. You can ask technical questions, seek help, or share your experiences with other users of kubecub. +Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/c-ub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ). 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 telepace. You can ask technical questions, seek help, or share your experiences with other users of telepace. 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 [👀 kubecub slack](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) team channel. -+ Get in touch with us on [📨Gmail: 3293172751nss@gmail.com](mailto:3293172751nss@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 [🤖kubecub](https://nsddd.top). Our kubecub is a great place to stay up-to-date with kubecub projects and trends. On the kubecub, we share our latest developments, tech trends, and other interesting information. -+ Add [🕊️Twitter](https://twitter.com/xxw3293172751) . If you prefer social media, our Twitter account is a great way to stay up-to-date with kubecub project news and trends. On Twitter, we share our latest tech and trends, as well as relevant news and events. -+ Add [📲Wechat](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-smile-brightgreen?kubecubo=wechat&style=flat-square) and indicate that you are a user or developer of kubecub. We will process your request as soon as possible. ++ We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 telepace slack](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ) team channel. ++ Get in touch with us on [📨Gmail: 3293172751nss@gmail.com](mailto:3293172751nss@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 [🤖telepace](https://nsddd.top). Our telepace is a great place to stay up-to-date with telepace projects and trends. On the telepace, we share our latest developments, tech trends, and other interesting information. ++ Add [🕊️Twitter](https://twitter.com/xxw3293172751) . If you prefer social media, our Twitter account is a great way to stay up-to-date with telepace project news and trends. On Twitter, we share our latest tech and trends, as well as relevant news and events. ++ Add [📲Wechat](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-smile-brightgreen?telepaceo=wechat&style=flat-square) and indicate that you are a user or developer of telepace. We will process your request as soon as possible. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us. diff --git a/LICENSE b/LICENSE index 7d045dc..b6711bd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 kubecub open source community(public welfare community) +Copyright (c) 2023 telepace open source community(public welfare 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 diff --git a/Makefile b/Makefile index 912b793..5e2f9bd 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -# Copyright 2023 KubeCub. All rights reserved. +# Copyright 2023 telepace. 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/kubecub/go-project-layout +ROOT_PACKAGE=github.com/telepace/voiceflow OUT_DIR=$(REPO_ROOT)/_output # ============================================================================== @@ -57,7 +57,7 @@ ifeq (, $(shell git status --porcelain 2>/dev/null)) endif GIT_COMMIT:=$(shell git rev-parse HEAD) -IMG ?= ghcr.io/kubecub/go-project-layout:latest +IMG ?= ghcr.io/telepace/voiceflow:latest BUILDFILE = "./main.go" BUILDAPP = "$(OUTPUT_DIR)/" @@ -115,7 +115,7 @@ SPACE += # ============================================================================== # Build definition -GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20 +GO_MINIMUM_VERSION ?= 1.19 GO_LDFLAGS += -X $(VERSION_PACKAGE).GitVersion=$(VERSION) \ -X $(VERSION_PACKAGE).GitCommit=$(GIT_COMMIT) \ -X $(VERSION_PACKAGE).GitTreeState=$(GIT_TREE_STATE) \ @@ -139,7 +139,7 @@ ifeq ($(origin GOBIN), undefined) GOBIN := $(GOPATH)/bin endif -COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/cmd/*.go)) +COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/cmd/*/*.go)) BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd})) ifeq (${COMMANDS},) @@ -149,7 +149,7 @@ ifeq (${BINS},) $(error Could not determine BINS, set ROOT_DIR or run in source dir) endif -EXCLUDE_TESTS=github.com/kubecub/CloudBuildAI/test +EXCLUDE_TESTS=github.com/telepace/CloudBuildAI/test # ============================================================================== # Build @@ -170,10 +170,11 @@ build.%: .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)') +ifneq ($(shell $(GO) version|awk -v min=$(GO_MINIMUM_VERSION) '{gsub(/go/,"",$$3);if($$3 >= min){print 0}else{print 1}}'), 0) + $(error unsupported go version. Please install a go version which is greater than or equal to '$(GO_MINIMUM_VERSION)') endif + ## go.build: Build the binary file of the specified platform. .PHONY: go.build.% go.build.%: @@ -261,7 +262,7 @@ copyright-verify: tools.verify.addlicense copyright-add .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 "KubeCub open source community." -f $(LICENSE_TEMPLATE) $(CODE_DIRS) + @$(TOOLS_DIR)/addlicense -y $(shell date +"%Y") -v -c "telepace open source community." -f $(LICENSE_TEMPLATE) $(CODE_DIRS) @echo "===========> End the copyright is added..." ## swagger: Generate swagger document. diff --git a/README.md b/README.md index 1caf373..9fcd886 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- go-project-layout
+ voiceflow

@@ -9,11 +9,11 @@

-A+ -good first - - - +A+ +good first + + +

@@ -37,14 +37,14 @@ I defined a spec template that I could use to quickly start building a full-fled In each directory, there is a README.md and an OWNERS, which explains what the directory does and who owns it. **Labels denger:** -Read about the [go-project-layout](https://github.com/kubecub/go-project-layout/labels) tag design. We have provided in the [github-label-syncer](https://github.com/kubecub/github-label-syncer) warehouse label synchronizer. +Read about the [voiceflow](https://github.com/telepace/voiceflow/labels) tag design. We have provided in the [github-label-syncer](https://github.com/telepace/github-label-syncer) warehouse label synchronizer. ## 🛫 Quick start -> **Note**: You can get started quickly with go-project-layout. +> **Note**: You can get started quickly with voiceflow. -1. Generate a [new repository](https://github.com/kubecub/go-project-layout/generate) from the template. +1. Generate a [new repository](https://github.com/telepace/voiceflow/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. @@ -84,21 +84,21 @@ Read about the [go-project-layout](https://github.com/kubecub/go-project-layout/ ❯ cp ../sealer/_output/bin/sealer/linux_amd64/sealer ./ # add big binary file ❯ git add . ❯ git commit -a -s -m "nono" # Excess commit blocking -kubecub : Running local kubecub pre-commit hook. -kubecub : File sealer is 71 MB, which is larger than our configured limit of 2 MB -kubecub : 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. -kubecub : Commit aborted +telepace : Running local telepace pre-commit hook. +telepace : File sealer is 71 MB, which is larger than our configured limit of 2 MB +telepace : 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. +telepace : Commit aborted ❯ rm -rf .git # remote big binary ❯ git commit -a -s -m "nono" # Bad commit blocking -kubecub : Running local kubecub pre-commit hook. -kubecub : Running the kubecub commit-msg hook. +telepace : Running local telepace pre-commit hook. +telepace : Running the telepace commit-msg hook. fakehsh: subject does not match regex [^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*] fakehsh: subject length less than min [10] -kubecub : Please fix your commit message to match kubecub coding standards -kubecub : https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md +telepace : Please fix your commit message to match telepace coding standards +telepace : https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md ❯ git commit -a -s -m "docs(main): README-en Chinese documentation" -kubecub : Running local kubecub pre-commit hook. -kubecub : Running the kubecub commit-msg hook. +telepace : Running local telepace pre-commit hook. +telepace : Running the telepace commit-msg hook. [main b3b339f] docs(main): README-en Chinese documentation 1 file changed, 29 insertions(+) ❯ git push origin main @@ -151,7 +151,7 @@ Comment in an issue: Catalog standardization design structure: ```bash -.go-project-layout +.voiceflow ├── CONTRIBUTING.md # Contribution guidelines ├── LICENSE # License information ├── Makefile # Makefile for building and running the project @@ -218,32 +218,32 @@ Catalog standardization design structure: ## 🗓️ community meeting -We welcome everyone to join us and contribute to go-project-layout, whether you are new to open source or professional. We are committed to promoting an open source culture, so we offer community members neighborhood prizes and reward money in recognition of their contributions. We believe that by working together, we can build a strong community and make valuable open source tools and resources available to more people. So if you are interested in go-project-layout, please join our community and start contributing your ideas and skills! +We welcome everyone to join us and contribute to voiceflow, whether you are new to open source or professional. We are committed to promoting an open source culture, so we offer community members neighborhood prizes and reward money in recognition of their contributions. We believe that by working together, we can build a strong community and make valuable open source tools and resources available to more people. So if you are interested in voiceflow, please join our community and start contributing your ideas and skills! -We take notes of each [biweekly meeting](https://github.com/kubecub/go-project-layout/issues/2) in [GitHub discussions](https://github.com/orgs/kubecub/discussions), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). +We take notes of each [biweekly meeting](https://github.com/telepace/voiceflow/issues/2) in [GitHub discussions](https://github.com/orgs/telepace/discussions), and our minutes are written in [Google Docs](https://docs.google.com/document/d/1nx8MDpuG74NASx081JcCpxPgDITNTpIIos0DS6Vr9GU/edit?usp=sharing). -go-project-layout maintains a [public roadmap](https://github.com/kubecub/community/tree/main/roadmaps). It gives a a high-level view of the main priorities for the project, the maturity of different features and projects, and how to influence the project direction. +voiceflow maintains a [public roadmap](https://github.com/telepace/community/tree/main/roadmaps). It gives a a high-level view of the main priorities for the project, the maturity of different features and projects, and how to influence the project direction. ## 🤼‍ Contributing & Development -kubecub Our goal is to build a top-level open source community. We have a set of standards, in the [Community repository](https://github.com/kubecub/community). +telepace Our goal is to build a top-level open source community. We have a set of standards, in the [Community repository](https://github.com/telepace/community). -If you'd like to contribute to this go-project-layout repository, please read our [contributor documentation](https://github.com/kubecub/go-project-layout/blob/main/CONTRIBUTING.md). +If you'd like to contribute to this voiceflow repository, please read our [contributor documentation](https://github.com/telepace/voiceflow/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/kubecub/go-project-layout/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/kubecub/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ), or if you find an issue, [report it](https://github.com/kubecub/go-project-layout/issues/new/choose) first. +Before you start, please make sure your changes are in demand. The best for that is to create a [new discussion](https://github.com/telepace/voiceflow/discussions/new/choose) OR [Slack Communication](https://join.slack.com/t/telepace/shared_invite/zt-1se0k2bae-lkYzz0_T~BYh3rjkvlcUqQ), or if you find an issue, [report it](https://github.com/telepace/voiceflow/issues/new/choose) first. ## 🚨 License -Kubecub is licensed under the MIT License. See [LICENSE](https://github.com/kubecub/go-project-layout/tree/main/LICENSE) for the full license text. +telepace is licensed under the MIT License. See [LICENSE](https://github.com/telepace/voiceflow/tree/main/LICENSE) for the full license text. -[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkubecub%2Fkubecub.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkubecub%2Fgo-project-layout?ref=badge_large) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftelepace%2Ftelepace.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftelepace%2Fvoiceflow?ref=badge_large) ## 🔮 Thanks to our contributors! - - + + diff --git a/cmd/voiceflow/main.go b/cmd/voiceflow/main.go new file mode 100644 index 0000000..fade877 --- /dev/null +++ b/cmd/voiceflow/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "log" + + "github.com/telepace/voiceflow/internal/config" + "github.com/telepace/voiceflow/internal/server" + "github.com/telepace/voiceflow/pkg/logger" +) + +func main() { + // 初始化配置 + cfg := config.GetConfig() + + // 初始化日志 + logger.Init(cfg.Logging.Level) + + // 启动 WebSocket 服务器 + wsServer := server.NewServer() + go wsServer.Start() + + // 可以在这里添加其他服务,如 RESTful API 服务器等 + + // 阻塞主线程 + select {} +} \ No newline at end of file diff --git a/configs/config.yaml b/configs/config.yaml index 4363324..ca5c068 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -1,4 +1,34 @@ -# 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. +server: + port: 8080 + enable_tls: false +minio: + enabled: true + endpoint: ${MINIO_ENDPOINT} + access_key: ${MINIO_ACCESS_KEY} + secret_key: ${MINIO_SECRET_KEY} + bucket_name: voiceflow-audio + use_ssl: ${MINIO_USE_SSL} + +stt: + provider: azure # 可选值:azure、google、local + +tts: + provider: google # 可选值:azure、google、local + +llm: + provider: openai # 可选值:openai、local + +azure: + stt_key: ${AZURE_STT_KEY} + tts_key: ${AZURE_TTS_KEY} + +google: + stt_key: ${GOOGLE_STT_KEY} + tts_key: ${GOOGLE_TTS_KEY} + +openai: + api_key: ${OPENAI_API_KEY} + +logging: + level: info \ No newline at end of file diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index ac95910..d8fbee6 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -21,7 +21,7 @@ # 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 kubecub team in the github organization owns all .txt files. +# the telepace team in the github organization owns all .txt files. *.txt @cubxxw # In this example, @cubxxw owns any files in the build/ diff --git a/go.mod b/go.mod index ddac6ac..c4c610a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,44 @@ -module github.com/kubecub/go-project-layout +module github.com/telepace/voiceflow -go 1.18 +go 1.22 + +toolchain go1.22.5 + +require ( + github.com/gorilla/websocket v1.5.3 + github.com/joho/godotenv v1.5.1 + github.com/minio/minio-go/v7 v7.0.78 + github.com/spf13/viper v1.19.0 +) + +require ( + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-ini/ini v1.67.0 // indirect + github.com/goccy/go-json v0.10.3 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/rs/xid v1.6.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d34249b --- /dev/null +++ b/go.sum @@ -0,0 +1,99 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.78 h1:LqW2zy52fxnI4gg8C2oZviTaKHcBV36scS+RzJnxUFs= +github.com/minio/minio-go/v7 v7.0.78/go.mod h1:84gmIilaX4zcvAWWzJ5Z1WI5axN+hAbM5w25xf8xvC0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..bc4a066 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,63 @@ +package config + +import ( + "log" + "sync" + + "github.com/joho/godotenv" + "github.com/spf13/viper" +) + +type Config struct { + Server struct { + Port int + EnableTLS bool `mapstructure:"enable_tls"` + } + MinIO struct { + Enabled bool + BucketName string `mapstructure:"bucket_name"` + } + STT struct { + Provider string + } + TTS struct { + Provider string + } + LLM struct { + Provider string + } + Logging struct { + Level string + } + // 更多配置... +} + +var ( + cfg *Config + once sync.Once +) + +func GetConfig() *Config { + once.Do(func() { + // 加载 .env 文件 + if err := godotenv.Load(); err != nil { + log.Println("No .env file found") + } + + // 加载 config.yaml + viper.SetConfigName("config") + viper.AddConfigPath("./configs") + viper.SetConfigType("yaml") + + if err := viper.ReadInConfig(); err != nil { + log.Fatalf("Error reading config file: %v", err) + } + + // 解析配置 + cfg = &Config{} + if err := viper.Unmarshal(cfg); err != nil { + log.Fatalf("Unable to decode into struct: %v", err) + } + }) + return cfg +} \ No newline at end of file diff --git a/internal/models/models.go b/internal/models/models.go new file mode 100644 index 0000000..9cb8a91 --- /dev/null +++ b/internal/models/models.go @@ -0,0 +1,21 @@ +package models + +import ( + "time" +) + +type Session struct { + ID string `json:"id"` + UserID string `json:"user_id"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` +} + +type Message struct { + ID string `json:"id"` + SessionID string `json:"session_id"` + Sender string `json:"sender"` // "user" 或 "assistant" + Content string `json:"content"` + AudioURL string `json:"audio_url"` + CreatedAt time.Time `json:"created_at"` +} \ No newline at end of file diff --git a/internal/server/handlers.go b/internal/server/handlers.go new file mode 100644 index 0000000..f12c7db --- /dev/null +++ b/internal/server/handlers.go @@ -0,0 +1,72 @@ +package server + +import ( + "log" + "net/http" + + "github.com/gorilla/websocket" + "github.com/telepace/voiceflow/internal/stt" + "telepace/internal/tts" + "telepace/internal/llm" + "telepace/internal/storage" +) + +func (s *Server) handleConnections(w http.ResponseWriter, r *http.Request) { + ws, err := s.upgrader.Upgrade(w, r, nil) + if err != nil { + log.Printf("WebSocket Upgrade error: %v", err) + return + } + defer ws.Close() + + // 创建 STT、TTS、LLM 和存储实例 + sttService := stt.NewService() + ttsService := tts.NewService() + llmService := llm.NewService() + storageService := storage.NewService() + + // 开始处理 WebSocket 消息 + for { + // 读取消息 + _, data, err := ws.ReadMessage() + if err != nil { + log.Printf("Read error: %v", err) + break + } + + // 处理语音数据 -> STT + text, err := sttService.Recognize(data) + if err != nil { + log.Printf("STT error: %v", err) + continue + } + + // 与 LLM 交互 + responseText, err := llmService.GetResponse(text) + if err != nil { + log.Printf("LLM error: %v", err) + continue + } + + // 文本转语音 -> TTS + audioData, err := ttsService.Synthesize(responseText) + if err != nil { + log.Printf("TTS error: %v", err) + continue + } + + // 存储音频到 MinIO,并获取 URL + audioURL, err := storageService.StoreAudio(audioData) + if err != nil { + log.Printf("Storage error: %v", err) + continue + } + + // 将音频 URL 返回给前端 + err = ws.WriteJSON(map[string]string{"audio_url": audioURL}) + if err != nil { + log.Printf("Write error: %v", err) + break + } + } +} \ No newline at end of file diff --git a/internal/server/server.go b/internal/server/server.go new file mode 100644 index 0000000..11f4382 --- /dev/null +++ b/internal/server/server.go @@ -0,0 +1,37 @@ +package server + +import ( + "log" + "net/http" + "fmt" + + "github.com/gorilla/websocket" + "github.com/telepace/voiceflow/internal/config" +) + +type Server struct { + upgrader websocket.Upgrader + // 其他需要的字段 +} + +func NewServer() *Server { + return &Server{ + upgrader: websocket.Upgrader{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, + CheckOrigin: func(r *http.Request) bool { + return true // 根据需要进行跨域处理 + }, + }, + } +} + +func (s *Server) Start() { + http.HandleFunc("/ws", s.handleConnections) + cfg := config.GetConfig() + addr := fmt.Sprintf(":%d", cfg.Server.Port) + log.Printf("WebSocket server started on %s", addr) + if err := http.ListenAndServe(addr, nil); err != nil { + log.Fatalf("Server error: %v", err) + } +} \ No newline at end of file diff --git a/internal/storage/minio.go b/internal/storage/minio.go new file mode 100644 index 0000000..85bf7a2 --- /dev/null +++ b/internal/storage/minio.go @@ -0,0 +1,34 @@ +package storage + +import ( + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + "your_project/internal/config" +) + +type MinIOService struct { + client *minio.Client + bucketName string +} + +func NewMinIOService() *MinIOService { + cfg := config.GetConfig() + minioClient, err := minio.New( + cfg.MinIO.Endpoint, + &minio.Options{ + Creds: credentials.NewStaticV4(cfg.MinIO.AccessKey, cfg.MinIO.SecretKey, ""), + Secure: cfg.MinIO.UseSSL, + }, + ) + if err != nil { + log.Fatalf("Failed to create MinIO client: %v", err) + } + return &MinIOService{ + client: minioClient, + bucketName: cfg.MinIO.BucketName, + } +} + +func (m *MinIOService) StoreAudio(audioData []byte) (string, error) { + // 存储音频数据到 MinIO,返回可访问的 URL +} \ No newline at end of file diff --git a/internal/storage/storage.go b/internal/storage/storage.go new file mode 100644 index 0000000..50cb9f9 --- /dev/null +++ b/internal/storage/storage.go @@ -0,0 +1,14 @@ +package storage + +type Service interface { + StoreAudio(audioData []byte) (string, error) +} + +func NewService() Service { + cfg := config.GetConfig() + if cfg.MinIO.Enabled { + return NewMinIOService() + } + // 可添加其他存储实现 + return NewLocalStorageService() +} \ No newline at end of file diff --git a/internal/stt/azure/azure.go b/internal/stt/azure/azure.go new file mode 100644 index 0000000..70d1124 --- /dev/null +++ b/internal/stt/azure/azure.go @@ -0,0 +1,15 @@ +package azure + +type AzureSTT struct { + // Azure STT 所需的字段 +} + +func NewAzureSTT() *AzureSTT { + return &AzureSTT{ + // 初始化 + } +} + +func (a *AzureSTT) Recognize(audioData []byte) (string, error) { + // 调用 Azure 的 API 进行语音识别 +} diff --git a/internal/stt/stt.go b/internal/stt/stt.go new file mode 100644 index 0000000..a3e83c1 --- /dev/null +++ b/internal/stt/stt.go @@ -0,0 +1,20 @@ +package stt + +type Service interface { + Recognize(audioData []byte) (string, error) +} + +func NewService() Service { + // 根据配置返回相应的实现 + cfg := config.GetConfig() + switch cfg.STT.Provider { + case "azure": + return azure.NewAzureSTT() + case "google": + return google.NewGoogleSTT() + case "local": + return local.NewLocalSTT() + default: + return local.NewLocalSTT() + } +} \ No newline at end of file diff --git a/internal/tts/azure/azure.go b/internal/tts/azure/azure.go new file mode 100644 index 0000000..fa8aac2 --- /dev/null +++ b/internal/tts/azure/azure.go @@ -0,0 +1,22 @@ +package azure + +import ( + "your_project/internal/config" + // 导入 Azure TTS SDK +) + +type AzureTTS struct { + apiKey string + // 其他必要的字段 +} + +func NewAzureTTS() *AzureTTS { + cfg := config.GetConfig() + return &AzureTTS{ + apiKey: cfg.Azure.TTSKey, + } +} + +func (a *AzureTTS) Synthesize(text string) ([]byte, error) { + // 调用 Azure TTS API,将文本转换为语音数据 +} \ No newline at end of file diff --git a/internal/tts/google/google.go b/internal/tts/google/google.go new file mode 100644 index 0000000..d781fc2 --- /dev/null +++ b/internal/tts/google/google.go @@ -0,0 +1,21 @@ +package google + +import ( + "your_project/internal/config" + // 导入 Google Cloud Text-to-Speech SDK +) + +type GoogleTTS struct { + apiKey string +} + +func NewGoogleTTS() *GoogleTTS { + cfg := config.GetConfig() + return &GoogleTTS{ + apiKey: cfg.Google.TTSKey, + } +} + +func (g *GoogleTTS) Synthesize(text string) ([]byte, error) { + // 调用 Google Cloud TTS API +} \ No newline at end of file diff --git a/internal/tts/tts.go b/internal/tts/tts.go new file mode 100644 index 0000000..eca9ba9 --- /dev/null +++ b/internal/tts/tts.go @@ -0,0 +1,18 @@ +package tts + +type Service interface { + Synthesize(text string) ([]byte, error) +} + +func NewService(provider string) Service { + switch provider { + case "azure": + return NewAzureTTS() + case "google": + return NewGoogleTTS() + case "local": + return NewLocalTTS() + default: + return NewLocalTTS() + } +} \ No newline at end of file diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 27b75bb..696ca3f 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -1,5 +1,20 @@ -// Copyright © 2023 KubeCub open source community. All rights reserved. +// Copyright © 2023 telepace 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 + +import ( + "crypto/sha256" + "encoding/hex" +) + + +func GenerateSessionID() string { + // 根据当前时间戳或其他随机数生成会话 ID +} + +func HashData(data []byte) string { + hash := sha256.Sum256(data) + return hex.EncodeToString(hash[:]) +} \ No newline at end of file diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go new file mode 100644 index 0000000..527e00d --- /dev/null +++ b/pkg/logger/logger.go @@ -0,0 +1,28 @@ +package logger + +import ( + "log" + "os" + + "github.com/sirupsen/logrus" +) + +var Logger = logrus.New() + +func Init(level string) { + // 设置日志输出格式 + Logger.SetFormatter(&logrus.TextFormatter{ + FullTimestamp: true, + }) + + // 设置日志级别 + lvl, err := logrus.ParseLevel(level) + if err != nil { + log.Printf("Invalid log level '%s', defaulting to 'info'", level) + lvl = logrus.InfoLevel + } + Logger.SetLevel(lvl) + + // 设置日志输出位置 + Logger.SetOutput(os.Stdout) +} \ No newline at end of file diff --git a/pkg/version/version.go b/pkg/version/version.go index 76f4b34..d68f548 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,4 +1,4 @@ -// Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +// Copyright © 2023 telepace & 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. diff --git a/scripts/LICENSE/LICENSE.md b/scripts/LICENSE/LICENSE.md index 93029cd..750f3fc 100644 --- a/scripts/LICENSE/LICENSE.md +++ b/scripts/LICENSE/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 kubecub open source community +Copyright (c) 2023 telepace 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 diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg index e91555c..0a33650 100644 --- a/scripts/githooks/commit-msg +++ b/scripts/githooks/commit-msg @@ -1,21 +1,20 @@ #!/usr/bin/env bash -# Copyright © 2023 KubeCub & Xinwei Xiong(cubxxw). All rights reserved. +# Copyright © 2023 telepace & 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'. +# You may need to make the scripts executable by 'chmod +x .git/hooks/commit-msg'. # commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint` # go-gitlint --msg-file="$1" -# An example hook script to check the commit log message. +# An example hook scripts to check the commit log message. # Called by "git commit" with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the @@ -27,44 +26,59 @@ RED="\e[31m" ENDCOLOR="\e[0m" printMessage() { - printf "${YELLOW}kubecub : $1${ENDCOLOR}\n" + printf "${YELLOW}telepace : $1${ENDCOLOR}\n" } printSuccess() { - printf "${GREEN}kubecub : $1${ENDCOLOR}\n" + printf "${GREEN}telepace : $1${ENDCOLOR}\n" } printError() { - printf "${RED}kubecub : $1${ENDCOLOR}\n" + printf "${RED}telepace : $1${ENDCOLOR}\n" } -printMessage "Running the kubecub commit-msg hook." +printMessage "Running the telepace 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 +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" +telepace_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +GITLINT_DIR="$telepace_ROOT/_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 +--msg-file=$1 \ +--subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \ +--subject-maxlen=150 \ +--subject-minlen=10 \ +--body-regex=".*" \ +--max-parents=1 if [ $? -ne 0 ] then - if ! command -v $GITLINT_DIR &>/dev/null; then - printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it." - fi - printError "Please fix your commit message to match kubecub coding standards" - printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md" - exit 1 +if ! command -v $GITLINT_DIR &>/dev/null; then + printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it." +fi +printError "Please fix your commit message to match kubecub coding standards" +printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md" +exit 1 +fi + +### Add Sign-off-by line to the end of the commit message +# Get local git config +NAME=$(git config user.name) +EMAIL=$(git config user.email) + +# Check if the commit message contains a sign-off line +grep -qs "^Signed-off-by: " "$1" +SIGNED_OFF_BY_EXISTS=$? + +# Add "Signed-off-by" line if it doesn't exist +if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then +echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1" fi \ No newline at end of file diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit index 7660e5d..3c21a62 100644 --- a/scripts/githooks/pre-commit +++ b/scripts/githooks/pre-commit @@ -5,7 +5,6 @@ # 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. @@ -13,12 +12,12 @@ # GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB" # # ============================================================================== +# LC_ALL=C local_branch="$(git rev-parse --abbrev-ref HEAD)" -valid_branch_regex="^(main|master|develop)$|(feature|feat|release|hotfix|test|bug|ci|style|)\/[a-z0-9._-]+$|^HEAD$" - +valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|telepace|hotfix|test|bug|bot|refactor|revert|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$" YELLOW="\e[93m" GREEN="\e[32m" @@ -26,18 +25,18 @@ RED="\e[31m" ENDCOLOR="\e[0m" printMessage() { - printf "${YELLOW}kubecub : $1${ENDCOLOR}\n" + printf "${YELLOW}telepace : $1${ENDCOLOR}\n" } printSuccess() { - printf "${GREEN}kubecub : $1${ENDCOLOR}\n" + printf "${GREEN}telepace : $1${ENDCOLOR}\n" } printError() { - printf "${RED}kubecub : $1${ENDCOLOR}\n" + printf "${RED}telepace : $1${ENDCOLOR}\n" } -printMessage "Running local kubecub pre-commit hook." +printMessage "Running local telepace pre-commit hook." # flutter format . # https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md @@ -47,9 +46,9 @@ limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB limitInMB=$(( $limit / 1000000 )) function file_too_large(){ - filename=$0 - filesize=$(( $1 / 2**20 )) - + filename=$0 + filesize=$(( $1 / 2**20 )) + cat < /dev/null 2>&1 then - against=HEAD + against=HEAD else - against="$empty_tree" + against="$empty_tree" fi # Set split so that for loop below can handle spaces in file names by splitting on line breaks @@ -96,8 +95,8 @@ fi if [[ ! $local_branch =~ $valid_branch_regex ]] then - printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. -Your commit will be rejected. You should rename your branch to a valid name(feat/name OR bug/name) and try again." + printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. +Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again." printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" exit 1 fi \ No newline at end of file diff --git a/scripts/githooks/pre-push b/scripts/githooks/pre-push index 1d9d67c..aee5edc 100644 --- a/scripts/githooks/pre-push +++ b/scripts/githooks/pre-push @@ -5,30 +5,100 @@ # 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" +local_branch="$(git rev-parse --abbrev-ref HEAD)" +valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|telepace|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$" + printMessage() { - printf "${YELLOW}kubecub : $1${ENDCOLOR}\n" + printf "${YELLOW}telepace : $1${ENDCOLOR}\n" } printSuccess() { - printf "${GREEN}kubecub : $1${ENDCOLOR}\n" + printf "${GREEN}telepace : $1${ENDCOLOR}\n" } printError() { - printf "${RED}kubecub : $1${ENDCOLOR}\n" + printf "${RED}telepace : $1${ENDCOLOR}\n" } -printMessage "Running local kubecub pre-push hook." +printMessage "Running local telepace pre-push hook." -if [[ `git status --porcelain` ]]; then - printError "This script needs to run against committed code only. Please commit or stash you changes." +if [[ $(git status --porcelain) ]]; then + printError "This scripts needs to run against committed code only. Please commit or stash you changes." exit 1 fi +COLOR_SUFFIX="\033[0m" + +BLACK_PREFIX="\033[30m" +RED_PREFIX="\033[31m" +GREEN_PREFIX="\033[32m" +BACKGROUND_GREEN="\033[33m" +BLUE_PREFIX="\033[34m" +PURPLE_PREFIX="\033[35m" +SKY_BLUE_PREFIX="\033[36m" +WHITE_PREFIX="\033[37m" +BOLD_PREFIX="\033[1m" +UNDERLINE_PREFIX="\033[4m" +ITALIC_PREFIX="\033[3m" + +# Function to print colored text +print_color() { + local text=$1 + local color=$2 + echo -e "${color}${text}${COLOR_SUFFIX}" +} + +# Function to print section separator +print_separator() { + print_color "==========================================================" ${PURPLE_PREFIX} +} + +# Get current time +time=$(date +"%Y-%m-%d %H:%M:%S") + +# Print section separator +print_separator + +# Print time of submission +print_color "PTIME: ${time}" "${BOLD_PREFIX}${CYAN_PREFIX}" +echo "" +author=$(git config user.name) +repository=$(basename -s .git $(git config --get remote.origin.url)) + +# Print additional information if needed +print_color "Repository: ${repository}" "${BLUE_PREFIX}" +echo "" + +print_color "Author: ${author}" "${PURPLE_PREFIX}" + +# Print section separator +print_separator + +file_list=$(git diff --name-status HEAD @{u}) +added_files=$(grep -c '^A' <<< "$file_list") +modified_files=$(grep -c '^M' <<< "$file_list") +deleted_files=$(grep -c '^D' <<< "$file_list") + +print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}" +print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}" +print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}" + +if [[ ! $local_branch =~ $valid_branch_regex ]] +then + printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. +Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again." + printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" + exit 1 +fi + # #printMessage "Running the Flutter analyzer" #flutter analyze @@ -38,4 +108,4 @@ fi # exit 1 #fi # -#printMessage "Finished running the Flutter analyzer" +#printMessage "Finished running the Flutter analyzer" \ No newline at end of file