Documentation ¶
Overview ¶
Package ipifyorg implements an interface to the ipify.org API.
- Limits of the ipify.org API: 1000 request/day or 50,000 requests/month for free plan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IOReadAll = io.ReadAll
IOReadAll is a copy of io.ReadAll function to ease mock it's behavior during test.
View Source
var LogInfo = info.Log
LogInfo is a copy of info.Log function to ease mock it's behavior during test.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
EndpointURL string
}
Client holds information to request ipify.org API.
type Response ¶
type Response struct { Provider string `json:"provider"` IP string `json:"ip"` HostName string `json:"hostname,omitempty"` City string `json:"city,omitempty"` Region string `json:"region,omitempty"` Location string `json:"loc,omitempty"` Organization string `json:"org,omitempty"` PostalCode string `json:"postal,omitempty"` TimeZone string `json:"timezone,omitempty"` Readme string `json:"readme,omitempty"` }
Response is the structure of JSON from the API response of ipify.org.
Click to show internal directories.
Click to hide internal directories.