hello.proto
- See
./code/hello.proto
1syntax = "proto2";
2
3package tutorial;
4
5// available types:
6// bool, int32, float, double, string
7message Person {
8 optional string name = 1;
9 optional int32 id = 2;
10 optional string email = 3;
11
12 enum PhoneType {
13 MOBILE = 0;
14 HOME = 1;
15 WORK = 2;
16 }
17
18 message PhoneNumber {
19 optional string number = 1;
20 optional PhoneType type = 2 [ default = HOME ];
21 }
22
23 repeated PhoneNumber phones = 4;
24}
25
26message AddressBook { repeated Person people = 1; }