git clone https://github.com/fredeastside/turl.git ./turl
cd turl
make start
Try to send curl requests.
- Go
- PostgreSQL
- Apache Kafka
- Docker
- Router - github.com/gin-gonic/gin
- Logger - github.com/sirupsen/logrus
- Kafka client - github.com/Shopify/sarama
- Unique ID generator - github.com/speps/go-hashids
- Create short URL
curl -X POST "http://0.0.0.0:8080/api/v1/" -d "url=https://google.com" -H "Content-Type: application/x-www-form-urlencoded"
- Get redirected URL
curl -X GET "http://0.0.0.0:8080/api/v1/gJWG"
- Get daily, weekly, all days report
curl -X GET "http://0.0.0.0:8080/api/v1/gJWG/report"
Please, find it in .env
file
APP_PORT=8080
WORKER_PORT=8081
DB_NAME=mydb
DB_USER=myuser
DB_PASSWORD=mysecretpassword
DB_PORT=5432
DATABASE_URL=postgres://myuser:mysecretpassword@db/mydb?sslmode=disable
GIN_MODE=release
ZOOKEEPER_PORT=2181
KAFKA_HOST=kafka
KAFKA_PORT=9092
UID_SALT=6.2Wghz6TjiH8_m)iErw3BDlR+dbI2Z!jfkH
UID_MIN_LEN=4
make test
make up
make stop