gRPC calculator
A simple gRPC service calling remote objects with low latency, using protocol buffers and Go
- forked demo from Fullstack with Santosh
- published to Docker Hub and GitHub
Bug fixes to original code
- added support for CLI arguments for operands
- the client app: ensures output is only a single Int32 value by calling result.GetResult(), not the full *pb.AddResponse (ex: 4 vs Result:4)
Usage notes
- ensure Docker maps port 50052 on the container
- the server and client must be executed from the root directory for logging to work:
- go run ./cmd/client.go
- ./bin/client
- querying via grpcurl:
- grpcurl -plaintext localhost:50052 list
- grpcurl -plaintext -d '{"Operand1":24,"Operand2":42}' localhost:50052 calculator.Calculator/Multiply
TODO
- add gRPC unit tests