https://github.com/raihanlh/go-grpc-example
Beginner tutorial for creating gRPC server and client using the latest version of protoc-gen-go to date (Dec 28 2021). Created because some tutorials are outdated.
https://github.com/raihanlh/go-grpc-example
golang grpc grpc-go
Last synced: 7 months ago
JSON representation
Beginner tutorial for creating gRPC server and client using the latest version of protoc-gen-go to date (Dec 28 2021). Created because some tutorials are outdated.
- Host: GitHub
- URL: https://github.com/raihanlh/go-grpc-example
- Owner: raihanlh
- Created: 2021-12-28T15:51:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-28T15:57:37.000Z (over 4 years ago)
- Last Synced: 2025-04-15T02:46:01.090Z (12 months ago)
- Topics: golang, grpc, grpc-go
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
Beginner tutorial for creating gRPC server and client using the latest version of protoc-gen-go to date (Dec 28 2021). Created because some tutorials are outdated.
## Install protoc
> go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
> go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
# Add path to environment variable
> echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc
> source $HOME/.bashrc
> echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc
> source $HOME/.bashrc
## Generate
> protoc --go_out=./chat --go_opt=paths=source_relative --go-grpc_out=./chat --go-grpc_opt=paths=source_relative ./chat.proto
## Run
> go run server/server.go
> go run client/client.go
## Reference
- https://tutorialedge.net/golang/go-grpc-beginners-tutorial/