ecb

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

This is the source of exchange rates from the Central European Bank. This is the implementation of methods to retrieve data by http in xml, csv format and conversion to gocy format

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSource

func NewSource(client *http.Client) *source

Types

type ExchangeRate

type ExchangeRate struct {
	// contains filtered or unexported fields
}

func (ExchangeRate) From

func (e ExchangeRate) From() label.Currency

func (ExchangeRate) Rate

func (e ExchangeRate) Rate() float64

func (ExchangeRate) Time

func (e ExchangeRate) Time() time.Time

func (ExchangeRate) To

func (e ExchangeRate) To() label.Currency

type XMLAttrTime

type XMLAttrTime time.Time

func (*XMLAttrTime) UnmarshalXMLAttr

func (x *XMLAttrTime) UnmarshalXMLAttr(attr xml.Attr) error

type XMLCurrencyAttr

type XMLCurrencyAttr string

func (*XMLCurrencyAttr) UnmarshalXMLAttr

func (i *XMLCurrencyAttr) UnmarshalXMLAttr(attr xml.Attr) error

type XMLNode

type XMLNode struct {
	Time  XMLAttrTime `xml:"time,attr"`
	Rates []struct {
		Currency XMLCurrencyAttr `xml:"currency,attr"`
		Rate     XMLRateAttr     `xml:"rate,attr"`
	} `xml:"Cube"`
}

type XMLRateAttr

type XMLRateAttr float64

func (*XMLRateAttr) Float64

func (i *XMLRateAttr) Float64() float64

func (*XMLRateAttr) UnmarshalXMLAttr

func (i *XMLRateAttr) UnmarshalXMLAttr(attr xml.Attr) error

Jump to

Keyboard shortcuts

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