我正在尝试部署需要google protobuf 时间戳的服务,但我收到错误消息。
gcloud endpoints services deploy api_descriptor.pb api_config.yaml --validate-only
ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot
convert to service config.
'ERROR: unknown location: Unresolved type '.google.protobuf.Timestamp''
我生成 api_descriptor.pb 的命令:
protoc \
--plugin=protoc-gen-go=${GOBIN}/protoc-gen-go \
-I . proto/service.proto \
--descriptor_set_out=api_descriptor.pb \
--go_out=plugins=grpc:. \
需要 google.protobuf.Timestamp 的 proto 文件中的相关位:
syntax = "proto3";
package proto;
import "vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
message CandleStick {
string ID = 1;
double Open = 2;
double Close = 3;
double High = 4;
double Low = 5;
google.protobuf.Timestamp TimeStamp = 6;
}
尝试了几个小时未能成功解决此问题。提前致谢!