Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepabo/protoc-gen-go-client-mock
protoc-gen-go-client-mock is a protoc plugin that generates a mock of client that bundles gRPC Clients for multiple services.
https://github.com/pepabo/protoc-gen-go-client-mock
Last synced: about 1 month ago
JSON representation
protoc-gen-go-client-mock is a protoc plugin that generates a mock of client that bundles gRPC Clients for multiple services.
- Host: GitHub
- URL: https://github.com/pepabo/protoc-gen-go-client-mock
- Owner: pepabo
- License: mit
- Created: 2023-03-27T07:08:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-25T22:32:28.000Z (about 1 year ago)
- Last Synced: 2024-06-19T19:30:24.726Z (7 months ago)
- Language: Go
- Size: 43.9 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# protoc-gen-go-client-mock
`protoc-gen-go-client-mock` is a protoc plugin that generates a mock of [client that bundles gRPC Clients for multiple services](https://github.com/pepabo/protoc-gen-go-client).
## Example
Generate mock client ([client_mock.go](example/gen/go/myapp/client_mock.go)) that bundles gRPC clients generated by proto files in [the directory](example/proto/myapp).
## Requirements
- `protoc-gen-go`
- `protoc-gen-go-grpc`
- [`protoc-gen-go-grpc-mock`](https://github.com/sorcererxw/protoc-gen-go-grpc-mock)
- [`protoc-gen-go-client`](https://github.com/pepabo/protoc-gen-go-client)## Options
| Option | Type | Description |
| --- | --- | --- |
| `package` | string | Specify package name (ex `--go-client_opt=package=xxxx` ) |
| `same_package` | bool | Make the package the same as the package generated by proto-gen-go (ex `--go-client_opt=same_package` ) |
| `with_close` | bool | Add `Close()` method for closing *grpc.ClientConn from client |