rpc-gateway使用(同时提供rpc和http接口)
介绍第三方库
https://github.com/grpc-ecosystem/grpc-gateway
在grpc之上加一层代理并转发,转变成protobuf格式来访问grpc服务
安装
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
安装好后在gopath的bin目录下
本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/p/11863024.html