Skip to Content
Building RESTful Web services with Go
book

Building RESTful Web services with Go

by Naren Yellavula
December 2017
Intermediate to advanced
316 pages
6h 58m
English
Packt Publishing
Content preview from Building RESTful Web services with Go

Compiling a protocol buffer with protoc

Until now, we have discussed how to write a protocol buffer file that is previously written in JSON or another data format. But, how do we actually integrate it into our programs? Remember that protocol buffers are data formats, no more than that. They are a format of communication between various systems, similar to JSON. These are the practical steps we follow for using protobufs in our Go programs:

  1. Install the protoc command-line tool and the proto library.
  2. Write a protobuf file with the .proto extension.
  3. Compile it to target a programming language (here, it is Go).
  4. Import structs from the generated target file and serialize the data.
  5. On a remote machine, receive the serialized data and decode it ...
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.
Start your free trial

You might also like

Hands-On RESTful Web Services with Go - Second Edition

Hands-On RESTful Web Services with Go - Second Edition

Naren Yellavula
Microservices with Go

Microservices with Go

Alexander Shuiskov

Publisher Resources

ISBN: 9781788294287Supplemental Content