Summary
In this chapter, we started our journey by understanding the basics of protocol buffers. Then, we came across the protocol buffers language, which has many types such as scalar, enumeration, and repeated types. We saw a few analogies between JSON and protocol buffers. We learned why protocol buffers are more memory efficient than the plain JSON data format. We defined a sample protocol buffer by simulating a network interface. The message keyword is used to define messages in a protocol buffer.
Next, we installed the protoc compiler to compile our files written in the protocol buffer language. Then, we saw how to compile a .proto file to generate a .go file. This Go file has all the structs and interfaces for the main program to consume. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access