Closed sunglim closed 11 months ago
Motivation:
The configurations are hard-coded. It makes us very difficult to update when the application is running.
The configs are hardcorded as below.
go order.StrategryBuyEveryDayIfBelowAverage("12:00", []order.StrategryBuyEveryDayIfBelowOrder{ { Code: krxcode.Code농심홀딩스, Quantity: 1, }, ...
Ideally, the configuration files should be passed as arguments. Also, the configurations should be reloaded if changed.
Technical decisions:
Receive file name as argument - if file name is provided, other configurations passed as arguments are ignored
Use https://github.com/spf13/viper which is widely used package for configuration
Use YAML format because it's easy to read, comments are allowed
[x] Read config file - for StrategryBuyEveryDayIfBelowAverage strategy
[x] Reload app when config is updated
[x] Read config file - for StrategryBuyEveryDayIfLowerThan strategy
Motivation:
The configurations are hard-coded. It makes us very difficult to update when the application is running.
The configs are hardcorded as below.
Ideally, the configuration files should be passed as arguments. Also, the configurations should be reloaded if changed.
Technical decisions:
Receive file name as argument - if file name is provided, other configurations passed as arguments are ignored
Use https://github.com/spf13/viper which is widely used package for configuration
Use YAML format because it's easy to read, comments are allowed
[x] Read config file - for StrategryBuyEveryDayIfBelowAverage strategy
[x] Reload app when config is updated
[x] Read config file - for StrategryBuyEveryDayIfLowerThan strategy