currencyexchange

package
v0.0.0-...-3e1c22f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUD = "AUD"
	BGN = "BGN"
	BRL = "BRL"
	CAD = "CAD"
	CHF = "CHF"
	CNY = "CNY"
	CZK = "CZK"
	DKK = "DKK"
	EUR = "EUR"
	GBP = "GBP"
	HKD = "HKD"
	HRK = "HRK"
	HUF = "HUF"
	IDR = "IDR"
	ILS = "ILS"
	INR = "INR"
	JPY = "JPY"
	KRW = "KRW"
	MXN = "MXN"
	MYR = "MYR"
	NOK = "NOK"
	NZD = "NZD"
	PHP = "PHP"
	PLN = "PLN"
	RON = "RON"
	RUB = "RUB"
	SEK = "SEK"
	SGD = "SGD"
	THB = "THB"
	USD = "USD"
	ZAR = "ZAR"
)

currency codes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rates

type Rates map[string]float32

Rates currency conversion rates map

type Request

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

Request holds the request parameters.

func New

func New() *Request

New initializes fixerio.

func (*Request) Base

func (f *Request) Base(currency string)

Base sets base currency.

func (*Request) GetRates

func (f *Request) GetRates() (Rates, error)

GetRates retrieve the exchange rates.

func (*Request) GetURL

func (f *Request) GetURL() string

GetURL formats the URL correctly for the API Request.

func (*Request) Historical

func (f *Request) Historical(date time.Time)

Historical specify a date in the past to retrieve historical records.

func (*Request) Secure

func (f *Request) Secure(secure bool)

Secure Make the connection secure or not by setting the secures argument to true or false.

func (*Request) Symbols

func (f *Request) Symbols(currencies ...string)

Symbols list of currencies that should be returned.

type Response

type Response struct {
	Base  string `json:"base"`
	Date  string `json:"date"`
	Rates Rates  `json:"rates"`
}

Response json response object.

Jump to

Keyboard shortcuts

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