The go-grpc-gateway-client
is a high quality http client generator for gRPC services that are fronted by grpc-gateway.
- Strongly typed client interface.
- Supports all gRPC features including streaming.
- Supports all grpc-gateway features including custom query parameters, and request body.
-
Install
go-grpc-gateway-client
:$ go install github.com/cloudfly/go-grpc-gateway-client/protoc-gen-go-grpc-gateway-client@latest
-
Generate client code
outdir=service
BASEDIR=./
protoc -I $BASEDIR \
-I $BASEDIR \
--go_out=paths=source_relative:$outdir/service \
--go-grpc_out=paths=source_relative:$outdir/service \
--grpc-gateway_out=logtostderr=true,paths=source_relative:$outdir/service \
--grpc-gateway-client_out=paths=source_relative:$outdir/service \
${BASEDIR}/your_service.proto
See example for a complete example.