Service for downloading and storing OHLC data
- Create
postgreSQLdatabase (defaultohlc) - Configure
.envfile - Build and run OHLC service
$ make build
$ make test
$ ./ohlc
- Each downloader has separate goroutine for downloading data. Data is downloaded simultaneously for different sources.
- Each downloader gets data one by one for needed assets. Download process inside one source is not simultaneous because our IP/Service can be banned/blocked by data providers.
- Each downloader has separate queue for running downloader.
- Scheduler pushes EACH downloader each 60 sec
- If downloader is processing previous task, Scheduler is available to push to queue only ONE task for waiting. And this waiting task will be running immediately when previous long task is finished (but guarantee requests rate limit).
- All downloaders implement interface
Downloaderand extend base structure and methodsdownloader - Architecture allows to add any new downloader with custom configuration, authorizations, etc. You need to write custom methods for your class that overwrites methods from base class.
- I don't know full information about how data from database will be used. So structure of tables can be another. I didn't create a lot of INDEXes, because I need to know information about SELECTs for that.
- Service supports several LOG levels: "panic","fatal","error","warning","info","debug","trace"
- For rate limiting requests I use Timer because Ticker doesn't provide stable sleep time between requests
- 100% test coverage




