Building gRPC Interceptors in Golang: Client and Server (Unary and Streaming)



Building gRPC Interceptors in Golang: Client and Server (Unary and Streaming)

Building gRPC Interceptors in Golang: Client and Server (Unary and Streaming)

Welcome to this gRPC video using Golang, part of the series about API Technologies in System Design. In this tutorial episode I share with you how to implement gRPC Interceptors for both implementations Client and Server; including both types of RPCs: Unary and Streaming using Golang

What is a gRPC Interceptor? gRPC provides simple APIs to implement and install interceptors on a per ClientConn/Server basis. Interceptor intercepts the execution of each RPC call. Users can use interceptors to do logging, authentication/authorization, metrics collection, and many other functionality that can be shared across RPCs.

== Relevant links

■ Example Code: https://github.com/MarioCarrion/grpc-microservice-example/tree/5eb0ca198be185c500e83d3f4bc507c321fd290d
■ Tutorial: System Design using gRPC with Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_EX1nv8fgltlm0CnJTH8Nwg
■ Learning Golang: Context package: Cancellations, Deadlines and Request-scoped values: https://youtu.be/mgJMIZsWfB4
■ Software Architecture and System Design in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B-

== All Go/Golang Playlists

■ Building Microservices in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu
■ Go/Golang Tools and Packages: https://www.youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3
■ Learning Concurrency Patterns in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_Fhj_px_DzNzTsXs-mRwv1t
■ Learning Go/Golang : https://www.youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy
■ Learning Relational Databases in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_EgwoQTvNUflrYL_4qzdB7f
■ Testing in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq

== Connect with me!

■ https://twitter.com/MarioCarrion
■ https://www.instagram.com/mario.carrion
■ https://linkedin.com/in/MarioCarrion

00:00 Building gRPC Interceptors in Golang: Client and Server (Unary and Streaming)
00:12 What are gRPC Interceptors?
00:38 Implementing Server Unary Interceptor in Golang
02:45 gRPC Interceptors: accessing metadata in Golang
04:03 Implementing Server Streaming Interceptor in Golang
08:01 Implementing Client Unary Interceptor in Golang
09:33 gRPC Interceptors: adding metadata in Golang
10:20 Implementing Client Streaming Interceptor in Golang
14:06 Conclusion of Building gRPC Interceptors in Golang: Client and Server (Unary and Streaming)

=== Who am I?

Hello👋🏼! I’m Mario, a Hands-on Software Architect and Lead Backend Engineer with decades of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices.

In this channel I share different topics I’ve learned while working for small startups and large companies including the processes I’ve followed over the years for successfully delivering complex enterprise systems from start to end.

Subscribe if you like Software Development, Software Architecture and System Design!

Keep it up. Don’t give up!

#golang #grpc #systemdesign

=== Our Vlog Channel

https://www.youtube.com/c/RubyCarrion/videos

=== Affiliate links

■ Amazon Shop 🛒 https://www.amazon.com/shop/rubycarrion
■ Technical/Non-technical Books – Recommended by Mario Carrion 📚 https://www.amazon.com/shop/rubycarrion?listId=P8KAGIWTNH3X&ref=cm_sw_em_r_inf_list_own_rubycarrion_dp_dyqYP6yk67Hif

DISCLAIMER: Some of the links shared above are affiliate links. As a member of these affiliate programs, I earn a small commission from your purchases at no additional cost to you. Thank you in advance for your support!

Comments are closed.