Coder Social home page Coder Social logo

gateway's Introduction

Gitter Build Status Go Report Card

Gateway

Gateway is a API gateway based on http. It works at 7 layer.

Features

  • Traffic Control
  • Circuit Breaker
  • Loadbalance
  • Routing based on URL
  • API aggregation(support url rewrite)
  • API Validation
  • API Access Control(blacklist and whitelist)
  • API Mock
  • Backend Server heath check
  • Use fasthttp
  • Admin WEBUI

Install

Gateway dependency etcd

Compile from source

git clone https://github.com/fagongzi.git
cd $GOPATH/src/github.com/fagongzi/gateway
go build cmd/proxy/proxy.go
go build cmd/admin/admin.go

Download binary file

linux-64bit

You can read this for more infomation about build and run gateway.

Docker

You can run docker pull fagongzi/gateway to get docker images, then use docker run -d fagongzi/gateway to run. It export 3 ports:

  • 80

    proxy http serve port

  • 8081

    proxy manager port

  • 8080

    admin http port

Online Demo

Architecture

Components

Gateway has three component: proxy, admin, etcd.

Proxy

The proxy provide http server. Proxy is stateless, you can scale proxy node to deal with large traffic.

Admin

The admin is a backend manager system. Admin also is a stateless node, you can use a Nginx node for HA. One Admin node can manager a set of proxy which has a same etcd prefix configuration.

Etcd

The Etcd store gateway's mete data.

Concept of gateway

  • Server

    Server is a backend server which provide restfule json service.The server is the basic unit at gateway. more.

  • Cluster

    Cluster is a set of servers which provide the same service. The Loadbalancer select a usable server to use. more.

  • API

    API is the core concept in gateway. You can define a API with a URL pattern, http method, and at least one dispatch node. more.

  • Routing

    Routing is a approach to control http traffic to clusters. You can use cookie, query string, request header infomation in a expression for control.

What gateway can help you

Redefine your API URL

Your backend server provide some restful API, You can redefine the API URL that provide to API caller.Use this funcation you can provide beautiful APIs.

Dynamic URL & Aggregation

You can define a URL and configuration a URL set which you want to aggregation.

Protect backend server

Gateway can use Traffic Control and Circuit Breaker functions to avoid backend crash by hight triffic.

AB Test

Gateway's Routing fucntion can help your AB Test.

gateway's People

Contributors

zhangxu19830126 avatar

Watchers

 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.