Documentation
¶
Index ¶
Constants ¶
const CountryAlpha2CodeJSON string = `` /* 1216-byte string literal not displayed */
CountryAlpha2CodeJSON string is a JSON string with all country ISO 3166-1 Alpha 2 Code in JSON format, in alphabetical order
const CountryFullJSON string = `` /* 39604-byte string literal not displayed */
CountryFullJSON string is a JSON string with all country information in JSON format, ordered by country_name
const CountryNamesJSON string = `` /* 3383-byte string literal not displayed */
CountryNamesJSON string is a JSON string with all country names in JSON format, in alphabetical order
const USCountyJSON string = `` /* 176307-byte string literal not displayed */
USCountyJSON is a list of all US Counties using their FIPS code
const USStatesCodeJSON string = `` /* 261-byte string literal not displayed */
USStatesCodeJSON is the JSON array for all US State Codes (including DC and Puerto Rico) in alpha order by name
const USStatesJSON string = `` /* 7059-byte string literal not displayed */
USStatesJSON is the JSON array for all US States (including DC and Puerto Rico)
const USStatesNameJSON string = `` /* 610-byte string literal not displayed */
USStatesNameJSON is the JSON array for all US State Names (including DC and Puerto Rico) in alpha order by name
Variables ¶
This section is empty.
Functions ¶
func Alpha2s ¶
func Alpha2s() []string
Alpha2s returns a slice of strings containing the ISO 3166-1 Alpha 2 Codes in order by Country Name
func FindUSCountyCodes ¶
func FindUSCountyCodes(sp StateProvince) ([]string, error)
FindUSCountyCodes returns a list of County Codes for a US State
func FindUSCountyNames ¶
func FindUSCountyNames(sp StateProvince) ([]string, error)
FindUSCountyNames returns a list of County Names for a US State
Types ¶
type Country ¶
type Country struct {
ID uuid.UUID
Name string `json:"country_name"`
Alpha2Code string `json:"country_alpha_2_cd"`
Alpha3Code string `json:"country_alpha_3_cd"`
UNM49Code int `json:"country_un_m49_cd"`
LatitudeAverage string `json:"latitude_average"`
LongitudeAverage string `json:"longitude_average"`
States []StateProvince
CreateUsername string
CreateTimestamp time.Time
UpdateUsername string
UpdateTimestamp time.Time
}
Country represents a nation with its own government, occupying a particular territory.
func FindCountryInJSONByAlpha2Code ¶
FindCountryInJSONByAlpha2Code initializes a Country struct using the CountryFullJSON constant (instead of going to the database). If the Country is the United States, the US states will be added as well.
func (Country) FindStateByCode ¶
func (c Country) FindStateByCode(stateCode string) (StateProvince, error)
FindStateByCode returns a State/Province for a country given it's State or Province code
type County ¶
type County struct {
ID uuid.UUID
Code string `json:"county_cd"`
Name string `json:"county_name"`
LatitudeAverage string `json:"latitude_average"`
LongitudeAverage string `json:"longitude_average"`
CreateUsername string
CreateTimestamp time.Time
UpdateUsername string
UpdateTimestamp time.Time
}
County is a geographical region of a country used for administrative or other purposes, in certain modern nations. For the US, the Code is the Federal Information Processing System (FIPS) Codes for States and Counties. FIPS codes are numbers which uniquely identify geographic areas.
func FindUSCounties ¶
func FindUSCounties(sp StateProvince) ([]County, error)
FindUSCounties returns a list of Counties for a US State
type StateProvince ¶
type StateProvince struct {
ID uuid.UUID
Code string `json:"state_prov_cd"`
Name string `json:"state_name"`
FIPSCode string `json:"state_fips_cd"`
LatitudeAverage string `json:"latitude_average"`
LongitudeAverage string `json:"longitude_average"`
Counties []County
CreateUsername string
CreateTimestamp time.Time
UpdateUsername string
UpdateTimestamp time.Time
}
StateProvince is a State or Province of a Country that makes up a particular territory
Directories
¶
| Path | Synopsis |
|---|---|
|
Package logger has helpers to setup a zerolog.Logger https://github.com/rs/zerolog
|
Package logger has helpers to setup a zerolog.Logger https://github.com/rs/zerolog |