January 2020
Intermediate to advanced
640 pages
16h 56m
English
So, what does a protocol buffer message definition look like? Here is a short example:
syntax = "proto3";package geocoding;message Address { string query = 1; int32 page_number = 2; int32 result_per_page = 3;}In the preceding definition, the first line announces the version of the protocol buffer format that's going to be used for the rest of the file to the compiler. In this example, we are using version 3, which is the latest version and the one should be used for any new projects. The second line defines the name of the package, which will be used as a container for the generated protocol buffer definitions. As you can probably guess, the use of packages avoids conflicts between projects that define messages with the ...