Thanks to visit codestin.com
Credit goes to github.com

Skip to content

milad-rasouli/price

Repository files navigation

Price

I used Gin as http framework because it's much easier. and used slog for structured log.

postgres

sudo docker compose up --wait -d

migrate

make db-migrate-up

clone

git clone https://github.com/milad-rasouli/price.git

env

cp env.example .env

run

make run

we use --cron to run the job trigger.

make cron

Swagger

http://localhost:8080/swagger/index.html

Docker

also available in github registry.

docker pull ghcr.io/milad-rasouli/price:latest

Get latest price

curl -X GET "http://localhost:8080/prices/latest?symbol=btc" \
  -H "Accept: application/json"

3. Get history (24h default, no interval provided)

curl -X GET "http://localhost:8080/prices/history?symbol=btc" \
  -H "Accept: application/json"

4. Get history with valid interval

curl -X GET "http://localhost:8080/prices/history?symbol=btc&interval=1m" \
  -H "Accept: application/json"

Get history with explicit time range

curl -X GET "http://localhost:8080/prices/history?symbol=btc&interval=1m&from=$FROM&to=$TO" \
  -H "Accept: application/json"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages