currency

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package currency provides lookups methods over ISO-4217 currencies.

Constants have been generated with code generation ./generator.

Author Mikalai Konan(mikalai.konan@icloud.com).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByCode

func ByCode(code Code) (c currency, ok bool)

ByCode lookup for currency type by code

func ByCodeErr

func ByCodeErr(code Code) (c currency, err error)

ByCodeErr lookup for currency type by code

func ByCodeStr

func ByCodeStr(code string) (c currency, ok bool)

ByCodeStr lookup for currency type by code

func ByCodeStrErr

func ByCodeStrErr(code string) (c currency, err error)

ByCodeStrErr lookup for currency type by code

func ByCountry

func ByCountry(country Country) (c currencies, ok bool)

ByCountry lookup for currency type by country

func ByCountryErr

func ByCountryErr(country Country) (c currencies, err error)

ByCountryErr lookup for currencies type by country

func ByCountryStr

func ByCountryStr(country string) (c currencies, ok bool)

ByCountryStr lookup for currencies type by country

func ByCountryStrErr

func ByCountryStrErr(country string) (c currencies, err error)

ByCountryStrErr lookup for currencies type by country

func ByCurrency

func ByCurrency(currency Currency) (c currency, ok bool)

ByCurrency lookup for currency type by currency

func ByCurrencyErr

func ByCurrencyErr(currencyStr Currency) (c currency, err error)

ByCurrencyErr lookup for currencies type by code

func ByCurrencyStr

func ByCurrencyStr(currency string) (c currency, ok bool)

ByCurrencyStr lookup for currency type by currency

func ByCurrencyStrErr

func ByCurrencyStrErr(currencyStr string) (c currency, err error)

ByCurrencyStrErr lookup for currency type by currency

func ByNumber

func ByNumber(number Number) (c currency, ok bool)

ByNumber lookup for currency type by number

func ByNumberErr

func ByNumberErr(number Number) (c currency, err error)

ByNumberErr lookup for currencies type by number

func ByNumberStr

func ByNumberStr(number string) (c currency, ok bool)

ByNumberStr lookup for currency type by number

func ByNumberStrErr

func ByNumberStrErr(number string) (c currency, err error)

ByNumberStrErr lookup for currency type by number

Types

type Code

type Code string

Code represents a code type from ISO-4217

func (Code) IsSet

func (code Code) IsSet() bool

IsSet indicates if Code is set

func (Code) Places added in v1.0.7

func (code Code) Places() int

Places returns number of digits after the dot. E.g. 2 for USD, 0 for for currencies which do not support fractions

func (Code) String

func (code Code) String() string

String implementation of Stringer interface

func (*Code) UnmarshalJSON

func (code *Code) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for Code

func (Code) Validate

func (code Code) Validate() error

Validate implementation of ozzo-validation Validate interface

func (Code) Value

func (code Code) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

type Countries

type Countries []Country

Countries is a Country slice type

func (Countries) IsCountryIn

func (countries Countries) IsCountryIn(country string) bool

IsCountryIn Checks there is a country in Countries

type Country

type Country string

Country represents a country type from ISO-4217

func (Country) IsSet

func (country Country) IsSet() bool

IsSet indicates if Country is set

func (Country) String

func (country Country) String() string

String implementation of Stringer interface

func (*Country) UnmarshalJSON

func (country *Country) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for Country

func (Country) Validate

func (country Country) Validate() error

Validate implementation of ozzo-validation Validate interface

func (Country) Value

func (country Country) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

type Currency

type Currency string

Currency represents a currency type from ISO-4217

func (Currency) IsSet

func (currency Currency) IsSet() bool

IsSet indicates if Currency is set

func (Currency) String

func (currency Currency) String() string

String implementation of Stringer interface

func (*Currency) UnmarshalJSON

func (currency *Currency) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for Currency

func (Currency) Validate

func (currency Currency) Validate() error

Validate implementation of ozzo-validation Validate interface

func (Currency) Value

func (currency Currency) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

type Number

type Number string

Number represents a number type from ISO-4217

func (Number) IsSet

func (number Number) IsSet() bool

IsSet indicates if Number is set

func (Number) String

func (number Number) String() string

String implementation of Stringer interface

func (*Number) UnmarshalJSON

func (number *Number) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshall implementation for Number

func (Number) Validate

func (number Number) Validate() error

Validate implementation of ozzo-validation Validate interface

func (Number) Value

func (number Number) Value() (value driver.Value, err error)

Value implementation of driver.Valuer

Jump to

Keyboard shortcuts

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