Documentation ¶
Overview ¶
Package forex defines common forex-related types used throughout gelder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AUDCAD = CurrencyPair{Base: currency.AUD, Quote: currency.CAD} AUDJPY = CurrencyPair{Base: currency.AUD, Quote: currency.JPY} AUDNZD = CurrencyPair{Base: currency.AUD, Quote: currency.NZD} AUDUSD = CurrencyPair{Base: currency.AUD, Quote: currency.USD} CHFJPY = CurrencyPair{Base: currency.CHF, Quote: currency.JPY} EURAUD = CurrencyPair{Base: currency.EUR, Quote: currency.AUD} EURCAD = CurrencyPair{Base: currency.EUR, Quote: currency.CAD} EURCHF = CurrencyPair{Base: currency.EUR, Quote: currency.CHF} EURGBP = CurrencyPair{Base: currency.EUR, Quote: currency.GBP} EURJPY = CurrencyPair{Base: currency.EUR, Quote: currency.JPY} EURUSD = CurrencyPair{Base: currency.EUR, Quote: currency.USD} GBPCHF = CurrencyPair{Base: currency.GBP, Quote: currency.CHF} GBPJPY = CurrencyPair{Base: currency.GBP, Quote: currency.JPY} GBPUSD = CurrencyPair{Base: currency.GBP, Quote: currency.USD} NZDUSD = CurrencyPair{Base: currency.NZD, Quote: currency.USD} USDCAD = CurrencyPair{Base: currency.USD, Quote: currency.CAD} USDCHF = CurrencyPair{Base: currency.USD, Quote: currency.CHF} USDJPY = CurrencyPair{Base: currency.USD, Quote: currency.JPY} )
nolint[golint]
Functions ¶
This section is empty.
Types ¶
type CurrencyPair ¶
Pair represents a currency pair consisting of a base currency and a quote currency.
func Parse ¶
func Parse(str string) (pair CurrencyPair, err error)
Parse parses a currency pair represented as two ISO currencies (e.g EURCHF).
func ParseDelimited ¶
func ParseDelimited(str string, del string) (pair CurrencyPair, err error)
ParseDelimited parses an currency pair represented as two ISO currencies (e.g EURCHF) separated by a delimiter.
func (CurrencyPair) String ¶
func (p CurrencyPair) String() string
String returns a string representation of the currency pair.
func (CurrencyPair) StringDelimited ¶
func (p CurrencyPair) StringDelimited(del string) string
StringDelimited returns a string representation of the currency pair with base and quote separated by a delimiter.
Click to show internal directories.
Click to hide internal directories.