Last active
May 31, 2018 00:02
-
-
Save mrmeku/01e2288b02b5344e86f101efa2e7e95e to your computer and use it in GitHub Desktop.
Example Protocol Buffer schema definition
This file contains 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"; | |
option java_multiple_files = true; | |
option java_package = "schema"; | |
option java_generic_services = true; | |
// An RPC service which has a method to request a list of cars. | |
service CarService { | |
rpc GetCars(GetCarsRequest) returns (GetCarsResponse); | |
} | |
// The shape of a valid request to our service. | |
message GetCarsRequest { | |
Manufacturer manufacturer = 1; | |
} | |
// The shape of a valid response from our service. | |
message GetCarsResponse { | |
repeated Car cars = 1; | |
} | |
enum Manufacturer { | |
UNKOWN_MANUFACTURER = 0; | |
TOYOTA = 1; | |
HONDA = 2; | |
} | |
message Car { | |
Manufacturer manufacturer = 1; | |
string model = 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment