July 2019
Intermediate to advanced
502 pages
14h
English
The last piece of the puzzle is implementing the gRPC transport in the transport.go file. It is similar, conceptually, to the HTTP transport, but there are a few details that are different. Let's break it down so it's clear how all the pieces fit together.
First, all the relevant packages are imported, including the gRPC transport from go-kit. Note that in news_service.go, there is no mention of go-kit anywhere. You can definitely implement a gRPC service directly in Go with the general gRPC libraries. However, here, go-kit will help make this much easier via its service and endpoints concepts:
package service import ( "context" "github.com/go-kit/kit/endpoint" grpctransport "github.com/go-kit/kit/transport/grpc" ...