Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseColumnFormat ¶
ParseColumnFormat parses r as a 3 column file with a whitespace character as a separator. Column 1 is the alpha-2 code, column 2 is the alpha-3 code, column 3 is the countries name.
Example: DJ DJI Djibouti SE SWE Sweden IR IRN Iran, Islamic Republic ZW ZWE Zimbabwe
Types ¶
type AlphaThreeCountryCode ¶
type AlphaThreeCountryCode string
AlphaThreeCountryCode - data type containing three character ISO3166 alpha-3 code
func (AlphaThreeCountryCode) String ¶
func (cc AlphaThreeCountryCode) String() string
String - implements Stringer. Returns the three character code as a string.
type AlphaTwoCountryCode ¶
type AlphaTwoCountryCode string
AlphaTwoCountryCode - data type containing two character ISO3166 alpha-2 code
func (AlphaTwoCountryCode) String ¶
func (cc AlphaTwoCountryCode) String() string
String - implements Stringer. Returns the two character code as a string.
type Country ¶
type Country struct {
// contains filtered or unexported fields
}
Country - contains information about the country
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains indexes allowing countries to be searched by their alpha2 or alpha3 code.
func (*Store) GetAlphaTwoCodes ¶
func (s *Store) GetAlphaTwoCodes() []AlphaTwoCountryCode
GetAlphaTwoCodes returns a list of all alpha-2 codes.
func (*Store) GetCountryCode ¶
func (s *Store) GetCountryCode(cc AlphaTwoCountryCode) (*Country, bool)
GetCountryCode searches for country info using the alpha-2 code cc. The second argument indicates whether the search was successful.