cbr

package
v0.0.0-...-a6ede91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const DF = "02/01/2006"
View Source
const URL = "https://www.cbr-xml-daily.ru/daily_utf8.xml"

Variables

This section is empty.

Functions

func FetchCurrencyRates

func FetchCurrencyRates(d time.Time) map[string]CurrencyRate

func GetCurrencyRates

func GetCurrencyRates() map[string]model.Rate

Types

type CurrencyRate

type CurrencyRate struct {
	ID      string
	NumCode int64
	ISOCode string
	Name    string
	Value   float64
}

type Valute

type Valute struct {
	ID       string  `xml:"ID,attr"`
	NumCode  int64   `xml:"NumCode"`
	CharCode string  `xml:"CharCode"`
	Nominal  float64 `xml:"Nominal"`
	Name     string  `xml:"Name"`
	Value    string  `xml:"Value"`
}

type XmlResult

type XmlResult struct {
	ValCurs xml.Name `xml:"ValCurs"`
	Date    string   `xml:"Date,attr"`
	Name    string   `xml:"Name,attr"`
	Valute  []Valute `xml:"Valute"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL