How it works...
The GRPC server is set up to listen on port 4444. Once the client connects, it can send requests and receive responses from the server. The structure of the requests, responses, and supported methods are dictated by the .proto file we created in step 4. In practice, when integrating against GRPC servers, they should provide the .proto file, which can be used to automatically generate a client.
In addition to the client, the protoc command generates the stubs for the server and all that's required is to fill in the implementation details. The generated Go code also has JSON tags and the same structs could be reused for JSON REST services. Our code sets up an insecure client. To handle GRPC securely, you need to use an SSL certificate. ...
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