Skip to content

Instantly share code, notes, and snippets.

@dictav
Created January 10, 2017 03:43
Show Gist options
  • Select an option

  • Save dictav/f54628bdb6caecea4159bac82cb4ba1f to your computer and use it in GitHub Desktop.

Select an option

Save dictav/f54628bdb6caecea4159bac82cb4ba1f to your computer and use it in GitHub Desktop.
Protocol Buffer example
syntax = "proto3";
package grpcexample;
service GRPCExample {
rpc GetPerson(Request) returns (Person) {}
rpc ListPeople(Request) returns (stream Person) {}
}
message Request {
}
message Person {
string name = 1;
int32 id = 2;
string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
string number = 1;
PhoneType type = 2;
}
repeated PhoneNumber phone = 4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment