Reusing Message in the same package in multiple files

383 Views Asked by At

Is there a way to reuse protobuf structs across multiple proto files?

in the client.proto file I have the following

message SingleOperation {
  string command = 1;
}

message ClientBatch {
  string unique_id = 1;
  repeated SingleOperation requests = 2;
  int64 sender = 3;
}

Then in network.proto file, I have the following

message MemPool {
  int32 sender = 1;
  string unique_id = 2;
  SingleOperation op = 3;
}
 

In the network.proto file, I need to reuse the SingleOperation message.

However, I do not see an option to do this.

Does protobuff support some sort of packaging to support struct reuse?

0

There are 0 best solutions below