/go-grpc

Simple implementation gRPC with go lang

Primary LanguageGo

logo

gRPC Communication with go

About

My study of the full cycle course module of grpc with go lang

Concepts

  • gRPC
  • Protobuf
  • Streaming

Commands

install

sudo apt install protobuf-compiler
brew install protobuf
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/protobuf/cmd/protoc-gen-go

go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

Generate stubs

protoc --proto_path=proto/ proto/*.proto --plugin=$(go env GOPATH)/bin/protoc-gen-go --go_out=.
protoc --proto_path=proto/ proto/*.proto --plugin=$(go env GOPATH)/bin/protoc-gen-go-grpc --go-grpc_out=.

Run server

go run cmd/server/server.go
 
go run cmd/client/client.go