These field numbers are used to identify your fields in the message binary format, and should not be changed once your message type is in use. Assigning Field NumbersĪs you can see, each field in the message definition has a unique number. However, you can also specify composite types for your fields, including enumerations and other message types. In the above example, all the fields are scalar types: two integers ( page_number and result_per_page) and a string ( query).
proto file you use to define the message type.
Let's say you want to define a search request message format, where each search request has a query string, the particular page of results you are interested in, and a number of results per page. Defining A Message Typeįirst let's look at a very simple example. This is a reference guide – for a step by step example that uses many of the features described in this document, see the tutorial for your chosen language (currently proto2 only more proto3 documentation is coming soon). It covers the proto3 version of the protocol buffers language: for information on the proto2 syntax, see the Proto2 Language Guide.
3.5 CHARACTER SHEET GOOGLE DOCS HOW TO
proto file syntax and how to generate data access classes from your.
This guide describes how to use the protocol buffer language to structure your protocol buffer data, including.