Skip to content

li-jin-gou/cwgo

 
 

Repository files navigation

cwgo

中文 | 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:

Tool Characteristics

  • 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.

Install cwgo Tool

# 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

Detailed Documentation

Command Line Tool

Contains detailed documentation on how cwgo CLI works, see this document

Layout

This documents explains Layouts discussing how layout are generated, see this document.

Client

The document details on how Generated Clients that have been Encapsulated Can be used, see this document

DB

Details information containing HOW TO Use cwgo TOOL GEN To Generate Curd Codes, see this document

Template Extension

Instructions on how to customize templates can be found in the document.

How to enable auto-completion

Supported in Bash

First download Bash autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project (you can Define location)

Temporary support for completion
PROG=cwgo

source ./autocomplete/bash_autocomplete
Permanent support for completion
sudo cp autocomplete/bash_autocomplete /etc/bash_completion.d/cwgo

source /etc/bash_completion.d/cwgo

Supported in Zsh

First download Zsh autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project (you can Define location)

Temporary support for completion
PROG=cwgo

source ./autocomplete/zsh_autocomplete

Supported in PowerShell

First download PowerShell autocomplete script, assuming it is downloaded to the autocomplete/ folder in the root directory of the project ( Customizable location)

Temporary support for completion

First, rename the downloaded powershell_autocomplete.ps1 to cwgo.ps1.

Then execute:

& autocomplete/cwgo.ps1
Permanent support for completion

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.

Open Source License

cwgo is based on Apache License 2.0, Apache License. Its dependent third-party component open-source licenses will include Licenses.

Contact Us

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 83.9%
  • TypeScript 12.0%
  • Thrift 3.0%
  • Shell 0.4%
  • SCSS 0.3%
  • Dockerfile 0.2%
  • Other 0.2%