Skip to content

Commit

Permalink
docs: api-list
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarisW committed Mar 1, 2024
2 parents 4d49629 + fe7dddf commit 159aac8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 122 deletions.
94 changes: 29 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ the developer experience. The main features of cwgo tool are as follows:

## Tool Characteristics

- Supports generating project templates
- Support for generating engineering 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.
The cwgo tool supports the generation of MVC project layout. Users only need to complete their own business code in the corresponding position according to the functions of different directories, focusing on business logic.

- Supports generating server and client code
- Support 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.
The cwgo tool supports generating Server and Client codes of Kitex and Hertz, and provides an encapsulation of Client. Users can call downstream out of the box, eliminating the cumbersome steps of encapsulating the Client.

- Supports generating database code
- Support for generating relational 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.
The cwgo tool supports generating relational database CURD code. Users no longer need to encapsulate the cumbersome CURD code by themselves, which improves the user's work efficiency.

- Support fallback to Kitex and Hz tools
- Support for generating document database code

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.
The cwgo tool supports generating document database CURD code based on IDL (Thrift/protobuf), and currently supports Mongodb. Users no longer need to encapsulate the cumbersome CURD code by themselves, which improves the user's work efficiency.

- Support for generating command line automatic completion scripts

The cwgo tool supports generating command line completion scripts to improve the efficiency of user command line writing.

- Support fallback to Kitex, Hz tools

If you were a Kitex or Hz user before, you can still use the cwgo tool. The cwgo tool supports the fallback function and can be used as Kitex and Hz, truly realizing a tool to generate all.

## Install cwgo Tool

Expand All @@ -45,6 +49,10 @@ GOPROXY=https://goproxy.cn/,direct go install github.com/cloudwego/cwgo@latest

Contains detailed documentation on how cwgo CLI works, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/cli/)

### Template Extension

Instructions on how to customize templates can be found in the [document](https://www.cloudwego.io/docs/cwgo/tutorials/templete-extension/).

### Layout

This documents explains Layouts discussing how layout are generated, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/layout/).
Expand All @@ -55,67 +63,23 @@ The document details on how Generated Clients that have been Encapsulated Can be

### DB

Details information containing HOW TO Use cwgo TOOL GEN To Generate Curd Codes, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/db/)

### Api-list

supports getting the relationship between routes and (route registration) code by analyzing Hertz project code, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/api-list)

### Template Extension

Instructions on how to customize templates can be found in the [document](https://www.cloudwego.io/docs/cwgo/tutorials/templete-extension/).

### How to enable auto-completion
Details information containing HOW TO Use cwgo TOOL To Generate relational Curd Codes, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/db/)

#### Supported in Bash
### Doc

