Examples
Examples are available under examples/internal
directory.
- proto/examplepb/echo_service.proto, proto/examplepb/a_bit_of_everything.proto, proto/examplepb/unannotated_echo_service.proto: protobuf service definitions.
- proto/examplepb/echo_service.pb.go, proto/examplepb/a_bit_of_everything.pb.go, proto/examplepb/unannotated_echo_service.pb.go: generated Go service stubs and types.
- proto/examplepb/echo_service.pb.gw.go, proto/examplepb/a_bit_of_everything.pb.gw.go, proto/examplepb/unannotated_echo_service.pb.gw.go: generated gRPC-Gateway clients.
- proto/examplepb/unannotated_echo_service.yaml: gRPC API Configuration for
unannotated_echo_service.proto
. - server/main.go: service implementation.
- main.go: entrypoint of the generated reverse proxy.
To use the same port for custom HTTP handlers (e.g. serving swagger.json
), gRPC-Gateway, and a gRPC server, see this code example by CoreOS (and it’s accompanying blog post).
当前内容版权归 gRPC-Gateway 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 gRPC-Gateway .