Documentation ¶
Overview ¶
Package currency fetches foreign exchange quotes
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // USD is a Currency USD = Currency{"USD", "US Dollar"} // AUD is a Currency AUD = Currency{"AUD", "Australian Dollar"} // BGN is a Currency BGN = Currency{"BGN", "Bulgarian Lev"} // BRL is a Currency BRL = Currency{"BRL", "Brazilian Real"} // CAD is a Currency CAD = Currency{"CAD", "Canadian Dollar"} // CHF is a Currency CHF = Currency{"CHF", "Swiss Franc"} // CNY is a Currency CNY = Currency{"CNY", "Chinese Yuan"} // CZK is a Currency CZK = Currency{"CZK", "Czech Republic Koruna"} // DKK is a Currency DKK = Currency{"DKK", "Danish Krone"} // EUR is a Currency EUR = Currency{"EUR", "Euro"} // GBP is a Currency GBP = Currency{"GBP", "British Pound Sterling"} // HKD is a Currency HKD = Currency{"HKD", "Hong Kong Dollar"} // HRK is a Currency HRK = Currency{"HRK", "Croatian Kuna"} // HUF is a Currency HUF = Currency{"HUF", "Hungarian Forint"} // IDR is a Currency IDR = Currency{"IDR", "Indonesian Rupiah"} // ILS is a Currency ILS = Currency{"ILS", "Israeli New Sheqel"} // INR is a Currency INR = Currency{"INR", "Indian Rupee"} // ISK is a Currency ISK = Currency{"ISK", "Iceland Krona"} // JPY is a Currency JPY = Currency{"JPY", "Japanese Yen"} // KRW is a Currency KRW = Currency{"KRW", "South Korean Won"} // LTL is a Currency LTL = Currency{"LTL", "Lithuanian Litas"} // MXN is a Currency MXN = Currency{"MXN", "Mexican Peso"} // MYR is a Currency MYR = Currency{"MYR", "Malaysian Ringgit"} // NOK is a Currency NOK = Currency{"NOK", "Norwegian Krone"} // NZD is a Currency NZD = Currency{"NZD", "New Zealand Dollar"} // PHP is a Currency PHP = Currency{"PHP", "Philippine Peso"} // PLN is a Currency PLN = Currency{"PLN", "Polish Zloty"} // RON is a Currency RON = Currency{"RON", "Romanian Leu"} // RUB is a Currency RUB = Currency{"RUB", "Russian Ruble"} // SEK is a Currency SEK = Currency{"SEK", "Swedish Krona"} // SGD is a Currency SGD = Currency{"SGD", "Singapore Dollar"} // THB is a Currency THB = Currency{"THB", "Thai Baht"} // TRY is a Currency TRY = Currency{"TRY", "Turkish Lira"} // ZAR is a Currency ZAR = Currency{"ZAR", "South African Rand"} )
fx currencies
View Source
var ( BTC = Currency{"BTC", "Bitcoin"} DOGE = Currency{"DOGE", "Dogecoin"} ETH = Currency{"ETH", "Ethereum"} LTC = Currency{"LTC", "Litecoin"} XMR = Currency{"XMR", "Monero"} XRP = Currency{"XRP", "Ripple"} )
crypto currencies
View Source
var CryptoCompareProvider provider = "CryptoCompare"
CryptoCompareProvider is a currency provider
CryptoCurrencies are valid crypto currencies
View Source
var ECBProvider provider = "European Central Bank"
ECBProvider is a currency provider
View Source
var ErrInvalidCurrency = fmt.Errorf("invalid currency")
ErrInvalidCurrency indicates the currency was invalid
View Source
var ForexCurrencies = []Currency{ AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HRK, HUF, IDR, ILS, INR, ISK, JPY, KRW, LTL, MXN, MYR, NOK, NZD, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, USD, ZAR, }
ForexCurrencies are valid forex currencies
Functions ¶
This section is empty.
Types ¶
type CryptoCompare ¶
CryptoCompare holds settings for the CryptoCompare api CryptoCompare allows 8K historical requests/hr (133/minute).
func (*CryptoCompare) Fetch ¶
func (c *CryptoCompare) Fetch() (*Response, error)
Fetch retrieves a cryptocurrency quotes from CryptoCompare
type CryptoCompareResponse ¶
type CryptoCompareResponse struct { Response string `json:"Response"` Type int `json:"Type"` Aggregated bool `json:"Aggregated"` Data []struct { Time int `json:"time"` High float64 `json:"high"` Low float64 `json:"low"` Open float64 `json:"open"` Volumefrom float64 `json:"volumefrom"` Volumeto float64 `json:"volumeto"` Close float64 `json:"close"` } `json:"Data"` TimeTo int `json:"TimeTo"` TimeFrom int `json:"TimeFrom"` FirstValueInArray bool `json:"FirstValueInArray"` ConversionType struct { Type string `json:"type"` ConversionSymbol string `json:"conversionSymbol"` } `json:"ConversionType"` }
CryptoCompareResponse is the raw CryptoCompare response
type CryptoFetcher ¶
CryptoFetcher retrieves cryptocurrency quotes
Click to show internal directories.
Click to hide internal directories.