gRPC in Go

gRPC in Go

1h 9mIntermediate2023-07-03

Authors

Miki Tebeka

Miki Tebeka

CEO at 353Solutions

Course details

A growing number of companies use gRPC, a popular framework that writes services and clients. In this course, Miki Tebeka presents an overview of gRPC, then shows you the protocol buffers serialization format, as well as how to write a gPRC definition file (.proto), write gRPC servers and clients, and use advanced gRPC features like streaming, reflection, and more. Learn about RPC in general, then go into protocol buffers, how gRPC use them, why gRPC chose HTTP/2, and how the gRPC ecosystem works. Explore writing and compiling a .proto file, using generated code, and generating JSON encoding. Dive into gRPC servers and clients, and discover how to define a streaming endpoint, send streaming data to the client, and handle streaming responses from the server. Plus, go over advanced topics like writing interceptors, sharing .proto definitions, testing your code, and using the gRPC gateway.

Skills covered

gRPCGoSoftware ArchitectureGoogleProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off

Concepts

Introduction

  • Why gRPC
  • What you should know
  • Setting up

gRPC Overview

  • RPC in general
  • Protocol buffers
  • HTTP 2
  • The gRPC ecosystem

Protocol Buffers

  • Writing .proto file
  • Compiling .proto to Go
  • Using generated code
  • JSON encoding
  • Challenge - Invoice
  • Solution - Invoice

gRPC Server

  • Defining the service
  • Generating Go code
  • Running the server
  • Adding reflection
  • Using grpcurl to call your server
  • Challenge - End
  • Solution - End

gRPC Client

  • Creating a client
  • Calling the server
  • Sending metadata
  • Challenge
  • Solution

Streaming

  • Streaming overview
  • Defining a streaming endpoint
  • Streaming server handler
  • Streaming client

Advanced Topics

  • Writing interceptors
  • Sharing .proto definitions
  • Testing your code
  • Using gRPC gateway

Conclusion

  • Next steps
40,000 Toman