Documentation
¶
Overview ¶
Package ipapi allows for easy fetching of IP data, while still retaining the rate limiting specified
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIKey = ""
APIKey holds the key for a paying customer. Blank by default
View Source
var Endpoint = "http://ip-api.com/json/"
Endpoint is the query location for all queries
View Source
var Fields = "?fields=status,message,country,countryCode,region,regionName,city,zip,lat,lon,timezone,isp,org,as,query"
Fields configures what to query from the API. This can be either as a comma separated string or the string of the numeric value eg. "61439". For full documentation see: https://ip-api.com/docs/api:json Note that
View Source
var MaxQueueLength = 50
MaxQueueLength limits the total number of elements in the queue. This is only relevant for rate limited usage.
View Source
var TTLBuffer = 5
TTLBuffer is added wait time for the API to let its TTL reach zero
Functions ¶
Types ¶
type Response ¶
type Response struct { Query string `json:"query,omitempty"` Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` Continent string `json:"continent,omitempty"` ContinentCode string `json:"continentCode,omitempty"` Country string `json:"country,omitempty"` CountryCode string `json:"countryCode,omitempty"` Region string `json:"region,omitempty"` RegionName string `json:"regionName,omitempty"` City string `json:"city,omitempty"` District string `json:"district,omitempty"` ZIP string `json:"zip,omitempty"` Latitude *float64 `json:"lat,omitempty"` Longtitude *float64 `json:"lon,omitempty"` Timezone string `json:"timezone,omitempty"` Offset *int64 `json:"offset,omitempty"` Currency string `json:"currency,omitempty"` ISP string `json:"isp,omitempty"` Organization string `json:"org,omitempty"` AS string `json:"as,omitempty"` ASName string `json:"asname,omitempty"` Reverse string `json:"reverse,omitempty"` Mobile *bool `json:"mobile,omitempty"` Proxy *bool `json:"proxy,omitempty"` Hosting *bool `json:"hosting,omitempty"` }
Response holds data for each of the possible data points
Click to show internal directories.
Click to hide internal directories.