iso

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CountryGPS   = country_gps
	CountryNames = country_names
)
View Source
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

View Source
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

View Source
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

View Source
var ISO_639_1_TO_2T_MAP map[string]string = map[string]string{}/* 184 elements not displayed */
View Source
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

View Source
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",
}
View Source
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 ParseCountry(c string) Country

func (Country) GPS

func (c Country) GPS() (float64, float64, bool)

func (Country) IsValid

func (r Country) IsValid() bool

func (Country) MarshalText

func (r Country) MarshalText() ([]byte, error)

Text/JSON conversion

func (*Country) Scan

func (r *Country) Scan(value interface{}) error

SQL conversion

func (Country) String

func (c Country) String() string

func (*Country) UnmarshalText

func (r *Country) UnmarshalText(data []byte) error

func (Country) Value

func (r Country) Value() (driver.Value, error)

type Currency

type Currency string
const (
	CurrencyUndefined Currency = ""
)

func ParseCurrency

func ParseCurrency(c string) Currency

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) IsValid

func (r Currency) IsValid() bool

func (Currency) MarshalText

func (r Currency) MarshalText() ([]byte, error)

Text/JSON conversion

func (*Currency) Scan

func (r *Currency) Scan(value interface{}) error

SQL conversion

func (Currency) Symbol

func (c Currency) Symbol() string

func (*Currency) UnmarshalText

func (r *Currency) UnmarshalText(data []byte) error

func (Currency) Value

func (r Currency) Value() (driver.Value, error)

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 ParseLanguage(l string) Language

func (Language) IsValid

func (r Language) IsValid() bool

func (Language) MarshalText

func (r Language) MarshalText() ([]byte, error)

Text/JSON conversion

func (*Language) Scan

func (r *Language) Scan(value interface{}) error

SQL conversion

func (Language) String

func (l Language) String() string

func (*Language) UnmarshalText

func (r *Language) UnmarshalText(data []byte) error

func (Language) Value

func (r Language) Value() (driver.Value, error)

type Region

type Region string

ISO 3166-2 Country subdivision code

const (
	RegionUndefined Region = ""
)

func ParseRegion

func ParseRegion(c string) Region

func (Region) Country

func (r Region) Country() Country

func (Region) IsValid

func (r Region) IsValid() bool

func (Region) MarshalText

func (r Region) MarshalText() ([]byte, error)

Text/JSON conversion

func (*Region) Scan

func (r *Region) Scan(value interface{}) error

SQL conversion

func (Region) String

func (c Region) String() string

func (*Region) UnmarshalText

func (r *Region) UnmarshalText(data []byte) error

func (Region) Value

func (r Region) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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