fixerio

package
v0.0.0-...-93509e5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Currencies = map[string]string{
	"EUR": "Euro",
	"AUD": "Australian Dollar",
	"BGN": "Bulgarian Lev",
	"BRL": "Brazilian Real",
	"CAD": "Canadian Dollar",
	"CHF": "Swiss Franc",
	"CNY": "Yuan Renminbi",
	"CZK": "Czech Koruna",
	"DKK": "Danish Krone",
	"GBP": "Pound Sterling",
	"HKD": "Hong Kong Dollar",
	"HRK": "Croatian Kuna",
	"HUF": "Forint",
	"IDR": "Rupiah",
	"IRL": "New Israeli Sheqel",
	"INR": "Indian Rupee",
	"JPY": "Yen",
	"KRW": "Won",
	"MXN": "Mexican Peso",
	"MYR": "Malaysian Ringgit",
	"NOK": "Norwegian Krone",
	"NZD": "New Zealand Dollar",
	"PHP": "Philippine Peso",
	"PLN": "Zloty",
	"RON": "New Romanian Leu",
	"RUB": "Russian Ruble",
	"SEK": "Swedish Krona",
	"SGD": "Singapore Dollar",
	"THB": "Baht",
	"TRY": "Turkish Lira",
	"USD": "US Dollar",
	"ZAR": "Rand",
}

By lack of a public documentation, I got these out from a request to Fixer. Thse are all (I hope) the valid ISO codes of currencies Fixer supports.

Functions

func GetIsoCodes

func GetIsoCodes() []string

Get's the ISO codes as a string

func GetIsoNames

func GetIsoNames() string

Get's the names of ISO codes, and sorts them alphabetically

func IsValidBase

func IsValidBase(base string) bool

See's if Fixer can handle this base.

Types

type Fixer

type Fixer struct {
	// Base is the currency base for calculations
	Base string `json:"base"`

	// Rates are the values, along with the ISO codes of each currency, and it's value, giving the base.
	Rates map[string]float64 `json:"rates"`
}

The response of the Fixer API

func GetFixerData

func GetFixerData(base string, rates []string) (Fixer, error)

Returns an JSON object from the Fixer API.

func (Fixer) String

func (f Fixer) String() string

Implement Stringer, so we can print it to messages in telegram

Jump to

Keyboard shortcuts

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