x-gateway

command module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

README

API-Gateway

基于Go-micro的高性能网关,增加自定义micro工具,如AuthCORS等.

API​​网关为服务提供一个统一的公共流量入口。

MICRO-API

API-Gateway的应用场景

  • 流量入口,统一用户访问的全部或者部分流量入口,包括移动端、PC Web端.
  • 允许不同系统的用户通过相同的网关访问后端的不同系统.
  • 对用户的请求进行统一认证(同时依赖后端认证服务).
  • 对用户操作进行鉴权(权限校验),确定用户是否具有具有操作或者访问资源的权限(同时依赖后端鉴权服务).
  • 记录用户的操作行为.
  • 追踪用户的操作行为链.

功能设计

  • 认证&鉴权JWT+Casbin Auth
  • 跨域支持 CORS
  • Metrics Prometheus
  • Trace Opentracing
  • REST to GRPC 转换REST调用到GRPC(HTTP[s] -> API-Gateway -> Micro Srv)[计划中...]
  • 提供服务发现
  • 动态路由公共
  • 高性能
  • 智能路由
  • 流量控制管理
  • 日志定制
  • 链路追踪
  • 认证
  • 版本化
  • 灰度,AB策略
  • ...

TODO

运行网关

# 编译
$ make build

# API
$ make run_api                                  # 默认mdns + http
$ make run_api registry=etcd transport=tcp      # 指定etcd + tcp

# Web
$ make run_web                                  # 默认mdns + http
$ make run_web registry=etcd transport=tcp      # 指定etcd + tcp

Docker

# tag自定义
$ make docker tag=docker.pkg.github.com/micro-in-cn/api-gateway/api-gateway:v1.15.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
Package api is an API Gateway
Package api is an API Gateway
proto
Package go_micro_api is a generated protocol buffer package.
Package go_micro_api is a generated protocol buffer package.
cmd
Package debug implements metrics/logging/introspection/...
Package debug implements metrics/logging/introspection/...
stats
Package stats provides a service that collects stats from all services in the registry.
Package stats provides a service that collects stats from all services in the registry.
stats/handler
Package handler is the handler for the `micro debug stats` service
Package handler is the handler for the `micro debug stats` service
web
Package web provides a dashboard for debugging and introspection of go-micro services
Package web provides a dashboard for debugging and introspection of go-micro services
internal
token
Package token is for api token management
Package token is for api token management
utils
Package web is a web dashboard
Package web is a web dashboard

Jump to

Keyboard shortcuts

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