Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xujintao/testgin
a gin based api gateway
https://github.com/xujintao/testgin
etcd gin grpc
Last synced: about 1 month ago
JSON representation
a gin based api gateway
- Host: GitHub
- URL: https://github.com/xujintao/testgin
- Owner: xujintao
- License: mit
- Created: 2018-06-25T04:08:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T15:50:09.000Z (about 6 years ago)
- Last Synced: 2024-10-02T05:22:48.575Z (about 1 month ago)
- Topics: etcd, gin, grpc
- Language: Go
- Homepage:
- Size: 2.4 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testgin
[![Build Status](https://www.travis-ci.org/xujintao/testgin.svg?branch=master)](https://www.travis-ci.org/xujintao/testgin)
testgin is a gin based api gateway.
![](https://github.com/xujintao/testgin/blob/master/gateway.jpg)## Quick start
### 1. Prepare a json config file
```json
{
"db":{
"name": "mysql",
"user": "root",
"password": "1234",
"ip": "127.0.0.1",
"port": 3306,
"table":"test"
},
"etcd":{
"ip": "127.0.0.1",
"port": 2379
},"serverA":{
"ip": "127.0.0.1",
"port": 1701
}
}
```### 2. Run it
For example, your config file is $GOPATH/src/github.com/xujintao/config/config.json**Run from source directly**
```sh
$ go get -u github.com/xujintao/testgin
$ cd $GOPATH/src/github.com/xujintao/testgin
$ go build
$ ./testgin $GOPATH/src/github.com/xujintao/config/config.json```
**or run from docker**
```sh
docker run --rm \
-it \
-p 8080:8080 \
-v $GOPATH/src/github.com/xujintao/config:/etc/testgin \
xujintao/testgin:1.0.49 \
/etc/testgin/config.json
```
more tags: https://hub.docker.com/r/xujintao/testgin/tags/### 3. visit
Open chrome, press F12, then visit http://172.0.0.1:8080