Documentation ¶
Index ¶
- Constants
- type Coordinate
- type DB
- type Location
- type LocationId
- func City(country, Primary, city string) LocationId
- func Country(country string) LocationId
- func ParseId(s string) (LocationId, error)
- func PostalCode(country, postalCode string) LocationId
- func Primary(country, subdivision1 string) LocationId
- func Secondary(country, subdivision1, subdivision2 string) LocationId
Constants ¶
View Source
const (
// NumColumns is expected number of columns in GeoNames csv
NumColumns = 12
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
Coordinate represents a lat long coordinate
type Location ¶
type Location struct { Coordinate Country string PostalCode string City string Subdivision1 string Subdivision2 string // contains filtered or unexported fields }
Location is an instance of a GeoNames location
type LocationId ¶
type LocationId struct { Primary string Secondary string // contains filtered or unexported fields }
LocationId is the id for the location
func PostalCode ¶
func PostalCode(country, postalCode string) LocationId
PostalCode creates an instance of the postal code location id
func Primary ¶
func Primary(country, subdivision1 string) LocationId
Primary creates a first order subdivision location id
func Secondary ¶
func Secondary(country, subdivision1, subdivision2 string) LocationId
Secondary creates a Secondary location id
func (LocationId) IsCountry ¶
func (id LocationId) IsCountry() bool
IsCountry checks if id is of country type
func (LocationId) IsPostal ¶
func (id LocationId) IsPostal() bool
IsPostal checks if id is of postal type
func (LocationId) IsPrimary ¶
func (id LocationId) IsPrimary() bool
IsPrimary checks if id is of Primary type
func (LocationId) IsSecondary ¶
func (id LocationId) IsSecondary() bool
IsSecondary checks if id is of Secondary type
func (LocationId) String ¶
func (id LocationId) String() string
Click to show internal directories.
Click to hide internal directories.