Files
go-zero/tools/goctl/rpc/example/README-ko.md
Jeonghyeon Kim 48ca7f03b5 docs: add Korean translations (#5579)
Co-authored-by: kevin <wanjunfeng@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-21 13:49:20 +00:00

2.4 KiB

RPC 예제

English | 中文 | 한국어

이 디렉터리에는 모든 goctl rpc 코드 생성 시나리오에 대한 완전한 예제가 포함되어 있습니다.

각 예제에는 다음이 포함됩니다.

  • .proto 소스 파일
  • README.md(영어), README-cn.md(중국어), README-ko.md(한국어) 문서

예제

# 디렉터리 시나리오 주요 플래그
01 01-basic 기본 단일 서비스, import 없음
02 02-import-sibling 같은 디렉터리의 proto 파일 import --proto_path=.
03 03-import-subdir 하위 디렉터리의 proto import --proto_path=.
04 04-transitive-import 전이 import(A → B → C) --proto_path=.
05 05-multiple-services 하나의 proto에 여러 서비스 --multiple
06 06-wellknown-types 메시지에서 Google well-known types 사용
07 07-external-proto-same-pkg 외부 proto, 동일한 go_package -I ./ext_protos
08 08-external-proto-diff-pkg 외부 proto, 다른 go_package -I ./ext_protos
09 09-google-types-as-rpc RPC 파라미터로 Google well-known types 사용
10 10-streaming 서버/클라이언트/양방향 스트리밍

사전 요구 사항

빠른 시작

# protoc 플러그인 설치
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# 기본 예제 실행
cd 01-basic
mkdir -p output && cd output && go mod init example.com/demo && cd ..
goctl rpc protoc greeter.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 .