Documentation
¶
Index ¶
Constants ¶
View Source
const MaxDistance = 360
MaxDistance is the distance returned if Distance() is called with a nil location
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct { Country string Continent string RegionGroup string Region string Latitude float64 Longitude float64 Netmask int }
Location is the struct the GeoIP provider packages use to return location details for an IP.
func (*Location) MaxDistance ¶
MaxDistance() returns the MaxDistance constant
type Provider ¶
type Provider interface { HasCountry() (bool, error) GetCountry(ip net.IP) (country, continent string, netmask int) HasASN() (bool, error) GetASN(net.IP) (asn string, netmask int, err error) HasLocation() (bool, error) GetLocation(ip net.IP) (location *Location, err error) }
Provider is the interface for geoip providers
Click to show internal directories.
Click to hide internal directories.