Skip to content

Commit

Permalink
Updated the external interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterclaerhout committed Sep 30, 2019
1 parent 2f88fe0 commit ac0d2db
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion exchange_rates.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var DefaultTimeout = 5 * time.Second
// ExchangeRates returs the list exchange rates
func ExchangeRates() (map[string]float64, error) {

var rates ExchangeRate
var rates exchangeRate

ratesMap := make(map[string]float64, 0)

Expand Down
24 changes: 24 additions & 0 deletions exchange_rates_model.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ydfinance

// exchangeRate defines the exchange rate
type exchangeRate struct {
Time string `xml:"time"`
Cubes []exchangeRateCube `xml:"Cube"`
}

// exchangeRateCube defines an exchange rate cube
type exchangeRateCube struct {
TimedCubes []exchangeRateTimedCube `xml:"Cube"`
}

// exchangeRateTimedCube defines an exchange rate timed cube
type exchangeRateTimedCube struct {
Time string `xml:"time,attr"`
Rates []exchangeRateCurrencyCube `xml:"Cube"`
}

// exchangeRateCurrencyCube defines an exchange rate currency cube
type exchangeRateCurrencyCube struct {
Currency string `xml:"currency,attr"`
Rate float64 `xml:"rate,attr"`
}
24 changes: 0 additions & 24 deletions model.go

This file was deleted.

0 comments on commit ac0d2db

Please sign in to comment.