Skip to content

Instantly share code, notes, and snippets.

@S1lvesterTake
Created June 18, 2019 03:42
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 S1lvesterTake/9d73bbf25dd93e3e0bd3d9e031f27f1c to your computer and use it in GitHub Desktop.
Save S1lvesterTake/9d73bbf25dd93e3e0bd3d9e031f27f1c to your computer and use it in GitHub Desktop.
Sample Proto file
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