Documentation ¶
Index ¶
- type Client
- type Coordinate
- 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.0.6
type Client struct { LocationCount int // contains filtered or unexported fields }
Client for GeoNames
type Coordinate ¶
Coordinate represents a lat long coordinate
type Location ¶
type Location struct { Coordinate Country string `db:"country"` PostalCode string `db:"postal_code"` City string `db:"city"` Subdivision1 string `db:"subdivision1"` Subdivision2 string `db:"subdivision2"` // contains filtered or unexported fields }
Location is an instance of a GeoNames location
type LocationId ¶
type LocationId struct {
// 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.