gRPC for Go Developers: A Practical Guide
· 5 min read
What is gRPC ?
gRPC stands for Google Remote Procedure Calls and it is a framework for building APIs. It uses HTTP/2 which allows developers to build high performance APIs. Though it has limited browser support, it is better suited for internal systems that require real-time streaming and has large data loads. In this tutorial we would code some simple gRPC APIs. Checkout this video if you wish to know more about gRPC
Setup
First we need to install protocol buffer compiler. For installation instructions, see Protocol Buffer Compiler Installation
We would also need to install protocol compiler plugins for Go using the following commands:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Update your PATH so that the protoc compiler can find the plugins
export PATH="$PATH:$(go env GOPATH)/bin"