douzhi2988
2016-10-13 15:50
浏览 2.2k
已采纳

如何在gRPC中使用预定义的protobuf类型(即“ google / protobuf / timestamp.proto”)

I'm trying to use google/protobuf/timestamp.proto in with gRPC plugin and Go. This is how I run protoc:

protoc -I  ./   ./*.proto --go_out=plugins=grpc:.

And this is my .proto:

#domain.proto
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.viant.xyz";
option java_outer_classname = "domain";

import "google/protobuf/timestamp.proto";

message Foo {
    Timestamp modifiedTime = 1;
    ...
}

I'm seeing the following errors:

domain.proto: Import "google/protobuf/timestamp.proto" was not found or had errors.
domain.proto:44:5: "Timestamp" is not defined.

Am I missing something, or this is not yet supported?

图片转代码服务由CSDN问答提供 功能建议

我正在尝试在gRPC插件中使用 google / protobuf / timestamp.proto </ code> 去。 这就是我运行 protoc </ code>:</ p>

  protoc -I ./ ./*.proto --go_out = plugins = grpc:。
 <  / code> </ pre> 
 
 

这是我的 .proto </ code>:</ p>

 #domain.proto 
syntax =“  proto3“; 
option java_multiple_files = true; 
option java_package =” com.viant.xyz“; 
option java_outer_classname =” domain“; 
 
import” google / protobuf / timestamp.proto“; 
 
message Foo {\  n时间戳ModifyTime = 1; 
 ... 
} 
 </ code> </ pre> 
 
 

我看到以下错误:</ p>

   domain.proto:找不到导入的“ google / protobuf / timestamp.proto”或有错误。
domain.proto:44:5:未定义“ Timestamp”。
 </ code> </ pre>  
 
 

我丢失了什么,还是尚不支持?</ p> </ div>

6条回答 默认 最新

相关推荐 更多相似问题