##### Temporary support for Bash completion
Including how to use the cwgo tool to generate document database CURD code, see this [document](https://www.cloudwego.cn/docs/cwgo/tutorials/doc/).

```shell
mkdir autocomplete # You can choose any location you like
cwgo completion bash > ./autocomplete/bash_autocomplete
source ./autocomplete/bash_autocomplete
```

##### Permanent support for Bash completion

```shell
sudo cp autocomplete/bash_autocomplete /etc/bash_completion.d/cwgo

source /etc/bash_completion.d/cwgo
```

#### Supported in Zsh

##### Temporary support for Zsh completion

```shell
mkdir autocomplete # You can choose any location you like
cwgo completion zsh > ./autocomplete/zsh_autocomplete
source ./autocomplete/zsh_autocomplete
```

#### Supported in PowerShell

##### Temporary support for PowerShell completion

```shell
mkdir autocomplete
cwgo completion powershell | Out-File autocomplete/cwgo.ps1
& autocomplete/cwgo.ps1
```
### Api-list

##### Permanent support for PowerShell completion
supports getting the relationship between routes and (route registration) code by analyzing Hertz project code, see this [document](https://www.cloudwego.io/docs/cwgo/tutorials/api-list)

open the $profile.
### Server

Add a line inside:
Including how to generate RPC Server and HTTP Server code, see this [document](https://www.cloudwego.cn/docs/cwgo/tutorials/server/).

```shell
& path/to/autocomplete/cwgo.ps1
```
### auto-completion

Note that the name and path of the ps1 script must be correctly configured here, and then permanent auto-completion can be performed.
Including how to enable command line auto completion function, see this [document](https://www.cloudwego.cn/docs/cwgo/tutorials/auto-completion/).

## Open Source License

Expand Down
82 changes: 25 additions & 57 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

中文 | [English](./README.md)

cwgo 是 CloudWeGo All in one 代码生成工具,整合了各个组件的优势,提高开发者提体验
cwgo 是 CloudWeGo All in one 代码生成工具,整合了各个组件的优势,以提高开发者的体验
cwgo 工具可以方便生成工程化模版,其主要功能特点如下:

## 工具特点
Expand All @@ -13,11 +13,19 @@ cwgo 工具可以方便生成工程化模版,其主要功能特点如下:

- 支持生成 Server、Client 代码

cwgo 工具支持生成 Kitex、Hertz 的 Server 和 Client 代码,提供了对 Client 的封装。用户可以开箱即用的调用下游,免去封装 Client 的繁琐步骤
cwgo 工具支持生成 Kitex、Hertz 的 Server 和 Client 代码,提供了对 Client 的封装。用户可以开箱即用的调用下游,免去封装 Client 的繁琐步骤

- 支持生成数据库代码
- 支持生成关系型数据库代码

cwgo 工具支持生成数据库 CURD 代码。用户无需再自行封装繁琐的 CURD 代码,提高用户的工作效率。
cwgo 工具支持生成关系型数据库 CURD 代码。用户无需再自行封装繁琐的 CURD 代码,提高用户的工作效率。

- 支持生成文档类数据库代码

cwgo 工具支持基于 IDL (thrift/protobuf) 生成文档类数据库 CURD 代码,目前支持 Mongodb。用户无需再自行封装繁琐的 CURD 代码,提高用户的工作效率。

- 支持生成命令行自动补全脚本

cwgo 工具支持生成命令行自动补全脚本,提高用户命令行编写的效率。

- 支持回退为 Kitex、Hz 工具

Expand All @@ -41,6 +49,10 @@ GOPROXY=https://goproxy.cn/,direct go install github.com/cloudwego/cwgo@latest

包含命令行工具形式及使用,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/cli/)

### 模板拓展

包含用户自定义模板的使用,详见[文档](https://www.cloudwego.cn/zh/docs/cwgo/tutorials/templete-extension/)

### Layout

Layout 生成及 Layout 介绍,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/layout/)
Expand All @@ -51,67 +63,23 @@ Layout 生成及 Layout 介绍,详见[文档](https://www.cloudwego.io/zh/docs

### DB

包含如何使用 cwgo 工具生成 CURD 代码,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/db/)

### Api-list

支持分析 Hertz 项目代码获取路由和(路由注册)代码的关系,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/api-list)

### 模版扩展

包含如何自定义模板,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/templete-extension/)

### 如何启用自动补全功能

#### 在 Bash 中支持

##### 临时支持 Bash 补全

```shell
mkdir autocomplete # You can choose any location you like
cwgo completion bash > ./autocomplete/bash_autocomplete
source ./autocomplete/bash_autocomplete
```

##### 永久支持 Bash 补全
包含如何使用 cwgo 工具生成关系型数据库 CURD 代码,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/db/)

```shell
sudo cp autocomplete/bash_autocomplete /etc/bash_completion.d/cwgo

source /etc/bash_completion.d/cwgo
```
### Doc

#### 在 Zsh 中支持

##### 临时支持 Zsh 补全

```shell
mkdir autocomplete # You can choose any location you like
cwgo completion zsh > ./autocomplete/zsh_autocomplete
source ./autocomplete/zsh_autocomplete
```
包含如何使用 cwgo 工具生成文档型数据库 CURD 代码,详见[文档](https://www.cloudwego.cn/zh/docs/cwgo/tutorials/doc/)

#### 在 PowerShell 中支持

##### 临时支持 PowerShell 补全

```shell
mkdir autocomplete
cwgo completion powershell | Out-File autocomplete/cwgo.ps1
& autocomplete/cwgo.ps1
```
### Api-list

##### 永久支持 PowerShell 补全
支持分析 Hertz 项目代码获取路由和(路由注册)代码的关系,详见[文档](https://www.cloudwego.io/zh/docs/cwgo/tutorials/api-list)

我们打开 $profile。
### Server

在里面添加一行:
包含如何生成 RPC Server、HTTP Server 代码,详见[文档](https://www.cloudwego.cn/zh/docs/cwgo/tutorials/server/)

```shell
& path/to/autocomplete/cwgo.ps1
```
### 命令行自动补全

注意这里要正确配置 ps1 脚本的名字和路径,然后就可以进行永久的自动补全了。
包含如何启用命令行自动补全功能,详见[文档](https://www.cloudwego.cn/zh/docs/cwgo/tutorials/auto-completion/)

## 开源许可

Expand Down

0 comments on commit 159aac8

Please sign in to comment.