Documentation
¶
Overview ¶
Package goip provides a thin wrapper around the ip-api.com API to retrieve geolocation data for a specific IP address
Index ¶
Constants ¶
View Source
const PRO_URI = "http://pro.ip-api.com/json/"
Pro URI
View Source
const STANDARD_URI = "http://ip-api.com/json/"
Primary URI
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetLocation() (*Location, error) GetLocationForIp(ip string) (*Location, error) }
func NewClientWithApiKey ¶
type Location ¶
type Location struct { As string `json:"as"` City string `json:"city"` Country string `json:"country"` CountryCode string `json:"countryCode"` Isp string `json:"isp"` Lat float32 `json:"lat"` Lon float32 `json:"lon"` Org string `json:"org"` Query string `json:"query"` Region string `json:"region"` RegionName string `json:"regionName"` Status string `json:"status"` Timezone string `json:"timezone"` Zip string `json:"zip"` }
Location contains all the relevant data for an IP
type ProClient ¶
ProClient is a commercial client for retrieving location data.
func (*ProClient) GetLocation ¶
GetLocation retrieves the current client's public IP address location information
type StandardClient ¶
StandardClient is a free client for retreiving location data with a 150 request per minute limit.
func (*StandardClient) GetLocation ¶
func (g *StandardClient) GetLocation() (*Location, error)
GetLocation retrieves the current client's public IP address location information
func (*StandardClient) GetLocationForIp ¶
func (g *StandardClient) GetLocationForIp(ip string) (*Location, error)
GetLocationForIp retrieves the supplied IP address's location information
Click to show internal directories.
Click to hide internal directories.