Hello and welcome to the gold and programming language course in the previous session, we talked about
Protocol Boffa concept.
And in this session, we want to talk about the authors protocol offer consent.
How do we use portable?
Now that you only know that part of life is faster than Jason.
Let's take a look on how to use these technology.
Portable has three main components that you have to deal with.
One message descriptors when using portable, we have to define our messages as structures in that protocol
face.
Two massage implementations, messages, definitions are not enough to represent and exchange data in
any programming language.
We have to generate classes, objects to deal with data in the chosen programming language.
Google provides could generators for the most common programming languages.
Three, passing and serialization after defining and creating pulled off messages, we need to be able
to exchange these messages.
Google helps us here again as long as we use one of the supported programming language.
Pirates off message definition.
Now we can go about defining our Port of office schema.
We will need to start with a dot puerto fine.
Let's define the bukas structure we saw earlier.
Now you can see the syntax.
Let's understand what he just wrote.
At first, we specify the syntax we want to use, this is plural three, and it specify that we want
these to be a part of the main package.
Then via specified hours schema, the definition in a dark truth fight are simple you had a message
for each data structure you want to serialized.
Then is specify a name and a time for each field in the message here.
What is our data structure?
This will have to fill the name of time S3 and Espeon of time entry to keep in mind that the time comes
before the variable name, unlike go programming language.
Also, each field is associated with the unique number.
These numbers are used to identify our files in the encoded message and should not be changed once the
message type is in use as specifying field rules.
We can specify certain rules for our messages throughout office as the singular event form messages
can have zero or one of these built, but not more than one, and this is the default feed rule for
two three syntax.
Repeated this chamber repeated any number of times, including zero in well-formed message.
The order of the repeated values will be present.
Colorful off message implementation.
Now that you have a dart prior to find, the next thing you need to do is generate the classes, you
will need to read and write messages.
To do this, you'll need to run the protocol before compiling a popular talk on your dart protocol.
If you haven't installed a compiler, download pilot packages.
You can see the comments.
Then around the following coming to install the GO political buffer plugins by the comment that you
see.
The compiler plugins, Protoc, Dash, Gen Dash Go will be installed in Gilpin, defaulting to go past
its lesbian.
It must be in your password protocol compiler protocol to find it.
Now Ron, the compiler first go to go past an SRT folder and go to your project, then run below comment
protocol that must go on the score out that Dash Dash Go Endre score out flag specifies which directory
to generate.
The girl code for the Dart Protocol will be a story we are keeping it and the root of the project.
The second argument as asterisk is specify which file to compile.
Here we are compiling on files with a Dot Perotti extension.
Running these should generate a book dot pbe dot go find with the equivalent girl code that you will
require to use our port call buffer in order not to prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.