Documentation ¶
Index ¶
- type ExchangeRates
- func (e *ExchangeRates) GetHistoricalRates(date, baseCurrency string, symbols []string) (HistoricalRates, error)
- func (e *ExchangeRates) GetLatestRates(baseCurrency, symbols string) (Rates, error)
- func (e *ExchangeRates) GetRates(baseCurrency, symbols string) (map[string]float64, error)
- func (e *ExchangeRates) GetSupportedCurrencies() ([]string, error)
- func (e *ExchangeRates) GetTimeSeriesRates(startDate, endDate, baseCurrency string, symbols []string) (TimeSeriesRates, error)
- func (e *ExchangeRates) SendHTTPRequest(endPoint string, values url.Values, result interface{}) error
- func (e *ExchangeRates) Setup(config base.Settings) error
- type HistoricalRates
- type Rates
- type TimeSeriesRates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRates ¶
ExchangeRates stores the struct for the ExchangeRatesAPI API
func (*ExchangeRates) GetHistoricalRates ¶
func (e *ExchangeRates) GetHistoricalRates(date, baseCurrency string, symbols []string) (HistoricalRates, error)
GetHistoricalRates returns historical exchange rate data for all available or a specific set of currencies. date - YYYY-MM-DD [required] A date in the past baseCurrency - USD [optional] The base currency to use for forex rates, defaults to EUR symbols - AUD,USD [optional] The symbols to query the forex rates for, default is all supported currencies
func (*ExchangeRates) GetLatestRates ¶
func (e *ExchangeRates) GetLatestRates(baseCurrency, symbols string) (Rates, error)
GetLatestRates returns a map of forex rates based on the supplied params baseCurrency - USD [optional] The base currency to use for forex rates, defaults to EUR symbols - AUD,USD [optional] The symbols to query the forex rates for, default is all supported currencies
func (*ExchangeRates) GetRates ¶
func (e *ExchangeRates) GetRates(baseCurrency, symbols string) (map[string]float64, error)
GetRates is a wrapper function to return forex rates
func (*ExchangeRates) GetSupportedCurrencies ¶
func (e *ExchangeRates) GetSupportedCurrencies() ([]string, error)
GetSupportedCurrencies returns the supported currency list
func (*ExchangeRates) GetTimeSeriesRates ¶
func (e *ExchangeRates) GetTimeSeriesRates(startDate, endDate, baseCurrency string, symbols []string) (TimeSeriesRates, error)
GetTimeSeriesRates returns daily historical exchange rate data between two specified dates for all available or a specific set of currencies. startDate - YYYY-MM-DD [required] A date in the past endDate - YYYY-MM-DD [required] A date in the past but greater than the startDate baseCurrency - USD [optional] The base currency to use for forex rates, defaults to EUR symbols - AUD,USD [optional] The symbols to query the forex rates for, default is all supported currencies
func (*ExchangeRates) SendHTTPRequest ¶
func (e *ExchangeRates) SendHTTPRequest(endPoint string, values url.Values, result interface{}) error
SendHTTPRequest sends a HTTPS request to the desired endpoint and returns the result