Skip to content

Commit

Permalink
docs: add git template branch desc in cwgo (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoranz758 committed Apr 29, 2024
1 parent 881d1af commit 44f47cd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions content/en/docs/cwgo/tutorials/client/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OPTIONS:
--module value, --mod value Specify the Go module name to generate go.mod.
--idl value Specify the IDL file path. (.thrift or .proto)
--template --template https://github.com/***/cwgo_template.git Specify the template path. Currently cwgo supports git templates, such as --template https://github.com/***/cwgo_template.git
--branch value Specify the git template's branch, default is main branch.
--registry value Specify the registry, default is None
--proto_search_path value, -I value [ --proto_search_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--pass value [ --pass value ] pass param to hz or kitex
Expand All @@ -44,6 +45,7 @@ OPTIONS:
- module/mod: Specify the go mod name, which must be specified outside of GOPATH. In GOPATH, the default name is the path relative to GOPATH
- idl: Specify the main IDL file path
- template: Specify a custom template that supports local and git reading. Please refer to the usage for details [Template Extension](/docs/cwgo/tutorials/templete-extension/)
- branch: Specify the git template's branch, default is main branch.
- registry: The specified service registration component is currently only useful for RPC types and supports parameters ZK, NACOS, ETCD, and POLARIS
- proto_search_path/I: Add IDL search path, only effective for pb
- pass: The parameters passed to hz and kitex, such as the `handler dir` parameter passed to `hz`, should be entered as --pass "--handler_dir ./handler". Parameters passed to the tool, hz reference [doc](/docs/hertz/tutorials/toolkit/command/), kitex reference [doc](/docs/kitex/tutorials/code-gen/code_generation/)
Expand Down
2 changes: 2 additions & 0 deletions content/en/docs/cwgo/tutorials/server/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OPTIONS:
--module value, --mod value Specify the Go module name to generate go.mod.
--idl value Specify the IDL file path. (.thrift or .proto)
--template --template https://github.com/***/cwgo_template.git Specify the template path. Currently cwgo supports git templates, such as --template https://github.com/***/cwgo_template.git
--branch value Specify the git template's branch, default is main branch.
--registry value Specify the registry, default is None.
--proto_search_path value, -I value [ --proto_search_path value, -I value ] Add an IDL search path for includes.
--pass value [ --pass value ] Pass param to hz or Kitex.
Expand All @@ -45,6 +46,7 @@ OPTIONS:
- module/mod: Specify the go mod name, which must be specified outside of GOPATH. In GOPATH, the default name is the path relative to GOPATH
- idl: Specify the main IDL file path
- template: Specify a custom template that supports local and git reading. Please refer to the usage for details [Template Extension](/docs/cwgo/tutorials/templete-extension/)
- branch: Specify the git template's branch, default is main branch.
- registry: The specified service registration component is currently only useful for RPC types and supports parameters ZK, NACOS, ETCD, and POLARIS
- proto_search_path/I: Add IDL search path, only effective for pb
- pass: The parameters passed to hz and kitex, such as the `handler dir` parameter passed to `hz`, should be entered as --pass "--handler_dir ./handler". Parameters passed to the tool, hz reference [doc](/docs/hertz/tutorials/toolkit/command/), kitex reference [doc](/docs/kitex/tutorials/code-gen/code_generation/)
Expand Down
6 changes: 3 additions & 3 deletions content/en/docs/cwgo/tutorials/templete-extension/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cwgo server -type RPC -service {service name} -idl {idl path} -template {tpl pat

## Template Reading

cwgo supports reading templates from local or git, while git supports https or ssh formats.
cwgo supports reading templates from local or git. git supports https or ssh formats, with `-template` specifying the template path and `-branch` specifying the template branch(default to the main branch).

RPC Server、Client, HTTP Server、Client all support template extension, specific usage can be found in the following text.

Expand All @@ -28,13 +28,13 @@ cwgo server -type RPC -service {service name} -idl {idl path} -template {local
### git https

```sh
cwgo server -type RPC -service {service name} -idl {idl path} -template https://github.com/***/cwgo_template.git
cwgo server -type RPC -service {service name} -idl {idl path} -template https://github.com/***/cwgo_template.git -branch {branch path}
```

### git ssh

```sh
cwgo server -type RPC -service {service name} -idl {idl path} -template git@github.com:***/cwgo_template.git
cwgo server -type RPC -service {service name} -idl {idl path} -template git@github.com:***/cwgo_template.git -branch {branch path}
```

## RPC
Expand Down
2 changes: 2 additions & 0 deletions content/zh/docs/cwgo/tutorials/client/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OPTIONS:
--module value, --mod value Specify the Go module name to generate go.mod.
--idl value Specify the IDL file path. (.thrift or .proto)
--template --template https://github.com/***/cwgo_template.git Specify the template path. Currently cwgo supports git templates, such as --template https://github.com/***/cwgo_template.git
--branch value Specify the git template's branch, default is main branch.
--registry value Specify the registry, default is None
--proto_search_path value, -I value [ --proto_search_path value, -I value ] Add an IDL search path for includes. (Valid only if idl is protobuf)
--pass value [ --pass value ] pass param to hz or kitex
Expand All @@ -44,6 +45,7 @@ OPTIONS:
- module/mod:指定 go mod 名称,非 GOPATH 下必须指定,GOPATH 下默认以相对于 GOPATH 的路径作为名字
- idl:指定主 IDL 文件路径
- template:指定自定义模板,支持本地和 git 读取,用法详见 [模板扩展](/zh/docs/cwgo/tutorials/templete-extension/)
- branch: 指定 git 模板读取的分支,默认为主分支
- registry:指定服务注册组件,目前仅对 RPC 类型有用, 支持参数 ZK、NACOS、ETCD、POLARIS
- proto_search_path/I:添加 IDL 搜索路径,只对 pb 生效
- pass:传递给 hz 和 kitex 的参数,如传递 `hz` 的 `handler_dir` 参数, 则应输入 --pass "--handler_dir ./handler"。传递给工具的参数,hz 参考[文档](/zh/docs/hertz/tutorials/toolkit/command/),kitex 参考[文档](/zh/docs/kitex/tutorials/code-gen/code_generation/)
Expand Down
2 changes: 2 additions & 0 deletions content/zh/docs/cwgo/tutorials/server/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OPTIONS:
--module value, --mod value Specify the Go module name to generate go.mod.
--idl value Specify the IDL file path. (.thrift or .proto)
--template --template https://github.com/***/cwgo_template.git Specify the template path. Currently cwgo supports git templates, such as --template https://github.com/***/cwgo_template.git
--branch value Specify the git template's branch, default is main branch.
--registry value Specify the registry, default is None.
--proto_search_path value, -I value [ --proto_search_path value, -I value ] Add an IDL search path for includes.
--pass value [ --pass value ] Pass param to hz or Kitex.
Expand All @@ -45,6 +46,7 @@ OPTIONS:
- module/mod:指定 go mod 名称,非 GOPATH 下必须指定,GOPATH 下默认以相对于 GOPATH 的路径作为名字
- idl:指定主 IDL 文件路径
- template:指定自定义模板,支持本地和 git 读取,用法详见 [模板扩展](/zh/docs/cwgo/tutorials/templete-extension/)
- branch: 指定 git 模板读取的分支,默认为主分支
- registry:指定服务注册组件,目前仅对 RPC 类型有用, 支持参数 ZK、NACOS、ETCD、POLARIS
- proto_search_path/I:添加 IDL 搜索路径,只对 pb 生效
- pass:传递给 hz 和 kitex 的参数,如传递 `hz` 的 `handler_dir` 参数, 则应输入 --pass "--handler_dir ./handler"。传递给工具的参数,hz 参考[文档](/zh/docs/hertz/tutorials/toolkit/command/),kitex 参考[文档](/zh/docs/kitex/tutorials/code-gen/code_generation/)
Expand Down
6 changes: 3 additions & 3 deletions content/zh/docs/cwgo/tutorials/templete-extension/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cwgo server -type RPC -service {service name} -idl {idl path} -template {tpl pa

## 模板读取

cwgo 支持从本地或 git 中读取模板git 支持 https 或 ssh 的形式。
cwgo 支持从本地或 git 中读取模板。其中 git 支持 https 或 ssh 的形式`-template` 指定模板路径,`-branch` 指定模板分支(默认为主分支)

RPC Server、Client, HTTP Server、Client 均支持模板拓展,具体用法见下文。

Expand All @@ -28,13 +28,13 @@ cwgo server -type RPC -service {service name} -idl {idl path} -template {local
### git https

```sh
cwgo server -type RPC -service {service name} -idl {idl path} -template https://github.com/***/cwgo_template.git
cwgo server -type RPC -service {service name} -idl {idl path} -template https://github.com/***/cwgo_template.git -branch {branch path}
```

### git ssh

```sh
cwgo server -type RPC -service {service name} -idl {idl path} -template git@github.com:***/cwgo_template.git
cwgo server -type RPC -service {service name} -idl {idl path} -template git@github.com:***/cwgo_template.git -branch {branch path}
```

## RPC
Expand Down

0 comments on commit 44f47cd

Please sign in to comment.