Created
June 18, 2019 03:42
-
-
Save S1lvesterTake/9d73bbf25dd93e3e0bd3d9e031f27f1c to your computer and use it in GitHub Desktop.
Sample Proto file
This file contains 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 = "proto3"; | |
package tutorial; | |
import "google/protobuf/timestamp.proto"; | |
message Person { | |
string name = 1; | |
int32 id = 2; // Unique ID number for this person. | |
string email = 3; | |
enum PhoneType { | |
MOBILE = 0; | |
HOME = 1; | |
WORK = 2; | |
} | |
message PhoneNumber { | |
string number = 1; | |
PhoneType type = 2; | |
} | |
repeated PhoneNumber phones = 4; | |
google.protobuf.Timestamp last_updated = 5; | |
} | |
// Our address book file is just one of these. | |
message AddressBook { | |
repeated Person people = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment