Last active
May 4, 2022 07:49
-
-
Save var23rav/c71cccc649fc00c19fad08aaee52aad0 to your computer and use it in GitHub Desktop.
Generate Go file for protos with import dependencies using Protoc, a Reader service added to the proto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package car; | |
import "common/vehicle_info.proto"; | |
message Car { | |
vehicle.Vehicle info = 1; | |
string carType = 2; | |
} | |
service Reader { | |
rpc GetPriceInfo(GetPriceInfoRequest) returns (GetPriceInfoResponse); | |
} | |
message GetPriceInfoRequest { | |
string manufacturer = 1; | |
string model = 2; | |
} | |
message GetPriceInfoResponse { | |
vehicle.PurchaseEntity info = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package vehicle; | |
message PurchaseEntity { | |
string manufacturer = 1; | |
string model = 2; | |
int32 price = 3; | |
} | |
message Vehicle { | |
PurchaseEntity info = 1; | |
string engineType = 2; | |
int32 wheelCount = 3; | |
int32 registrationNumber = 4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can generate them together using..