ecb

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rate

type Rate struct {
	ISO  string
	Rate float32
}

Rate contains rate from EUR

type Rates

type Rates struct {
	Date  time.Time
	Rates []Rate
}

Rates contains rates data obtained from ECB

func Fetch

func Fetch(transport interface {
	Get(addr string) (tame.Document, error)
}, url string) (*Rates, error)

Fetch reads data from remote server transport - transport to use. Optional, if nil given will utilize client.New() url - remote URL. Optional, if empty will use default URL

func (*Rates) Unmarshal

func (r *Rates) Unmarshal(src []byte) error

Unmarshal fills data to rates from given XML bytes

Jump to

Keyboard shortcuts

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