Giter VIP home page Giter VIP logo

micro_gateway's Introduction

Micro Gateway

🧱一个高性能微服务网关

Micro Gateway 管理后台Demo

demo1 demo2 demo3

✨功能

功能脑图

🔧技术栈

后端

  • Golang
  • Gin
  • Gorm
  • Redis
  • MySql
  • Swagger
  • Docker

前端

  • Vue.js
  • Vue-element-admin

🚀快速开始

  • Golang版本要求Golang1.12+
  • 下载类库依赖
export GO111MODULE=on && export GOPROXY=https://goproxy.cn
cd mirco_gateway
go mod tidy
  • 创建数据库并导入
mysql -h localhost -u root -p -e "CREATE DATABASE mirco_gateway DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql -h localhost -u root -p mirco_gateway < gateway.sql --default-character-set=utf8
  • 快速编译部署测试
make build_dev
sh run.sh
  • 使用Docker部署
    部署网关管理服务
docker run --name dashboard --net host -e TZ=Asia/Shanghai -d dockerfile-dashboard:latest

部署代理服务

docker run --name gateway_server --net host -e TZ=Asia/Shanghai -d dockerfile-server:latest

测试

  • example目录为模拟下游服务节点的代码。

代理方式

  • Http/Https代理:通过HttpRule.Rule字段以前缀匹配的形式实现不同下游服务的转发
  • TCP代理:通过TcpRule.Port字段实现不同tcp服务的转发
  • GRPC代理:通过GrpcRule.Port字段实现不同GRPC服务的转发

TODO

  • ✅ 增加pprof
  • 指标监控

💻API文档

生成接口文档:swag init
然后启动服务器:go run main.go,浏览地址: http://127.0.0.1:8880/swagger/index.html

micro_gateway's People

Contributors

hugokung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.