Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // Returns currency rate in float64 GetRate(string, time.Time) (float64, error) // Returns currency rate in Decimal // // Rationale: https://pkg.go.dev/github.com/shopspring/decimal - FAQ section GetRateDecimal(string, time.Time) (decimal.Decimal, error) // Returns currency rate string with dot as decimal separator GetRateString(string, time.Time) (string, error) // Returns currency struct GetCurrencyInfo(string, time.Time) (Currency, error) SetFetchFunction(fetchFunction) SetBaseUrl(string) error SetLogLevel(logrus.Level) }
Client is a currency rates service client... what else?
type Currency ¶
type Currency struct { ID string `xml:"ID,attr"` NumCode uint `xml:"NumCode"` CharCode string `xml:"CharCode"` Nom uint `xml:"Nominal"` Name string `xml:"Name"` Value string `xml:"Value"` }
Currency is a currency item
func (Currency) ValueDecimal ¶
Returns currency Value in Decimal, corrected by nominal
Rationale: https://pkg.go.dev/github.com/shopspring/decimal - FAQ section
func (Currency) ValueDecimalRaw ¶
Returns currency Value in Decimal, without nominal correction
Rationale: https://pkg.go.dev/github.com/shopspring/decimal - FAQ section
func (Currency) ValueFloat ¶
Returns currency Value in float64, corrected by nominal
func (Currency) ValueFloatRaw ¶
Returns currency Value in float64, without nominal correction
func (Currency) ValueString ¶
Returns properly formatted currency Value string
Click to show internal directories.
Click to hide internal directories.