Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 916 Bytes

README.md

File metadata and controls

73 lines (51 loc) · 916 Bytes

grpcalc

A gRPC based calculator server and client.

Gears

  • go v1.23.2
  • protobuf (brew install protobuf)
  • protoc-gen-go
  • protoc-gen-go-grpc
  • some knowledge about protocol buffers
  • docker

How to run ?

  1. 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
  2. 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

How to consume?

  • grpcui (brew install grpc)
grpcui --plaintext 127.0.0.1:8080
  • grpcurl
  grpcurl -d '{
    "a": 10,
    "b": 2
  }' 127.0.0.1:8080