Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import timestamp in proto file of protobuf for GRPC

I am trying to use gRPC and using the exchange message format as protobuf. I wanted to add timestamp field inside my message.But i don't know the right way to add the import statement in proto file. I am using Golang so I need an output as .pb.go

like image 851
Rajesh kumar Avatar asked Jun 10 '17 01:06

Rajesh kumar


1 Answers

Make sure to import in your proto file:

import "google/protobuf/timestamp.proto";

And use the type for you variable like:

google.protobuf.Timestamp time_name = 1;
like image 53
Sergeenho Avatar answered Sep 18 '22 08:09

Sergeenho