Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nlm/protoc-gen-mock
WIP: mock generator for gRPC services
https://github.com/nlm/protoc-gen-mock
grpc protoc-gen protocol-buffers
Last synced: about 1 month ago
JSON representation
WIP: mock generator for gRPC services
- Host: GitHub
- URL: https://github.com/nlm/protoc-gen-mock
- Owner: nlm
- License: mit
- Created: 2022-07-09T16:26:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-19T10:42:56.000Z (over 2 years ago)
- Last Synced: 2024-11-15T07:57:49.495Z (about 1 month ago)
- Topics: grpc, protoc-gen, protocol-buffers
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# protoc-gen-mock
mock generator from protobuf and grpc
## build
build the `protoc-gen-mock` plugin
```sh
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)
```sh
git submodule init
git submodule update
```run the demo gRPC server, it will listen on port 9090
```bash
make rundemo
```in another terminal, run the demo gRPC gateway, it will listen on port 8080
```sh
make rundemogw
```in another terminal, query the gRPC gateway
```sh
$ 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]"}
```