Documentation
¶
Index ¶
- Variables
- type Country
- func (c Country) GPS() (float64, float64, bool)
- func (r Country) IsValid() bool
- func (r Country) MarshalText() ([]byte, error)
- func (r *Country) Scan(value interface{}) error
- func (c Country) String() string
- func (r *Country) UnmarshalText(data []byte) error
- func (r Country) Value() (driver.Value, error)
- type Currency
- func (c Currency) Format(val float64, opts *CurrencyOptions) (result string)
- func (r Currency) IsValid() bool
- func (r Currency) MarshalText() ([]byte, error)
- func (r *Currency) Scan(value interface{}) error
- func (c Currency) Symbol() string
- func (r *Currency) UnmarshalText(data []byte) error
- func (r Currency) Value() (driver.Value, error)
- type CurrencyOptions
- type Language
- type Region
Constants ¶
This section is empty.
Variables ¶
var ( CountryGPS = country_gps CountryNames = country_names )
var (
ISO_3166_1_COUNTRY_CODES []string = []string{}/* 245 elements not displayed */
)
ISO 3166-1 Alpha-2 country codes. https://en.wikipedia.org/wiki/ISO_3166-1 https://gist.github.com/unceus/6501985
var (
ISO_4217_CURRENCY_CODES []string = []string{}/* 179 elements not displayed */
)
ISO 4217 Currency codes (2016-12-17) https://en.wikipedia.org/wiki/ISO_4217
var (
ISO_639_1_2002_CODES []string = []string{}/* 184 elements not displayed */
)
ISO 639-1:2002 Language codes https://en.wikipedia.org/wiki/ISO_639-1
var ISO_639_1_TO_2T_MAP map[string]string = map[string]string{}/* 184 elements not displayed */
var (
ISO_639_2B_1998_CODES []string = []string{
"alb",
"arm",
"baq",
"bur",
"chi",
"cze",
"dut",
"fre",
"geo",
"ger",
"gre",
"ice",
"mac",
"mao",
"may",
"per",
"rum",
"slo",
"tib",
"wel",
}
)
ISO 639-2/B-1998 Language codes (updated 2014-03-18) https://www.loc.gov/standards/iso639-2/php/code_list.php https://en.wikipedia.org/wiki/ISO_639-2
var ISO_639_2B_TO_2T_MAP map[string]string = map[string]string{
"alb": "sqi",
"arm": "hye",
"baq": "eus",
"bur": "mya",
"chi": "zho",
"cze": "ces",
"dut": "nld",
"fre": "fra",
"geo": "kat",
"ger": "deu",
"gre": "ell",
"ice": "isl",
"mac": "mkd",
"mao": "mri",
"may": "msa",
"per": "fas",
"rum": "ron",
"slo": "slk",
"tib": "bod",
"wel": "cym",
}
var (
ISO_639_2T_1998_CODES []string = []string{}/* 487 elements not displayed */
)
ISO 639-2/T-1998 Language codes (updated 2014-03-18) https://www.loc.gov/standards/iso639-2/php/code_list.php https://en.wikipedia.org/wiki/ISO_639-2
Functions ¶
This section is empty.
Types ¶
type Country ¶
type Country string
const (
CountryUndefined Country = ""
)
func ParseCountry ¶
func (*Country) UnmarshalText ¶
type Currency ¶
type Currency string
const (
CurrencyUndefined Currency = ""
)
func ParseCurrency ¶
func (Currency) Format ¶
func (c Currency) Format(val float64, opts *CurrencyOptions) (result string)
Format returns a formatted price string according to currency rules and options
func (*Currency) UnmarshalText ¶
type CurrencyOptions ¶
type CurrencyOptions struct { WithCents bool // true, WithCurrency bool // false, WithSymbol bool // true, WithSymbolSpace bool // false, WithThousandsSeparator bool // true, }
func NewCurrencyOptions ¶
func NewCurrencyOptions() *CurrencyOptions
func (*CurrencyOptions) Cents ¶
func (o *CurrencyOptions) Cents(f bool) *CurrencyOptions
func (*CurrencyOptions) Currency ¶
func (o *CurrencyOptions) Currency(f bool) *CurrencyOptions
func (*CurrencyOptions) Separator ¶
func (o *CurrencyOptions) Separator(f bool) *CurrencyOptions
func (*CurrencyOptions) Space ¶
func (o *CurrencyOptions) Space(f bool) *CurrencyOptions
func (*CurrencyOptions) Symbol ¶
func (o *CurrencyOptions) Symbol(f bool) *CurrencyOptions
type Language ¶
type Language string
const (
LanguageUndefined Language = ""
)
func ParseLanguage ¶
func (*Language) UnmarshalText ¶
type Region ¶
type Region string
ISO 3166-2 Country subdivision code
const (
RegionUndefined Region = ""
)