Documentation
¶
Index ¶
- Variables
- func InitializeExchangeRatesDataSource(config *settings.Config) error
- type BankOfCanadaDataSource
- type BankOfCanadaExchangeRateData
- type BankOfCanadaObservationData
- type BankOfIsraelDataSource
- type BankOfIsraelExchangeRate
- type BankOfIsraelExchangeRateData
- type BankOfRussiaDataSource
- type BankOfRussiaExchangeRate
- type BankOfRussiaExchangeRateData
- type CentralBankOfHungaryCurrentExchangeRatesResult
- type CentralBankOfHungaryDataSource
- type CentralBankOfHungaryExchangeRate
- type CentralBankOfHungaryExchangeRateServiceResponse
- type CentralBankOfHungaryExchangeRates
- type CentralBankOfMyanmarDataSource
- type CentralBankOfMyanmarExchangeRate
- type CentralBankOfUzbekistanDataSource
- type CentralBankOfUzbekistanExchangeRate
- type CentralBankOfUzbekistanExchangeRates
- type CommonHttpExchangeRatesDataProvider
- type CzechNationalBankDataSource
- type DanmarksNationalbankDailyExchangeRates
- type DanmarksNationalbankDataSource
- type DanmarksNationalbankExchangeRate
- type DanmarksNationalbankExchangeRateData
- type EuroCentralBankDataSource
- type EuroCentralBankExchangeRate
- type EuroCentralBankExchangeRateData
- type EuroCentralBankExchangeRates
- type ExchangeRatesDataProvider
- type ExchangeRatesDataProviderContainer
- type HttpExchangeRatesDataSource
- type NaionalBankOfUkraineExchangeRate
- type NationalBankOfGeorgiaDataSource
- type NationalBankOfGeorgiaExchangeRate
- type NationalBankOfGeorgiaExchangeRates
- type NationalBankOfPolandDataSource
- type NationalBankOfPolandExchangeRate
- type NationalBankOfPolandExchangeRateData
- type NationalBankOfRomaniaDataSource
- type NationalBankOfRomaniaExchangeRate
- type NationalBankOfRomaniaExchangeRateData
- type NationalBankOfRomaniaExchangeRateDataBody
- type NationalBankOfRomaniaExchangeRateDataHeader
- type NationalBankOfRomaniaExchangeRates
- type NationalBankOfUkraineDataSource
- type NationalBankOfUkraineExchangeRates
- type NorgesBankDataSource
- type NorgesBankExchangeRate
- type NorgesBankExchangeRateData
- type NorgesBankExchangeRateDataSet
- type NorgesBankExchangeRateObservation
- type SwissNationalBankChannelItem
- type SwissNationalBankData
- type SwissNationalBankDataSource
- type SwissNationalBankExchangeRate
- type SwissNationalBankExchangeRateObservation
- type SwissNationalBankExchangeRateObservationPeriod
- type SwissNationalBankItemStatistics
- type SwissNationalBankRssChannel
- type UserCustomExchangeRatesDataProvider
Constants ¶
This section is empty.
Variables ¶
var (
Container = &ExchangeRatesDataProviderContainer{}
)
Initialize a exchange rates data provider container singleton instance
Functions ¶
func InitializeExchangeRatesDataSource ¶
InitializeExchangeRatesDataSource initializes the current exchange rates data source according to the config
Types ¶
type BankOfCanadaDataSource ¶
type BankOfCanadaDataSource struct {
HttpExchangeRatesDataSource
}
BankOfCanadaDataSource defines the structure of exchange rates data source of bank of Canada
func (*BankOfCanadaDataSource) BuildRequests ¶ added in v0.7.0
func (e *BankOfCanadaDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the bank of Canada exchange rates http requests
func (*BankOfCanadaDataSource) Parse ¶
func (e *BankOfCanadaDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the bank of Canada data source raw response
type BankOfCanadaExchangeRateData ¶
type BankOfCanadaExchangeRateData struct {
Observations []BankOfCanadaObservationData `json:"observations"`
}
BankOfCanadaExchangeRateData represents the whole data from bank of Canada
func (*BankOfCanadaExchangeRateData) ToLatestExchangeRateResponse ¶
func (e *BankOfCanadaExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from bank of Canada
type BankOfCanadaObservationData ¶
BankOfCanadaObservationData represents the observation data from bank of Canada
type BankOfIsraelDataSource ¶ added in v0.7.0
type BankOfIsraelDataSource struct {
HttpExchangeRatesDataSource
}
BankOfIsraelDataSource defines the structure of exchange rates data source of bank of Israel
func (*BankOfIsraelDataSource) BuildRequests ¶ added in v0.7.0
func (e *BankOfIsraelDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the bank of Israel exchange rates http requests
func (*BankOfIsraelDataSource) Parse ¶ added in v0.7.0
func (e *BankOfIsraelDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the bank of Israel data source raw response
type BankOfIsraelExchangeRate ¶ added in v0.7.0
type BankOfIsraelExchangeRate struct {
Currency string `xml:"Key"`
Rate string `xml:"CurrentExchangeRate"`
LastUpdate string `xml:"LastUpdate"`
Unit string `xml:"Unit"`
}
BankOfIsraelExchangeRate represents the exchange rate data from bank of Israel
func (*BankOfIsraelExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *BankOfIsraelExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from bank of Israel
type BankOfIsraelExchangeRateData ¶ added in v0.7.0
type BankOfIsraelExchangeRateData struct {
XMLName xml.Name `xml:"ExchangeRatesResponseCollectioDTO"`
AllExchangeRates []*BankOfIsraelExchangeRate `xml:"ExchangeRates>ExchangeRateResponseDTO"`
}
BankOfIsraelExchangeRateData represents the whole data from bank of Israel
func (*BankOfIsraelExchangeRateData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *BankOfIsraelExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from bank of Israel
type BankOfRussiaDataSource ¶ added in v0.7.0
type BankOfRussiaDataSource struct {
HttpExchangeRatesDataSource
}
BankOfRussiaDataSource defines the structure of exchange rates data source of bank of Russia
func (*BankOfRussiaDataSource) BuildRequests ¶ added in v0.7.0
func (e *BankOfRussiaDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the bank of Russia exchange rates http requests
func (*BankOfRussiaDataSource) Parse ¶ added in v0.7.0
func (e *BankOfRussiaDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the bank of Russia data source raw response
type BankOfRussiaExchangeRate ¶ added in v0.7.0
type BankOfRussiaExchangeRate struct {
Currency string `xml:"CharCode"`
Rate string `xml:"VunitRate"`
}
BankOfRussiaExchangeRate represents the exchange rate data from bank of Russia
func (*BankOfRussiaExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *BankOfRussiaExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from bank of Russia
type BankOfRussiaExchangeRateData ¶ added in v0.7.0
type BankOfRussiaExchangeRateData struct {
XMLName xml.Name `xml:"ValCurs"`
Date string `xml:"Date,attr"`
ExchangeRates []*BankOfRussiaExchangeRate `xml:"Valute"`
}
BankOfRussiaExchangeRateData represents the whole data from bank of Russia
func (*BankOfRussiaExchangeRateData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *BankOfRussiaExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from bank of Russia
type CentralBankOfHungaryCurrentExchangeRatesResult ¶ added in v0.7.0
type CentralBankOfHungaryCurrentExchangeRatesResult struct {
XMLName xml.Name `xml:"MNBCurrentExchangeRates"`
AllExchangeRates []*CentralBankOfHungaryExchangeRates `xml:"Day"`
}
CentralBankOfHungaryCurrentExchangeRatesResult represents the current exchange rate result data from central bank of Hungary
func (*CentralBankOfHungaryCurrentExchangeRatesResult) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *CentralBankOfHungaryCurrentExchangeRatesResult) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from central bank of Hungary
type CentralBankOfHungaryDataSource ¶ added in v0.7.0
type CentralBankOfHungaryDataSource struct {
HttpExchangeRatesDataSource
}
CentralBankOfHungaryDataSource defines the structure of exchange rates data source of central bank of Hungary
func (*CentralBankOfHungaryDataSource) BuildRequests ¶ added in v0.7.0
func (e *CentralBankOfHungaryDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the central bank of Hungary exchange rates http requests
func (*CentralBankOfHungaryDataSource) Parse ¶ added in v0.7.0
func (e *CentralBankOfHungaryDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the central bank of Hungary data source raw response
type CentralBankOfHungaryExchangeRate ¶ added in v0.7.0
type CentralBankOfHungaryExchangeRate struct {
Currency string `xml:"curr,attr"`
Unit string `xml:"unit,attr"`
Rate string `xml:",chardata"`
}
CentralBankOfHungaryExchangeRate represents the exchange rate data from central bank of Hungary
func (*CentralBankOfHungaryExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *CentralBankOfHungaryExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from central bank of Hungary
type CentralBankOfHungaryExchangeRateServiceResponse ¶ added in v0.7.0
type CentralBankOfHungaryExchangeRateServiceResponse struct {
XMLName xml.Name `xml:"Envelope"`
GetCurrentExchangeRatesResult string `xml:"Body>GetCurrentExchangeRatesResponse>GetCurrentExchangeRatesResult"`
}
CentralBankOfHungaryExchangeRateServiceResponse represents the response data of exchange rate service for central bank of Hungary
type CentralBankOfHungaryExchangeRates ¶ added in v0.7.0
type CentralBankOfHungaryExchangeRates struct {
Date string `xml:"date,attr"`
ExchangeRates []*CentralBankOfHungaryExchangeRate `xml:"Rate"`
}
CentralBankOfHungaryExchangeRates represents the exchange rates data from Danmarks Nationalbank
type CentralBankOfMyanmarDataSource ¶ added in v0.7.0
type CentralBankOfMyanmarDataSource struct {
HttpExchangeRatesDataSource
}
CentralBankOfMyanmarDataSource defines the structure of exchange rates data source of central bank of Myanmar
func (*CentralBankOfMyanmarDataSource) BuildRequests ¶ added in v0.7.0
func (e *CentralBankOfMyanmarDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the central bank of Myanmar exchange rates http requests
func (*CentralBankOfMyanmarDataSource) Parse ¶ added in v0.7.0
func (e *CentralBankOfMyanmarDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the central bank of Myanmar data source raw response
type CentralBankOfMyanmarExchangeRate ¶ added in v0.7.0
type CentralBankOfMyanmarExchangeRate struct {
Timestamp string `json:"timestamp"`
ExchangeRates map[string]string `json:"rates"`
}
CentralBankOfMyanmarExchangeRate represents the exchange rate data from central bank of Myanmar
func (*CentralBankOfMyanmarExchangeRate) BuildLatestExchangeRate ¶ added in v0.7.0
func (e *CentralBankOfMyanmarExchangeRate) BuildLatestExchangeRate(c core.Context, currencyCode string, exchangeRate string) *models.LatestExchangeRate
BuildLatestExchangeRate returns a data pair according to original data from central bank of Myanmar
func (*CentralBankOfMyanmarExchangeRate) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *CentralBankOfMyanmarExchangeRate) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from central bank of Myanmar
type CentralBankOfUzbekistanDataSource ¶ added in v0.7.0
type CentralBankOfUzbekistanDataSource struct {
HttpExchangeRatesDataSource
}
CentralBankOfUzbekistanDataSource defines the structure of exchange rates data source of the central bank of the Republic of Uzbekistan
func (*CentralBankOfUzbekistanDataSource) BuildRequests ¶ added in v0.7.0
func (e *CentralBankOfUzbekistanDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the the central bank of the Republic of Uzbekistan exchange rates http requests
func (*CentralBankOfUzbekistanDataSource) Parse ¶ added in v0.7.0
func (e *CentralBankOfUzbekistanDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the the central bank of the Republic of Uzbekistan data source raw response
type CentralBankOfUzbekistanExchangeRate ¶ added in v0.7.0
type CentralBankOfUzbekistanExchangeRate struct {
Currency string `json:"Ccy"`
Unit string `json:"Nominal"`
Rate string `json:"Rate"`
Date string `json:"Date"`
}
CentralBankOfUzbekistanExchangeRate represents the exchange rate data from the central bank of the Republic of Uzbekistan
func (*CentralBankOfUzbekistanExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *CentralBankOfUzbekistanExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from the central bank of the Republic of Uzbekistan
type CentralBankOfUzbekistanExchangeRates ¶ added in v0.7.0
type CentralBankOfUzbekistanExchangeRates []*CentralBankOfUzbekistanExchangeRate
CentralBankOfUzbekistanExchangeRates represents the exchange rates data from the central bank of the Republic of Uzbekistan
func (CentralBankOfUzbekistanExchangeRates) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e CentralBankOfUzbekistanExchangeRates) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from the central bank of the Republic of Uzbekistan
type CommonHttpExchangeRatesDataProvider ¶ added in v1.1.0
type CommonHttpExchangeRatesDataProvider struct {
ExchangeRatesDataProvider
// contains filtered or unexported fields
}
CommonHttpExchangeRatesDataProvider defines the structure of common http exchange rates data provider
func (*CommonHttpExchangeRatesDataProvider) GetLatestExchangeRates ¶ added in v1.1.0
func (e *CommonHttpExchangeRatesDataProvider) GetLatestExchangeRates(c core.Context, uid int64, currentConfig *settings.Config) (*models.LatestExchangeRateResponse, error)
type CzechNationalBankDataSource ¶
type CzechNationalBankDataSource struct {
HttpExchangeRatesDataSource
}
CzechNationalBankDataSource defines the structure of exchange rates data source of Czech National Bank
func (*CzechNationalBankDataSource) BuildRequests ¶ added in v0.7.0
func (e *CzechNationalBankDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the Czech National Bank exchange rates http requests
func (*CzechNationalBankDataSource) Parse ¶
func (e *CzechNationalBankDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the czech nation bank data source raw response
type DanmarksNationalbankDailyExchangeRates ¶ added in v0.7.0
type DanmarksNationalbankDailyExchangeRates struct {
Date string `xml:"id,attr"`
ExchangeRates []*DanmarksNationalbankExchangeRate `xml:"currency"`
}
DanmarksNationalbankDailyExchangeRates represents the exchange rates data from Danmarks Nationalbank
type DanmarksNationalbankDataSource ¶ added in v0.7.0
type DanmarksNationalbankDataSource struct {
HttpExchangeRatesDataSource
}
DanmarksNationalbankDataSource defines the structure of exchange rates data source of Danmarks Nationalbank
func (*DanmarksNationalbankDataSource) BuildRequests ¶ added in v0.7.0
func (e *DanmarksNationalbankDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the Danmarks Nationalbank exchange rates http requests
func (*DanmarksNationalbankDataSource) Parse ¶ added in v0.7.0
func (e *DanmarksNationalbankDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the Danmarks Nationalbank data source raw response
type DanmarksNationalbankExchangeRate ¶ added in v0.7.0
type DanmarksNationalbankExchangeRate struct {
Currency string `xml:"code,attr"`
Rate string `xml:"rate,attr"`
}
DanmarksNationalbankExchangeRate represents the exchange rate data from Danmarks Nationalbank
func (*DanmarksNationalbankExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *DanmarksNationalbankExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from Danmarks Nationalbank
type DanmarksNationalbankExchangeRateData ¶ added in v0.7.0
type DanmarksNationalbankExchangeRateData struct {
XMLName xml.Name `xml:"exchangerates"`
DailyExchangeRates []*DanmarksNationalbankDailyExchangeRates `xml:"dailyrates"`
BaseCurrency string `xml:"refcur,attr"`
}
DanmarksNationalbankExchangeRateData represents the whole data from Danmarks Nationalbank
func (*DanmarksNationalbankExchangeRateData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *DanmarksNationalbankExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from Danmarks Nationalbank
type EuroCentralBankDataSource ¶
type EuroCentralBankDataSource struct {
HttpExchangeRatesDataSource
}
EuroCentralBankDataSource defines the structure of exchange rates data source of euro central bank
func (*EuroCentralBankDataSource) BuildRequests ¶ added in v0.7.0
func (e *EuroCentralBankDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the euro central bank exchange rates http requests
func (*EuroCentralBankDataSource) Parse ¶
func (e *EuroCentralBankDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the euro central bank data source raw response
type EuroCentralBankExchangeRate ¶
type EuroCentralBankExchangeRate struct {
Currency string `xml:"currency,attr"`
Rate string `xml:"rate,attr"`
}
EuroCentralBankExchangeRate represents the exchange rate data from euro central bank
func (*EuroCentralBankExchangeRate) ToLatestExchangeRate ¶
func (e *EuroCentralBankExchangeRate) ToLatestExchangeRate() *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from euro central bank
type EuroCentralBankExchangeRateData ¶
type EuroCentralBankExchangeRateData struct {
XMLName xml.Name `xml:"Envelope"`
AllExchangeRates []*EuroCentralBankExchangeRates `xml:"Cube>Cube"`
}
EuroCentralBankExchangeRateData represents the whole data from euro central bank
func (*EuroCentralBankExchangeRateData) ToLatestExchangeRateResponse ¶
func (e *EuroCentralBankExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from euro central bank
type EuroCentralBankExchangeRates ¶
type EuroCentralBankExchangeRates struct {
Date string `xml:"time,attr"`
ExchangeRates []*EuroCentralBankExchangeRate `xml:"Cube"`
}
EuroCentralBankExchangeRates represents the exchange rates data from euro central bank
type ExchangeRatesDataProvider ¶ added in v1.1.0
type ExchangeRatesDataProvider interface {
// GetLatestExchangeRates returns the common response entities
GetLatestExchangeRates(c core.Context, uid int64, currentConfig *settings.Config) (*models.LatestExchangeRateResponse, error)
}
ExchangeRatesDataProvider defines the structure of exchange rates data provider
type ExchangeRatesDataProviderContainer ¶ added in v1.1.0
type ExchangeRatesDataProviderContainer struct {
// contains filtered or unexported fields
}
ExchangeRatesDataProviderContainer contains the current exchange rates data provider
func (*ExchangeRatesDataProviderContainer) GetLatestExchangeRates ¶ added in v1.1.0
func (e *ExchangeRatesDataProviderContainer) GetLatestExchangeRates(c core.Context, uid int64, currentConfig *settings.Config) (*models.LatestExchangeRateResponse, error)
GetLatestExchangeRates returns the latest exchange rates data from the current exchange rates data source
type HttpExchangeRatesDataSource ¶ added in v0.9.0
type HttpExchangeRatesDataSource interface {
// BuildRequests returns the http requests
BuildRequests() ([]*http.Request, error)
// Parse returns the common response entity according to the data source raw response
Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
}
HttpExchangeRatesDataSource defines the structure of http exchange rates data source
type NaionalBankOfUkraineExchangeRate ¶ added in v0.9.0
type NaionalBankOfUkraineExchangeRate struct {
Currency string `json:"CurrencyCodeL"`
Quantity float64 `json:"Units"`
Rate float64 `json:"Amount"`
Date string `json:"StartDate"`
}
NaionalBankOfUkraineExchangeRate represents the exchange rate data from National Bank of Ukraine
func (*NaionalBankOfUkraineExchangeRate) ToLatestExchangeRate ¶ added in v0.9.0
func (e *NaionalBankOfUkraineExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from National Bank of Ukraine
type NationalBankOfGeorgiaDataSource ¶ added in v0.7.0
type NationalBankOfGeorgiaDataSource struct {
HttpExchangeRatesDataSource
}
NationalBankOfGeorgiaDataSource defines the structure of exchange rates data source of national bank of Georgia
func (*NationalBankOfGeorgiaDataSource) BuildRequests ¶ added in v0.7.0
func (e *NationalBankOfGeorgiaDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the national bank of Georgia exchange rates http requests
func (*NationalBankOfGeorgiaDataSource) Parse ¶ added in v0.7.0
func (e *NationalBankOfGeorgiaDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the national bank of Georgia data source raw response
type NationalBankOfGeorgiaExchangeRate ¶ added in v0.7.0
type NationalBankOfGeorgiaExchangeRate struct {
Currency string `json:"code"`
Quantity float64 `json:"quantity"`
Rate float64 `json:"rate"`
Date string `json:"date"`
}
NationalBankOfGeorgiaExchangeRate represents the exchange rate data from national bank of Georgia
func (*NationalBankOfGeorgiaExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *NationalBankOfGeorgiaExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from national bank of Georgia
type NationalBankOfGeorgiaExchangeRates ¶ added in v0.7.0
type NationalBankOfGeorgiaExchangeRates struct {
Date string `json:"date"`
ExchangeRates []*NationalBankOfGeorgiaExchangeRate `json:"currencies"`
}
NationalBankOfGeorgiaExchangeRates represents the exchange rates data from national bank of Georgia
func (*NationalBankOfGeorgiaExchangeRates) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *NationalBankOfGeorgiaExchangeRates) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from national bank of Georgia
type NationalBankOfPolandDataSource ¶
type NationalBankOfPolandDataSource struct {
HttpExchangeRatesDataSource
}
NationalBankOfPolandDataSource defines the structure of exchange rates data source of National Bank of Poland
func (*NationalBankOfPolandDataSource) BuildRequests ¶ added in v0.7.0
func (e *NationalBankOfPolandDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the national bank of Poland exchange rates http requests
func (*NationalBankOfPolandDataSource) GetRequestUrls ¶
func (e *NationalBankOfPolandDataSource) GetRequestUrls() []string
GetRequestUrls returns the National Bank of Poland data source urls
func (*NationalBankOfPolandDataSource) Parse ¶
func (e *NationalBankOfPolandDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the National Bank of Poland data source raw response
type NationalBankOfPolandExchangeRate ¶
type NationalBankOfPolandExchangeRate struct {
Currency string `xml:"Code"`
Rate string `xml:"Mid"`
}
NationalBankOfPolandExchangeRate represents the exchange rate data from National Bank of Poland
func (*NationalBankOfPolandExchangeRate) ToLatestExchangeRate ¶
func (e *NationalBankOfPolandExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from National Bank of Poland
type NationalBankOfPolandExchangeRateData ¶
type NationalBankOfPolandExchangeRateData struct {
XMLName xml.Name `xml:"ArrayOfExchangeRatesTable"`
Date string `xml:"ExchangeRatesTable>EffectiveDate"`
AllExchangeRates []*NationalBankOfPolandExchangeRate `xml:"ExchangeRatesTable>Rates>Rate"`
}
NationalBankOfPolandExchangeRateData represents the whole data from National Bank of Poland
func (*NationalBankOfPolandExchangeRateData) ToLatestExchangeRateResponse ¶
func (e *NationalBankOfPolandExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from National Bank of Poland
type NationalBankOfRomaniaDataSource ¶ added in v0.7.0
type NationalBankOfRomaniaDataSource struct {
HttpExchangeRatesDataSource
}
NationalBankOfRomaniaDataSource defines the structure of exchange rates data source of national bank of Romania
func (*NationalBankOfRomaniaDataSource) BuildRequests ¶ added in v0.7.0
func (e *NationalBankOfRomaniaDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the national bank of Romania exchange rates http requests
func (*NationalBankOfRomaniaDataSource) Parse ¶ added in v0.7.0
func (e *NationalBankOfRomaniaDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the national bank of Romania data source raw response
type NationalBankOfRomaniaExchangeRate ¶ added in v0.7.0
type NationalBankOfRomaniaExchangeRate struct {
Currency string `xml:"currency,attr"`
Multiplier string `xml:"multiplier,attr"`
Rate string `xml:",chardata"`
}
NationalBankOfRomaniaExchangeRate represents the exchange rate data from national bank of Romania
func (*NationalBankOfRomaniaExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *NationalBankOfRomaniaExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from national bank of Romania
type NationalBankOfRomaniaExchangeRateData ¶ added in v0.7.0
type NationalBankOfRomaniaExchangeRateData struct {
XMLName xml.Name `xml:"DataSet"`
Header *NationalBankOfRomaniaExchangeRateDataHeader `xml:"Header"`
Body *NationalBankOfRomaniaExchangeRateDataBody `xml:"Body"`
}
NationalBankOfRomaniaExchangeRateData represents the whole data from national bank of Romania
func (*NationalBankOfRomaniaExchangeRateData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *NationalBankOfRomaniaExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from national bank of Romania
type NationalBankOfRomaniaExchangeRateDataBody ¶ added in v0.7.0
type NationalBankOfRomaniaExchangeRateDataBody struct {
OrigCurrency string `xml:"OrigCurrency"`
AllExchangeRates []*NationalBankOfRomaniaExchangeRates `xml:"Cube"`
}
NationalBankOfRomaniaExchangeRateDataBody represents the body for exchange rates data of national bank of Romania
type NationalBankOfRomaniaExchangeRateDataHeader ¶ added in v0.7.0
type NationalBankOfRomaniaExchangeRateDataHeader struct {
PublishingDate string `xml:"PublishingDate"`
}
NationalBankOfRomaniaExchangeRateDataHeader represents the header for exchange rates data of national bank of Romania
type NationalBankOfRomaniaExchangeRates ¶ added in v0.7.0
type NationalBankOfRomaniaExchangeRates struct {
Date string `xml:"date,attr"`
ExchangeRates []*NationalBankOfRomaniaExchangeRate `xml:"Rate"`
}
NationalBankOfRomaniaExchangeRates represents the exchange rates data from national bank of Romania
type NationalBankOfUkraineDataSource ¶ added in v0.9.0
type NationalBankOfUkraineDataSource struct {
HttpExchangeRatesDataSource
}
NationalBankOfUkraineDataSource defines the structure of exchange rates data source of National Bank of Ukraine
func (*NationalBankOfUkraineDataSource) BuildRequests ¶ added in v0.9.0
func (e *NationalBankOfUkraineDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the National Bank of Ukraine exchange rates http requests
func (*NationalBankOfUkraineDataSource) Parse ¶ added in v0.9.0
func (e *NationalBankOfUkraineDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the National Bank of Ukraine data source raw response
type NationalBankOfUkraineExchangeRates ¶ added in v0.9.0
type NationalBankOfUkraineExchangeRates []NaionalBankOfUkraineExchangeRate
NationalBankOfUkraineExchangeRates represents the exchange rates data from National Bank of Ukraine
func (*NationalBankOfUkraineExchangeRates) ToLatestExchangeRateResponse ¶ added in v0.9.0
func (e *NationalBankOfUkraineExchangeRates) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from National Bank of Ukraine
type NorgesBankDataSource ¶ added in v0.7.0
type NorgesBankDataSource struct {
HttpExchangeRatesDataSource
}
NorgesBankDataSource defines the structure of exchange rates data source of Norges Bank
func (*NorgesBankDataSource) BuildRequests ¶ added in v0.7.0
func (e *NorgesBankDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the Norges Bank exchange rates http requests
func (*NorgesBankDataSource) Parse ¶ added in v0.7.0
func (e *NorgesBankDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the Norges Bank data source raw response
type NorgesBankExchangeRate ¶ added in v0.7.0
type NorgesBankExchangeRate struct {
BaseCurrency string `xml:"BASE_CUR,attr"`
TargetCurrency string `xml:"QUOTE_CUR,attr"`
UnitExponent string `xml:"UNIT_MULT,attr"`
Observations []*NorgesBankExchangeRateObservation `xml:"Obs"`
}
NorgesBankExchangeRate represents the exchange rate data from Norges Bank
func (*NorgesBankExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *NorgesBankExchangeRate) ToLatestExchangeRate(c core.Context, exchangeRate string) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from Norges Bank
type NorgesBankExchangeRateData ¶ added in v0.7.0
type NorgesBankExchangeRateData struct {
XMLName xml.Name `xml:"StructureSpecificData"`
DataSet *NorgesBankExchangeRateDataSet `xml:"DataSet"`
}
NorgesBankExchangeRateData represents the whole data from Norges Bank
func (*NorgesBankExchangeRateData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *NorgesBankExchangeRateData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from Norges Bank
type NorgesBankExchangeRateDataSet ¶ added in v0.7.0
type NorgesBankExchangeRateDataSet struct {
ExchangeRates []*NorgesBankExchangeRate `xml:"Series"`
}
NorgesBankExchangeRateDataSet represents the dataset for exchange rates data of Norges Bank
type NorgesBankExchangeRateObservation ¶ added in v0.7.0
type NorgesBankExchangeRateObservation struct {
Date string `xml:"TIME_PERIOD,attr"`
Rate string `xml:"OBS_VALUE,attr"`
}
NorgesBankExchangeRateObservation represents the observation data of exchange rate data from Norges Bank
type SwissNationalBankChannelItem ¶ added in v0.7.0
type SwissNationalBankChannelItem struct {
Statistics *SwissNationalBankItemStatistics `xml:"statistics"`
}
SwissNationalBankChannelItem represents the channel item from the reserve Swiss National Bank
type SwissNationalBankData ¶ added in v0.7.0
type SwissNationalBankData struct {
XMLName xml.Name `xml:"rss"`
Channel *SwissNationalBankRssChannel `xml:"channel"`
}
SwissNationalBankData represents the whole data from the reserve Swiss National Bank
func (*SwissNationalBankData) ToLatestExchangeRateResponse ¶ added in v0.7.0
func (e *SwissNationalBankData) ToLatestExchangeRateResponse(c core.Context) *models.LatestExchangeRateResponse
ToLatestExchangeRateResponse returns a view-object according to original data from the reserve Swiss National Bank
type SwissNationalBankDataSource ¶ added in v0.7.0
type SwissNationalBankDataSource struct {
HttpExchangeRatesDataSource
}
SwissNationalBankDataSource defines the structure of exchange rates data source of the reserve Swiss National Bank
func (*SwissNationalBankDataSource) BuildRequests ¶ added in v0.7.0
func (e *SwissNationalBankDataSource) BuildRequests() ([]*http.Request, error)
BuildRequests returns the Swiss National Bank exchange rates http requests
func (*SwissNationalBankDataSource) Parse ¶ added in v0.7.0
func (e *SwissNationalBankDataSource) Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)
Parse returns the common response entity according to the the reserve Swiss National Bank data source raw response
type SwissNationalBankExchangeRate ¶ added in v0.7.0
type SwissNationalBankExchangeRate struct {
BaseCurrency string `xml:"baseCurrency"`
TargetCurrency string `xml:"targetCurrency"`
Observation *SwissNationalBankExchangeRateObservation `xml:"observation"`
ObservationPeriod *SwissNationalBankExchangeRateObservationPeriod `xml:"observationPeriod"`
}
SwissNationalBankExchangeRate represents the exchange rate from the reserve Swiss National Bank
func (*SwissNationalBankExchangeRate) ToLatestExchangeRate ¶ added in v0.7.0
func (e *SwissNationalBankExchangeRate) ToLatestExchangeRate(c core.Context) *models.LatestExchangeRate
ToLatestExchangeRate returns a data pair according to original data from the reserve Swiss National Bank
type SwissNationalBankExchangeRateObservation ¶ added in v0.7.0
type SwissNationalBankExchangeRateObservation struct {
Value string `xml:"value"`
Unit string `xml:"unit"`
UnitExponent string `xml:"unit_mult"`
}
SwissNationalBankExchangeRateObservation represents the exchange rate data from the reserve Swiss National Bank
type SwissNationalBankExchangeRateObservationPeriod ¶ added in v0.7.0
type SwissNationalBankExchangeRateObservationPeriod struct {
Period string `xml:"period"`
}
SwissNationalBankExchangeRateObservationPeriod represents the exchange rate period data from the reserve Swiss National Bank
type SwissNationalBankItemStatistics ¶ added in v0.7.0
type SwissNationalBankItemStatistics struct {
ExchangeRate *SwissNationalBankExchangeRate `xml:"exchangeRate"`
}
SwissNationalBankItemStatistics represents the item statistics from the reserve Swiss National Bank
type SwissNationalBankRssChannel ¶ added in v0.7.0
type SwissNationalBankRssChannel struct {
PublishDate string `xml:"pubDate"`
Items []*SwissNationalBankChannelItem `xml:"item"`
}
SwissNationalBankRssChannel represents the rss channel from the reserve Swiss National Bank
type UserCustomExchangeRatesDataProvider ¶ added in v1.1.0
type UserCustomExchangeRatesDataProvider struct {
ExchangeRatesDataProvider
// contains filtered or unexported fields
}
UserCustomExchangeRatesDataProvider defines the structure of user custom exchange rates data provider
func (*UserCustomExchangeRatesDataProvider) GetLatestExchangeRates ¶ added in v1.1.0
func (e *UserCustomExchangeRatesDataProvider) GetLatestExchangeRates(c core.Context, uid int64, currentConfig *settings.Config) (*models.LatestExchangeRateResponse, error)
Source Files
¶
- bank_of_canada_datasource.go
- bank_of_israel_datasource.go
- bank_of_russia_datasource.go
- central_bank_of_hungary_datasource.go
- central_bank_of_myanmar_datasource.go
- central_bank_of_uzbekistan_datasource.go
- common_http_exchange_rates_data_provider.go
- czech_national_bank_datasource.go
- danmarks_national_bank_datasource.go
- euro_central_bank_datasource.go
- exchange_rates_data_provider.go
- exchange_rates_data_provider_container.go
- national_bank_of_georgia_datasource.go
- national_bank_of_poland_datasource.go
- national_bank_of_romania_datasource.go
- national_bank_of_ukraine_datasource.go
- norges_bank_datasource.go
- swiss_national_bank_datasource.go
- user_custom_data_provider.go