https://github.com/toransahu/grpc-eg-go
gRPC demonstration of uniary & bi-directional server-client communication
https://github.com/toransahu/grpc-eg-go
blog golang grpc grpc-go http2 medium microservice protobuf
Last synced: 9 months ago
JSON representation
gRPC demonstration of uniary & bi-directional server-client communication
- Host: GitHub
- URL: https://github.com/toransahu/grpc-eg-go
- Owner: toransahu
- Created: 2019-07-18T17:25:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T05:43:36.000Z (over 5 years ago)
- Last Synced: 2025-08-12T22:47:48.381Z (11 months ago)
- Topics: blog, golang, grpc, grpc-go, http2, medium, microservice, protobuf
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 12
- Watchers: 0
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is basic example of gRPC based microservice to serve a Virtual Stack Machine over HTTP2.0 network.
# Pre-requisites
```bash
# install protobuf compiler
~/grpc-eg-go
$ go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}
# install grpc
~/grpc-eg-go
$ go get -u -v google.golang.org/grpc
```
# Generate Go Source Code from Protobuf
```bash
~/grpc-eg-go
$ SRC_DIR=./
$ DST_DIR=$SRC_DIR
$ protoc -I=$SRC_DIR --go_out=plugins=grpc:$DST_DIR $SRC_DIR/machine/machine.proto
```
# Run
```bash
~/grpc-eg-go
$ go run cmd/run_machine_server.go
$ go run client/machine.go
```