Documentation ¶
Index ¶
- type Currency
- type ExchangeRates
- type ExchangeRatesService
- func (s ExchangeRatesService) At(ctx context.Context, date YMD, currencies ...Currency) (*ExchangeRates, error)
- func (s ExchangeRatesService) Latest(ctx context.Context, currencies ...Currency) (*ExchangeRates, error)
- func (s ExchangeRatesService) Since(ctx context.Context, date YMD, currencies ...Currency) (*History, error)
- type History
- type Rates
- type RatesAt
- type YMD
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRates ¶
type ExchangeRatesService ¶
func (ExchangeRatesService) At ¶
func (s ExchangeRatesService) At(ctx context.Context, date YMD, currencies ...Currency) (*ExchangeRates, error)
At fetches the rates at the given date
If one or more currencies are passed, only those will be fetched. If none are passed, _all_ currencies will be fetched.
If the returned version is not the one requested, it fails. While Frankfurter returns the closest rate, Concourse explicitly states that the resource must fail if the requested version is not available.
func (ExchangeRatesService) Latest ¶
func (s ExchangeRatesService) Latest(ctx context.Context, currencies ...Currency) (*ExchangeRates, error)
Latest fetches the latest rates
type RatesAt ¶
func (*RatesAt) UnmarshalJSON ¶
UnmarshalJSON provides custom unmarshaling as we cannot naiively unmarshal a map with time.Time keys.
type YMD ¶
YMD specializes time.Time encoded as YYYY-MM-DD The time zone is hard-coded to Europe/Berlin, which is the same as Frankfurt. The time is hard-coded to 16:00 because this is what the ECB specifies:
"The reference rates are usually updated at around 16:00 CET every working day, except on TARGET closing days."