中文 | English
cwgo is an all-in-one code generation tool for CloudWeGo. It integrates the advantages of various components to improve the developer experience. The main features of cwgo tool are as follows:
-
Supports generating project templates
cwgo tool supports generating MVC project layouts. Users only need to complete their own business logic in the corresponding locations according to the functionality of different directories, focusing on business logic.
-
Supports generating server and client code
cwgo supports generating Kitex and Hertz's server and client code, providing encapsulation for clients. Users can use it out of the box to call downstream services, saving them from cumbersome steps such as packaging clients.
-
Supports generating database code
cwgo tool supports generating database CURD (Create Update Read Delete) codes. Users no longer need to package tedious CURD codes themselves, thereby improving work efficiency.
-
Support fallback to Kitex and Hz tools
If you were a user of Kitex or Hz before, you can still use the cwgo tool. With its rollback function support backward compatibility with these tools.
# Go 1.15 and earlier version
GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get github.com/cloudwego/cwgo@latest
# Go 1.16 and later version
GOPROXY=https://goproxy.cn/,direct go install github.com/cloudwego/cwgo@latest
Contains detailed documentation on how cwgo CLI works, see this document
This documents explains Layouts discussing how layout are generated, see this document.
The document details on how Generated Clients that have been Encapsulated Can be used, see this document
Details information containing HOW TO Use cwgo TOOL GEN To Generate Curd Codes, see this document
Instructions on how to customize templates can be found in the document.
First download Bash autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project (you can Define location)
PROG=cwgo
source ./autocomplete/bash_autocomplete
sudo cp autocomplete/bash_autocomplete /etc/bash_completion.d/cwgo
source /etc/bash_completion.d/cwgo
First download Zsh autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project (you can Define location)
PROG=cwgo
source ./autocomplete/zsh_autocomplete
First download PowerShell autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project ( Customizable location)
First, rename the downloaded powershell_autocomplete.ps1 to cwgo.ps1.
Then execute:
& autocomplete/cwgo.ps1
open the $profile.
Add a line inside:
& path/to/autocomplete/cwgo.ps1
Note that the name and path of the ps1 script must be correctly configured here, and then permanent auto-completion can be performed.
cwgo is based on Apache License 2.0, Apache License. Its dependent third-party component open-source licenses will include Licenses.
-
Email: [email protected]
-
How to become a member: COMMUNITY MEMBERSHIP
-
Issues: Issues
-
Slack: Join our Slack channel
-
Feishu group (Register for Feishu and join the group)