Documentation ¶
Index ¶
- func GetAllCountryCode() (codeList []string, err error)
- func GetAllCountryNames() (nameList []string, err error)
- func GetCountryCodeForLanguage(language string) (code string, err error)
- func GetCountryNameForCode(code string) (name string, err error)
- func GetLocaleCountryCode() (code string, err error)
- func GetLocaleCountryName() (name string, err error)
- type Country
- type CountryDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllCountryCode ¶
GetAllCountryCode return all country code.
func GetAllCountryNames ¶
GetAllCountryNames return all country names.
func GetCountryCodeForLanguage ¶
GetCountryCodeForLanguage return country code for a language variable, e.g. "CN" will be return if passing "zh_CN.UTF-8".
func GetCountryNameForCode ¶
GetCountryNameForCode return country name that corresponding to the country code.
func GetLocaleCountryCode ¶
GetLocaleCountryCode return locale country code by analysis environment variable "LANGUAGE".
func GetLocaleCountryName ¶
GetLocaleCountryName return locale country name by analysis environment variable "LANGUAGE".
Types ¶
type CountryDatabase ¶
type CountryDatabase struct {
Countries []Country `xml:"iso_3166_entry"`
}
map dtd of iso_3166.xml to go structures
func GetCountryDatabase ¶
func GetCountryDatabase() (*CountryDatabase, error)
GetCountryDatabase return country database that marshaled from ISO 3166 xml file.
Click to show internal directories.
Click to hide internal directories.