项目作者: atomicfruitcake

项目描述 :
Golang API Gateway
高级语言: Go
项目地址: git://github.com/atomicfruitcake/goatway.git
创建时间: 2020-02-15T13:20:36Z
项目社区:https://github.com/atomicfruitcake/goatway

开源协议:GNU General Public License v3.0

下载


Goatway

What is this

Goatway is an API Gateway service written in Golang using the Gorilla/MUX framework with a Redis DB. Goatway maintains a register of all jobs received to maintain a log of the states of jobs being processed by downstream services

How do I use this

You can run the application using

  1. go run /path/to/goatway/srv/main.go

Goatway uses GOLANG version 1.13

Note you must have a Redis server running. Ensure you have redis installed and start by using:

  1. redis-server

If the application start successfully, you will see the message "Goatway HTTP Webserver is on port 9090".

You can conform this by going to running

  1. curl http://localhost:9090/health

And you will receive the response OK

How do I build this

You can compile Goatway down into a binary by building with go build using the following commands:

  1. go build /path/to/goatway/main.go

This will compile the program into a binary called main in your local directory. You can then run that program with:

  1. ./main

Docker Support

Goatway can be built and run with docker. You can build the docker image from the root of Goatway using:

  1. docker build -t goatway .

You can then run the application with:

  1. docker run goatway

However, you will need to be running a redis-server locally.

To run everything in containers, you can use docker-compose. In the root of Goatway, you can run

  1. docker-compose up

Which will launch both Goatway and a redis-server, connect them together and run on port 9090