Skip to content

Instantly share code, notes, and snippets.

@canberkozcelik
Last active September 12, 2018 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canberkozcelik/206fe9d38cacd445356a83a16b369067 to your computer and use it in GitHub Desktop.
Save canberkozcelik/206fe9d38cacd445356a83a16b369067 to your computer and use it in GitHub Desktop.
The protocol buffer file of the employee example
syntax = "proto2";
// there's also "proto3"
package employeebook;
option java_package = "com.cnb.employeebook";
option java_outer_classname = "EmployeeBookProtos";
message Employee {
required string name = 1;
required int32 id = 2;
optional string email = 3;
optional string position = 4;
enum PhoneType {
WORK = 0;
MOBILE = 1;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = WORK];
}
repeated PhoneNumber phones = 5;
}
message EmployeeBook {
repeated Employee employees = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment