data

package
v0.0.0-...-95379bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cube

type Cube struct {
	Currency string `xml:"currency,attr"`
	Rate     string `xml:"rate,attr"`
}

type Cubes

type Cubes struct {
	CubeData []Cube `xml:"Cube>Cube>Cube"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL