mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-06-22 18:01:57 +08:00
docs: add Korean translations (#5579)
Co-authored-by: kevin <wanjunfeng@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# 示例 10:流式 RPC
|
||||
|
||||
[English](README.md) | 中文 | [한국어](README-ko.md)
|
||||
|
||||
本示例演示 gRPC 的三种流式通信模式:服务端流、客户端流和双向流。
|
||||
|
||||
## Proto 定义
|
||||
@@ -63,4 +65,4 @@ output/
|
||||
|
||||
- 支持三种流式模式:服务端流(响应带 `stream`)、客户端流(请求带 `stream`)和双向流(两端都带 `stream`)。
|
||||
- goctl 为每个流式 RPC 方法生成独立的逻辑文件。
|
||||
- 流式客户端代码不会自动生成,需直接使用 gRPC 客户端。
|
||||
- goctl 会生成流式客户端包装方法;请使用返回的 gRPC stream 发送和接收消息。
|
||||
|
||||
68
tools/goctl/rpc/example/10-streaming/README-ko.md
Normal file
68
tools/goctl/rpc/example/10-streaming/README-ko.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# 예제 10: 스트리밍 RPC
|
||||
|
||||
[English](README.md) | [中文](README-cn.md) | 한국어
|
||||
|
||||
이 예제는 서버 스트리밍, 클라이언트 스트리밍, 양방향 스트리밍이라는 세 가지 gRPC 스트리밍 패턴을 모두 보여줍니다.
|
||||
|
||||
## proto 정의
|
||||
|
||||
`stream.proto`는 각 스트리밍 패턴을 보여주는 세 개의 RPC 메서드를 정의합니다.
|
||||
|
||||
`go_package`는 전체 모듈 경로를 사용합니다.
|
||||
|
||||
```protobuf
|
||||
option go_package = "example.com/demo/pb";
|
||||
```
|
||||
|
||||
## 생성 명령
|
||||
|
||||
먼저 출력 디렉터리에 `go.mod`를 초기화합니다.
|
||||
|
||||
```bash
|
||||
mkdir -p output && cd output && go mod init example.com/demo && cd ..
|
||||
```
|
||||
|
||||
그런 다음 코드를 생성합니다.
|
||||
|
||||
```bash
|
||||
goctl rpc protoc stream.proto \
|
||||
--go_out=output \
|
||||
--go-grpc_out=output \
|
||||
--zrpc_out=output \
|
||||
--go_opt=module=example.com/demo \
|
||||
--go-grpc_opt=module=example.com/demo \
|
||||
--module=example.com/demo \
|
||||
-I .
|
||||
```
|
||||
|
||||
생성되는 디렉터리 구조:
|
||||
|
||||
```
|
||||
output/
|
||||
├── etc
|
||||
│ └── streamsvc.yaml
|
||||
├── go.mod
|
||||
├── internal
|
||||
│ ├── config
|
||||
│ │ └── config.go
|
||||
│ ├── logic
|
||||
│ │ ├── bidistreamlogic.go
|
||||
│ │ ├── clientstreamlogic.go
|
||||
│ │ └── serverstreamlogic.go
|
||||
│ ├── server
|
||||
│ │ └── streamserviceserver.go
|
||||
│ └── svc
|
||||
│ └── servicecontext.go
|
||||
├── pb
|
||||
│ ├── stream.pb.go
|
||||
│ └── stream_grpc.pb.go
|
||||
├── streamservice
|
||||
│ └── streamservice.go
|
||||
└── streamsvc.go
|
||||
```
|
||||
|
||||
## 핵심 사항
|
||||
|
||||
- 세 가지 스트리밍 패턴을 지원합니다. 서버 스트리밍(응답에 `stream`), 클라이언트 스트리밍(요청에 `stream`), 양방향 스트리밍(양쪽 모두 `stream`).
|
||||
- goctl은 각 스트리밍 RPC 메서드마다 별도의 logic 파일을 생성합니다.
|
||||
- goctl은 스트리밍 클라이언트 래퍼 메서드를 생성합니다. 반환된 gRPC stream을 사용해 메시지를 송수신하세요.
|
||||
@@ -1,5 +1,7 @@
|
||||
# Example 10: Streaming RPC
|
||||
|
||||
English | [中文](README-cn.md) | [한국어](README-ko.md)
|
||||
|
||||
This example demonstrates all three gRPC streaming patterns: server streaming, client streaming, and bidirectional streaming.
|
||||
|
||||
## Proto Definition
|
||||
@@ -63,4 +65,4 @@ output/
|
||||
|
||||
- Supports three streaming patterns: server streaming (`stream` on response), client streaming (`stream` on request), and bidirectional streaming (`stream` on both).
|
||||
- goctl generates separate logic files for each streaming RPC method.
|
||||
- Streaming client code is not auto-generated; use the gRPC client directly.
|
||||
- goctl generates streaming client wrapper methods; use the returned gRPC stream to send and receive messages.
|
||||
|
||||
Reference in New Issue
Block a user