data

package
v0.0.0-...-b7d3607 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 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 ExchangeRates

type ExchangeRates struct {
	// contains filtered or unexported fields
}

func NewRates

func NewRates(l hclog.Logger) (*ExchangeRates, error)

func (*ExchangeRates) GetRate

func (e *ExchangeRates) GetRate(base, dest string) (float64, error)

func (*ExchangeRates) MonitorRates

func (e *ExchangeRates) 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