Documentation
¶
Index ¶
Constants ¶
View Source
const ( UndefinedCountryCodeISO2 = "**" UndefinedCountryCodeISO3 = "***" )
undefined country codes
Variables ¶
View Source
var ( ErrCode2InvalidScanType = errors.New("[gogeo.code2] invalid scan type, supports only bytes and string") ErrCode2InvalidValueSize = errors.New("[gogeo.code2] invalid value size, supports only two 2 chars") )
Error list...
View Source
var Continents = []Continent{
{ID: 1, Code2: "EU", Name: "Europe"},
{ID: 2, Code2: "AS", Name: "Asia"},
{ID: 3, Code2: "AF", Name: "Africa"},
{ID: 4, Code2: "OC", Name: "Oceania"},
{ID: 5, Code2: "SA", Name: "South America"},
{ID: 6, Code2: "NA", Name: "North America"},
{ID: 7, Code2: "AN", Name: "Antarctica"},
}
Continents list
View Source
var Countries = []Country{}/* 255 elements not displayed */
Countries list
View Source
var UndefinedCountryCode2 = Code2{UndefinedCountryCodeISO2[0], UndefinedCountryCodeISO2[1]}
UndefinedCountryCode2 for undefined codename
Functions ¶
This section is empty.
Types ¶
type Code2 ¶
type Code2 [2]byte
Code2 implements basic
func CountryCode2ByString ¶
CountryCode2ByString returns code by string code ISO-2 or ISO-3
func (Code2) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Code2) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type Country ¶
type Country struct { ID int `json:"id"` Code2 string `json:"cc,omitempty"` Code3 string `json:"ccc,omitempty"` Name string `json:"name,omitempty"` ShortName string `json:"short,omitempty"` Native string `json:"native,omitempty"` Continent string `json:"continent,omitempty"` Capital string `json:"capital,omitempty"` Currency []string `json:"currency,omitempty"` Languages []string `json:"langs,omitempty"` Phones []string `json:"phones,omitempty"` Coordinates Coordinates `json:"corrd,omitempty"` TimeZones []TimeZone `json:"zones,omitempty"` }
Country info
Click to show internal directories.
Click to hide internal directories.