mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 14:15:44 +02:00
kitex: add page (#7782)
This commit is contained in:
parent
fa9cbe265b
commit
5892e647de
2 changed files with 42 additions and 0 deletions
21
pages.zh/common/kitex.md
Normal file
21
pages.zh/common/kitex.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# kitex
|
||||||
|
|
||||||
|
> Kitex 是 Go RPC 框架 Kitex 框架提供的用于生成代码的一个命令行工具。
|
||||||
|
> 目前,kitex 支持 thrift 和 protobuf 的 IDL,并支持生成一个服务端项目的骨架。
|
||||||
|
> 更多信息:<https://www.cloudwego.io>.
|
||||||
|
|
||||||
|
- 生成客户端代码,项目在 `$GOPATH` 目录下:
|
||||||
|
|
||||||
|
`kitex {{路径/到/IDL文件.thrift}}`
|
||||||
|
|
||||||
|
- 生成客户端代码,项目不在 `$GOPATH` 目录下:
|
||||||
|
|
||||||
|
` kitex -module {{github.com/xx-org/xx-name}} {{路径/到/IDL文件.thrift}}`
|
||||||
|
|
||||||
|
- 根据 protobuf IDL 文件生成客户端代码:
|
||||||
|
|
||||||
|
`kitex -type protobuf {{路径/到/IDL文件.proto}}`
|
||||||
|
|
||||||
|
- 生成服务端代码:
|
||||||
|
|
||||||
|
`kitex -service {{svc_name}} {{路径/到/IDL文件.thrift}}`
|
21
pages/common/kitex.md
Normal file
21
pages/common/kitex.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# kitex
|
||||||
|
|
||||||
|
> Code generation tool provided by the Go RPC framework Kitex.
|
||||||
|
> Kitex accepts both thrift and protobuf IDLs, and supports generating a skeleton of a server side project.
|
||||||
|
> More information: <https://www.cloudwego.io>.
|
||||||
|
|
||||||
|
- Generate client codes when a project is in `$GOPATH`:
|
||||||
|
|
||||||
|
`kitex {{path/to/IDL_file.thrift}}`
|
||||||
|
|
||||||
|
- Generate client codes when a project is not in `$GOPATH`:
|
||||||
|
|
||||||
|
` kitex -module {{github.com/xx-org/xx-name}} {{path/to/IDL_file.thrift}}`
|
||||||
|
|
||||||
|
- Generate client codes with protobuf IDL:
|
||||||
|
|
||||||
|
`kitex -type protobuf {{path/to/IDL_file.proto}}`
|
||||||
|
|
||||||
|
- Generate server codes:
|
||||||
|
|
||||||
|
`kitex -service {{svc_name}} {{path/to/IDL_file.thrift}}`
|
Loading…
Add table
Reference in a new issue