protoc-gen-mock

module
v0.0.0-...-0bd687e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2022 License: MIT

README

protoc-gen-mock

mock generator from protobuf and grpc

build

build the protoc-gen-mock plugin

make build

run the demo

This 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 update

run the demo gRPC server, it will listen on port 9090

make rundemo

in another terminal, run the demo gRPC gateway, it will listen on port 8080

make rundemogw

in 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":"jdoe@example.com"}

Directories

Path Synopsis
cmd
Package demopb is a reverse proxy.
Package demopb is a reverse proxy.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL