Appearance
Day 22 - gRPC
安装
bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latestproto文件
protobuf
syntax = "proto3";
service UserService {
rpc GetUser(GetRequest) returns (User);
}
message GetRequest {
int64 id = 1;
}
message User {
int64 id = 1;
string name = 2;
}生成代码
bash
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
user.proto📅 学习进度
| Day | 主题 | 状态 |
|---|---|---|
| 01-21 | 基础/工程 | ✅ |
| 22 | gRPC | ✅ |
| 23 | Docker | ⬜ |
