Install Golang 1.11, Docker and Docker-Compose.
cd $GOPATH/src/github.com/dzeckelev
git clone https://github.com/dzeckelev/adviser.git
cd adviser
make build
Addr
- Local http server address.CacheSize
- cache size.LogLevel
- Log level, must bedebug
,info
,warn
,error
,panic
,dpanic
orfatal
RequestTimeout
- Request timeout in milliseconds.TargetAddr
- Address of the target service.
make run
or as a demon:
make demon
make stop
Request:
curl -X GET -H "Content-Type: application/json" "http://localhost:8081/v2/places.json?term=%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0&locale=ru&types%5B%5D=city&types%5B%5D=airport"
Response:
[{"slug":"MOW","subtitle":"Россия","title":"Москва"},{"slug":"DME","subtitle":"Россия","title":"Домодедово"},{"slug":"SVO","subtitle":"Россия","title":"Шереметьево"},{"slug":"VKO","subtitle":"Россия","title":"Внуково"},{"slug":"ZIA","subtitle":"Россия","title":"Жуковский"}]
Linux host 4.15.0-45-generic
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.23.2, build 1110ad01