func (ecb *ECB) Fetch90Days() ([]rates.Rate, []error) {
	return ecb.fetch(ecb90daysURL)
}
Fetch90Days gets exchange rates for 90 days
package providers
import (
	"encoding/xml"
	"net/http"
	"time"
	"github.com/openprovider/rates"
	"golang.org/x/text/currency"
)
type ECB struct {
	currencies []currency.Unit
}
const (
	ecbName       = "European Central Bank"
	ecbLastURL    = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
	ecb90daysURL  = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"
	ecbHistoryURL = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml"
)
var ECBCurrencies = []string{
	AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD,
	HRK, HUF, IDR, ILS, INR, JPY, KRW, MXN, MYR, NOK,
	NZD, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, USD, ZAR,
}
func NewECBProvider(options *rates.Options) *ECB {
	ecb := new(ECB)
	if len(options.Currencies) == 0 {
		options.Currencies = append(options.Currencies, ECBCurrencies...)
	}
	for _, unit := range options.Currencies {
		if c, err := currency.ParseISO(unit); err == nil {
			ecb.currencies = append(ecb.currencies, c)
		}
	}
	return ecb
}
type ecbEnvelope struct {
	Data []struct {
		Date  string `xml:"time,attr"`
		Rates []struct {
			Currency string `xml:"currency,attr"`
			Rate     string `xml:"rate,attr"`
		} `xml:"Cube"`
	} `xml:"Cube>Cube"`
}
func (ecb *ECB) Name() string {
	return ecbName
}
func (ecb *ECB) FetchLast() ([]rates.Rate, []error) {
	return ecb.fetch(ecbLastURL)
}