"Fossies" - the Fresh Open Source Software Archive

Member "protobuf-3.21.1/examples/addressbook.proto" (27 May 2022, 1409 Bytes) of package /linux/misc/protobuf-all-3.21.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "addressbook.proto": 3.19.4_vs_3.20.1.

    1 // See README.txt for information and build instructions.
    2 //
    3 // Note: START and END tags are used in comments to define sections used in
    4 // tutorials.  They are not part of the syntax for Protocol Buffers.
    5 //
    6 // To get an in-depth walkthrough of this file and the related examples, see:
    7 // https://developers.google.com/protocol-buffers/docs/tutorials
    8 
    9 // [START declaration]
   10 syntax = "proto3";
   11 package tutorial;
   12 
   13 import "google/protobuf/timestamp.proto";
   14 // [END declaration]
   15 
   16 // [START java_declaration]
   17 option java_multiple_files = true;
   18 option java_package = "com.example.tutorial.protos";
   19 option java_outer_classname = "AddressBookProtos";
   20 // [END java_declaration]
   21 
   22 // [START csharp_declaration]
   23 option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
   24 // [END csharp_declaration]
   25 
   26 // [START go_declaration]
   27 option go_package = "github.com/protocolbuffers/protobuf/examples/go/tutorialpb";
   28 // [END go_declaration]
   29 
   30 // [START messages]
   31 message Person {
   32   string name = 1;
   33   int32 id = 2;  // Unique ID number for this person.
   34   string email = 3;
   35 
   36   enum PhoneType {
   37     MOBILE = 0;
   38     HOME = 1;
   39     WORK = 2;
   40   }
   41 
   42   message PhoneNumber {
   43     string number = 1;
   44     PhoneType type = 2;
   45   }
   46 
   47   repeated PhoneNumber phones = 4;
   48 
   49   google.protobuf.Timestamp last_updated = 5;
   50 }
   51 
   52 // Our address book file is just one of these.
   53 message AddressBook {
   54   repeated Person people = 1;
   55 }
   56 // [END messages]