Last active
September 12, 2018 09:39
-
-
Save canberkozcelik/206fe9d38cacd445356a83a16b369067 to your computer and use it in GitHub Desktop.
The protocol buffer file of the employee example
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 = "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