ease-gateway

module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2022 License: BSD-3-Clause

README

Ease-gateway

Gateway service based on grpc-ecosystem/grpc-gateway. This helps you provide your APIs in both gRPC and RESTful style at the same time.

当我第一次使用gRPC就深深的爱上了她, 她在跨平台、跨语言、面向移动和HTTP/2设计上有着天然的优势, 我更喜欢的是她定义API的方式. 了解更多gRPC信息请查看英文官方文档中文官方文档

grpc-gateway 的出现更能引起开发者对使用gRPC的兴趣, 她可以帮你在原有gRPC服务的基础上做少量的改动, 便可以将原gRPC服务同时提供RESTful HTTP API, 了解更多RESTful API的例子可以参考GitHub REST APIGoogle REST API

ease-gateway 是站在巨人的肩膀上实现的, 增加了更符合企业级应用开发的Features:

  • 支持自定义的LoadBalancer
  • 既可以部署单机版模式, 也可注册到注册中心实现集群模式
  • 支持网关层的Parameter Validation Rules
  • 支持自定义的Annotaion

Architecture

Design

design.md

Validation Rule

gateway-validation-rule.md

Prepared

ease-gateway 使用GO MOD来管理Dependencies,clone代码之后直接在本地使用bazel构建

Build tools
  • Bazel 3.1.0+
  • Go 1.13.12+

Clone code

git clone https://github.com/binchencoder/ease-gateway.git

Bazel build gateway

cd ease-gateway

bazel build cmd/gateway/...

Usage

TODO

Run Examples

See examples/README.md

Directories

Path Synopsis
cmd
examples
grpc-server
* Command grpc-server is an example gRPC server * to be called by //cmd/gateway.
* Command grpc-server is an example gRPC server * to be called by //cmd/gateway.
internal/cmd/example-gateway-server
Command example-gateway-server is an example reverse-proxy implementation whose HTTP handler is generated by grpc-gateway.
Command example-gateway-server is an example reverse-proxy implementation whose HTTP handler is generated by grpc-gateway.
internal/cmd/example-grpc-server
* Command example-grpc-server is an example grpc server * to be called by example-gateway-server.
* Command example-grpc-server is an example grpc server * to be called by example-gateway-server.
internal/gateway
Package gateway is an example of grpc-gateway server
Package gateway is an example of grpc-gateway server
internal/proto/examplepb
Package examplepb is a reverse proxy.
Package examplepb is a reverse proxy.
gateway
internal/generator
Package generator provides an abstract interface to code generators.
Package generator provides an abstract interface to code generators.
protoc-gen-grpc-gateway
Command protoc-gen-grpc-gateway is a plugin for Google protocol buffer compiler to generate a reverse-proxy, which converts incoming RESTful HTTP/1 requests gRPC invocation.
Command protoc-gen-grpc-gateway is a plugin for Google protocol buffer compiler to generate a reverse-proxy, which converts incoming RESTful HTTP/1 requests gRPC invocation.
protoc-gen-grpc-gateway/internal/gengateway
Package gengateway provides a code generator for grpc gateway files.
Package gengateway provides a code generator for grpc gateway files.
protoc-gen-openapiv2/internal/genopenapi
Package genopenapi provides a code generator for OpenAPI v2.
Package genopenapi provides a code generator for OpenAPI v2.
runtime
Package runtime contains runtime helper functions used by servers which protoc-gen-grpc-gateway generates.
Package runtime contains runtime helper functions used by servers which protoc-gen-grpc-gateway generates.
Package integrate contains integrate helper functions used by servers which protoc-gen-grpc-gateway generates.
Package integrate contains integrate helper functions used by servers which protoc-gen-grpc-gateway generates.
Package util contains util helper functions used by servers which protoc-gen-grpc-gateway generates.
Package util contains util helper functions used by servers which protoc-gen-grpc-gateway generates.
glog
Package glog contains glog helper functions used by servers which protoc-gen-grpc-gateway generates.
Package glog contains glog helper functions used by servers which protoc-gen-grpc-gateway generates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL