Documentation ¶
Overview ¶
Package way provides a client for postal code lookups.
Index ¶
- Constants
- type Radar
- func (r *Radar) City(country country.Country, subdivision1, city string) (*geonames.Location, error)
- func (r *Radar) Country(country country.Country) (*geonames.Location, error)
- func (r *Radar) Error() error
- func (r *Radar) IP(addr string) (*geonames.Location, error)
- func (r *Radar) PSD(country country.Country, subdivision1 string) (*geonames.Location, error)
- func (r *Radar) Postal(country country.Country, postal string) (*geonames.Location, error)
- func (r *Radar) Refresh()
- func (r *Radar) SSD(country country.Country, subdivision1, subdivision2 string) (*geonames.Location, error)
- type RadarOption
Constants ¶
View Source
const ( // DefaultGeonamesLocation is the default origin location for the GeoName export DefaultGeonamesLocation = "https://download.geonames.org/export/zip/allCountries.zip" // DefaultMaxmindLocation is the default origin location for the Maxmind export DefaultMaxmindLocation = "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_LICENSE_KEY&suffix=tar.gz" // DefaultRefreshTimeout is the default wait time for refreshing locations DefaultRefreshTimeout = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Radar ¶ added in v0.0.5
type Radar struct {
// contains filtered or unexported fields
}
Radar is a postal level geo-lookup service.
func (*Radar) City ¶ added in v0.0.5
func (r *Radar) City(country country.Country, subdivision1, city string) (*geonames.Location, error)
City lookup
type RadarOption ¶ added in v0.0.6
type RadarOption func(r *Radar)
RadarOption to configure custom radar
func GeonamesLocation ¶
func GeonamesLocation(o string) RadarOption
GeonamesLocation sets a custom location to refresh geonames db from
func MaxmindKey ¶
func MaxmindKey(o string) RadarOption
MaxmindKey sets a custom maxmind licence key
func MaxmindLocation ¶
func MaxmindLocation(o string) RadarOption
MaxmindLocation sets a custom location to refresh maxmind db from
func RefreshTimeout ¶
func RefreshTimeout(o time.Duration) RadarOption
RefreshTimeout sets a custom refresh timeout
Click to show internal directories.
Click to hide internal directories.