mock generator from protobuf and grpc
build the protoc-gen-mock plugin
make buildThis demo includes a gRPC server and a gRPC gateway for convenience.
What you will want to do is play with cmd/demo/main.go to manipulate mocks.
get submodules (if you want/need to regen proto files)
git submodule init
git submodule updaterun the demo gRPC server, it will listen on port 9090
make rundemoin another terminal, run the demo gRPC gateway, it will listen on port 8080
make rundemogwin another terminal, query the gRPC gateway
$ curl -s http://localhost:8080/api/v1/persons
{"code":2,"message":"example error","details":[]}
$ curl -s http://localhost:8080/api/v1/persons/jdoe
{"id":"123","name":"John Doe","email":"[email protected]"}