Documentation ¶
Overview ¶
Package rates contains methods to get currencies exchange rates from Russian Central Bank https://www.cbr.ru
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cfg ¶
type Cfg struct { Host string `json:"host"` Port uint `json:"port"` CacheSize int `json:"cache"` Timeout int64 `json:"timeout"` Debug bool `json:"debug"` // contains filtered or unexported fields }
Cfg is rates' configuration settings.
func (*Cfg) HandleTimeout ¶
HandleTimeout is service timeout.
type CodeItem ¶
type CodeItem struct { ID string `xml:"ID,attr"` Name string `xml:"Name"` EngName string `xml:"EngName"` Nominal uint `xml:"Nominal"` ParentCode string `xml:"ParentCode"` }
CodeItem is currency code XML item.
type CurrencyItem ¶
type CurrencyItem struct { ID string `xml:"ID,attr"` NumCode string `xml:"NumCode"` CharCode string `xml:"CharCode"` Nominal uint `xml:"Nominal"` Name string `xml:"Name"` Value string `xml:"Value"` }
CurrencyItem is currency rate info.
type ResponseCodes ¶
ResponseCodes is XML codes response.
type ResponseRates ¶
type ResponseRates struct { XMLName xml.Name `xml:"ValCurs"` Items []CurrencyItem `xml:"Valute"` }
ResponseRates is XML rates response.
Click to show internal directories.
Click to hide internal directories.