A gateway to automatically provide RESTful API for gRPC
API Gateway
A native and easy gateway to provide RESTful API for gRPC, inspired by grpc-gateway, but fully automation.
Prepare:
- Download&&Install golang/protoc/docker and Env setting.
Usage:
- Get code: [git clone https://github.com/jmzwcn/api-gateway.git];
- Tell your macro-services directory in Makefile;
- "make run";
- Try the URL in your proto.
How to define RESTful in *.proto: [custom option]
your_service.proto:
syntax = "proto3";
package example;
+
+import "google/api/annotations.proto";
+
message StringMessage {
string value = 1;
}
service YourService {
- rpc Echo(StringMessage) returns (StringMessage) {}
+ rpc Echo(StringMessage) returns (StringMessage) {
+ option (google.api.http) = {
+ post: "/v1/example/echo"
+ body: "*"
+ };
+ }
}
Enjoy it!
相關文章
- gRPC(八)生態 grpc-gateway 應用:同一個服務端支援Rpc和Restful ApiRPCGateway服務端RESTAPI
- API架構的選擇,RESTful、GraphQL還是gRPCAPI架構RESTRPC
- 雲原生 API 閘道器,gRPC-Gateway V2 初探APIRPCGateway
- 「gRPC」 Gateway的實現RPCGateway
- gRPC學習之五:gRPC-Gateway實戰RPCGateway
- 理解RESTful APIRESTAPI
- 「gRPC」 Gateway的實現程式碼RPCGateway
- grpc-gateway的替代品--TurboRPCGateway
- Spring Cloud Gateway 實現 gRpc 代理SpringCloudGatewayRPC
- RESTful風格APIRESTAPI
- restful api最佳實踐RESTAPI
- restful api設計指南RESTAPI
- RESTful API 最佳實踐RESTAPI
- 理解RESTful Api設計RESTAPI
- RESTful API 設計指南RESTAPI
- RESTful API 編寫指南RESTAPI
- go語言gRPC系列(三) - 使用grpc-gateway同時提供HTTP和gRPC服務GoRPCGatewayHTTP
- Cilium Gateway API 特性(轉載)GatewayAPI
- RESTFUL API 安全設計指南RESTAPI
- nodejs實現restful APINodeJSRESTAPI
- RESTful API實踐總結RESTAPI
- RESTful api風格介紹RESTAPI
- 一文搞懂RESTful APIRESTAPI
- RestFul Api 設計 之 URLRESTAPI
- 簡單說說Restful APIRESTAPI
- RESTful API 設計規範RESTAPI
- 對RESTful API的個人看法RESTAPI
- Spring boot restful api demoSpring BootRESTAPI
- 日記1(chai && restful api)AIRESTAPI
- RESTful API 設計指南【轉】RESTAPI
- PostgREST是PostgreSQL的RESTful APIRESTSQLAPI
- 使用 Flask 實現 RESTful APIFlaskRESTAPI
- Zalando RESTful API和事件指南RESTAPI事件
- Kubernetes Gateway API 介紹GatewayAPI
- 使用ASP.NET Web API構建RESTful APIASP.NETWebAPIREST
- Gin 搭建 RESTful API 專案(1)RESTAPI
- 對比Restful Api和RpcRESTAPIRPC
- Restful API 的設計規範RESTAPI