Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRatesHandler ¶
type ExchangeRatesHandler struct {
// contains filtered or unexported fields
}
func GetExchangeRatesHandler ¶
func GetExchangeRatesHandler(log *zap.Logger) (*ExchangeRatesHandler, error)
func (ExchangeRatesHandler) GetRates ¶
func (e ExchangeRatesHandler) GetRates(base, dest string) (float64, error)
func (*ExchangeRatesHandler) MonitorRates ¶
func (e *ExchangeRatesHandler) MonitorRates(interval time.Duration) chan struct{}
MonitorRates checks the rates in the ECB API every interval and sends a message to the returned channel when there are changes
Note: the ECB API only returns data once a day, this function only simulates the changes in rates for demonstration purposes
Click to show internal directories.
Click to hide internal directories.