← 返回刚才阅读的位置

知识卡片

操作参考卡 · 4545.d.12

代码生成要固定工具链

理解等级:中级

.proto同时描述消息和服务方法,编译器与语言插件生成相应消息类型、接口和桩。Go消息插件与gRPC服务插件是不同工具;原稿调用go-grpc_out却未完整列出插件安装。实际使用应固定生成器版本并核对产物,不能把这份早期稿的安装命令当作当前完整步骤。

原稿生成选项--go_out与--go-grpc_out对应不同插件;应先固定版本并核对相应生成器,不能只复制命令选项。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Loose Coupling · 查看原书依据

      Our keyvalue.proto file results in two files, named keyvalue.pb.go and keyvalue_grpc.pb.go. Without these flags, the output files are placed in a directory named after the Go package’s import path. Our keyvalue.proto file, for example, would result in a file named github.com/cloud-native-go/ch08/keyvalue/keyvalue.pb.go. Implementing the gRPC Service To implement our gRPC server, we’ll need to implement the

    参考来源

    - 位置:《Cloud Native Go》第08章《Loose Coupling》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch08.xhtml) - 结论依据:.proto同时描述消息和服务方法,编译器与语言插件生成相应消息类型、接口和桩。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:Our keyvalue.proto file results in two files, named keyvalue.pb.go and keyvalue_grpc.pb.go. Without these flags, the output files are placed in a directory named after the Go package’s import path. Our keyvalue.proto file, for example, would result in a file named github.com/cloud-native-go/ch08/keyvalue/keyvalue.pb.go. Implementing the gRPC Service To implement our gRPC server, we’ll need to implement the