Skip to content

Instantly share code, notes, and snippets.

@mrmeku
Last active May 31, 2018 00:02
Show Gist options
  • Save mrmeku/01e2288b02b5344e86f101efa2e7e95e to your computer and use it in GitHub Desktop.
Save mrmeku/01e2288b02b5344e86f101efa2e7e95e to your computer and use it in GitHub Desktop.
Example Protocol Buffer schema definition
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