A gRPC based calculator server and client.
- go v1.23.2
- protobuf (brew install protobuf)
- protoc-gen-go
- protoc-gen-go-grpc
- some knowledge about protocol buffers
- docker
-
Using Docker
docker build -t grpcalc .
docker run -d -p 8080:8080 grpcalc
Alternatively you can use makefile to run commands
make build-docker-image
docker run-docker-image
-
Local Setup
go mod tidy
go run server/main.go
Alternatively you can use makefile to run commands
To generate proto code
make generate
make run-server
- grpcui (brew install grpc)
grpcui --plaintext 127.0.0.1:8080
- grpcurl
grpcurl -d '{
"a": 10,
"b": 2
}' 127.0.0.1:8080