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
- Spring Cloud Gateway 實現 gRpc 代理SpringCloudGatewayRPC
- 「gRPC」 Gateway的實現程式碼RPCGateway
- RESTful風格APIRESTAPI
- go語言gRPC系列(三) - 使用grpc-gateway同時提供HTTP和gRPC服務GoRPCGatewayHTTP
- nodejs實現restful APINodeJSRESTAPI
- RESTful API 最佳實踐RESTAPI
- restful api最佳實踐RESTAPI
- restful api設計指南RESTAPI
- 理解RESTful Api設計RESTAPI
- Kubernetes Gateway API 介紹GatewayAPI
- RESTful api風格介紹RESTAPI
- RESTful API 設計規範RESTAPI
- Zalando RESTful API和事件指南RESTAPI事件
- RESTFUL API 安全設計指南RESTAPI
- 簡單說說Restful APIRESTAPI
- RestFul Api 設計 之 URLRESTAPI
- 對比Restful Api和RpcRESTAPIRPC
- RESTful API實踐總結RESTAPI
- 一文搞懂RESTful APIRESTAPI
- Cilium Gateway API 特性(轉載)GatewayAPI
- Go語言RESTful JSON API建立GoRESTJSONAPI
- Gin 搭建 RESTful API 專案(1)RESTAPI
- Restful API 的設計規範RESTAPI
- Spring Cloud Gateway限制API速率 - tanzuSpringCloudGatewayAPI
- 面向未來的閘道器: Kubernetes Gateway API 和 Envoy GatewayGatewayAPI
- provide/injectIDE
- Building an Automatically Scaling Web ApplicationUIWebAPP
- 好RESTful API的設計原則RESTAPI
- Laravel restful API 學習記錄一LaravelRESTAPI
- GitHub 的 Restful HTTP API 設計分解GithubRESTHTTPAPI
- 【Myself-Security】SpringMVC 開發 RESTFul APISpringMVCRESTAPI
- Create orders using SAP Commerce Cloud Restful APICloudRESTAPI
- Restful API 中的錯誤處理RESTAPI