各位好,这两天一直在看 grpc 相关的东西,然后 API 网关这块顺便了解了下 grpc-gateway,但是在看官方的例子中,gateway.proto 文件如下:
syntax = "proto3";
package gateway;
import "google/api/annotations.proto";
message Message {
string msg = 1;
}
service Gateway {
rpc Echo (Message) returns (Message) {
option (google.api.http) = {
post: "/api/v1/echo"
body: "*"
};
}
}
之前已经顺利安装了 protoc-gen-grpc-gateway 插件,但是在执行如下语句:
protoc --grpc-gateway_out=logtostderr=true:. gateway.proto
老是提示如下的错误:
google/api/annotations.proto: File not found.
gateway.proto: Import "google/api/annotations.proto" was not found or had errors.
希望有熟悉的大佬们,麻烦帮忙解答下,如何安装这个缺失的 proto 文件