{"id":20515830,"url":"https://github.com/kuper-tech/grpc-wiremock","last_synced_at":"2025-04-14T00:33:31.707Z","repository":{"id":171850120,"uuid":"546543715","full_name":"Kuper-Tech/grpc-wiremock","owner":"Kuper-Tech","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-20T09:32:20.000Z","size":449,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-08T17:31:28.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kuper-Tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-06T08:43:53.000Z","updated_at":"2024-07-08T17:31:28.351Z","dependencies_parsed_at":null,"dependency_job_id":"76ab31d6-769d-4687-8a8f-f5a216f12ac3","html_url":"https://github.com/Kuper-Tech/grpc-wiremock","commit_stats":null,"previous_names":["sbermarket-tech/grpc-wiremock","kuper-tech/grpc-wiremock"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrpc-wiremock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrpc-wiremock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrpc-wiremock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fgrpc-wiremock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kuper-Tech","download_url":"https://codeload.github.com/Kuper-Tech/grpc-wiremock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224846794,"owners_count":17379608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T21:25:06.042Z","updated_at":"2024-11-15T21:25:06.832Z","avatar_url":"https://github.com/Kuper-Tech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpc-wiremock\n\n**grpc-wiremock** is a tool for mocking server API. It provides\n\n* simultaneous work with **multiple APIs**;\n* mocking of **grpc (protobuf)** API;\n* generating mocks by **proto** and **openapi** files;\n* hot reload on contract changes.\n\n**grpc-wiremock** is based on [Wiremock](https://wiremock.org/docs), so it provides the all its power of matchers.  \nAlso it inherites [Wiremock GUI](https://github.com/holomekc/wiremock) made by [holomekc](https://github.com/holomekc).\n\n[Here](docs/comparsion.md) you can compare the functionality with existing solutions.\n\n## Getting started\n\n### Quick start\nCheck out our [wearable](https://github.com/nktch1/wearable) repo \nwith an example service. \n\nThere you will find how the service interacts with the mock and \na docker-compose file for quick startup.\n\n### Interface\n\n```bash\nMOCKS_PATH=\"$(PWD)/test/wiremock\"\nCERTS_PATH=\"$(PWD)/certs\"\nCONTRACTS_PATH=\"$(PWD)/deps\"\nWIREMOCK_GUI_PORT=9000\n\n# grpc-wiremock supports multiple APIs simultaneously.\n# This means that the another APIs will go up\n# on port 8001, 8002, etc.\n\nYOUR_MOCK_API=8000  \n\ndocker run \\\n  -p ${WIREMOCK_GUI_PORT}:${WIREMOCK_GUI_PORT} \\\n  -p ${YOUR_MOCK_API}:${YOUR_MOCK_API} \\\n  -v ${MOCKS_PATH}:/home/mock \\\n  -v ${CERTS_PATH}:/etc/ssl/mock/share \\\n  -v ${CONTRACTS_PATH}:/proto \\\n  SberMarket-Tech/grpc-wiremock@latest\n```\n\nTo view status and API mocks\n\n* Open Supervisor GUI on http://localhost:9000.\n* Open Wiremock GUI on http://localhost:8000/__admin/webapp\n\n## Overview\n\nIn general, **grpc-wiremock** contains two main components. \n\nYou can read more about each of them here:\n- [mocks generator](docs/mocks.md);\n- [grpc-to-http-proxy generator](docs/proxy.md).\n\nIn the diagram you can see how your requests are distributed within the **grpc-wiremock** container.\n\n![grpc-wiremock](docs/images/grpc-wiremock.png)\n\n### Benchmarks\nYou can also read about performance with multiple mock APIs [here](docs/benchmarks.md).\n\n# For developers\n\n## Dockerfile development\nTo develop `Dockerfile` run `./dev/watch_build_image.sh`.\nIt will monitor changes you'are adding to `Dockerfile` and rebuild local image\nwith tag `docker.io/sbermarkettech/grpc-wiremock:dev`.\n\n## Golang code development\nTo develop golang code\n\n1. Build `Dockerfile` once - run command:\n\n    ```\n    ./dev/build_image.sh\n    ```\n2. Start docker container based on the built image:\n\n    ```\n    make -C ./dev/example/ compose-up compose-logs\n    ```\n3. Log into docker container:\n\n    ```\n    make -C ./dev/example/ compose-exec\n    ```\n4. Change `dev/watch_wiremock.sh` for your needs,  \n    i.e. set `-build` command to rebuild and install grpc2http:\n\n    ```\n    CompileDaemon -color -log-prefix \\\n        -build='make install -C cmd/grpc2http' \\\n        -command='bash ./dev/init_wiremock.sh'\n    ```\n5. Run `./dev/watch_wiremock.sh`  inside docker container  \n    When you change code it will restart wiremock to new version of code\n\n6. Make a request to wiremock:\n\n    ```\n    grpcurl -H 'TestHeader: check' \\\n        -insecure --authority  push-sender \\\n        -d '{\"uuid\": \"1234\", \"message\": \"foo\"}' \\\n        127.0.0.1:3009 push_sender.PushSender/Notify\n    ```\n## Release process\nTo release new version\n\n1. Create [new release on github](https://github.com/SberMarket-Tech/grpc-wiremock/releases/new) in semver format, i. e. `v1.1.4`.\n2. [GitHub actions](https://github.com/SberMarket-Tech/grpc-wiremock/actions) will build docker image and upload it to [DockerHub SberMarket-Tech grpc-wiremock](https://hub.docker.com/r/sbermarkettech/grpc-wiremock).\n\n### License\n**grpc-wiremock** is under the Apache License, Version 2.0. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fgrpc-wiremock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuper-tech%2Fgrpc-wiremock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fgrpc-wiremock/lists"}