Documentation ¶
Overview ¶
Package whatismyipcom provides an interface to the www.whatismyip.com web service.
Currently it is disabled in the command due to the following issue:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var IOReadAll = io.ReadAll
IOReadAll is a copy of io.ReadAll function to ease mock it's behavior during test.
var LogInfo = info.Log
LogInfo is a copy of info.Log function to ease mock it's behavior during test.
var NewDocument = goquery.NewDocumentFromReader
NewDocument is a copy of goquery.NewDocumentFromReader function to ease mock it's behavior during test.
Functions ¶
func ScrapeIPv4 ¶
ScrapeIPv4 returns the first IPv4 address found from the given html.
Types ¶
type Client ¶
type Client struct {
EndpointURL string
}
Client holds information to request www.whatismyip.com's URL.
func New ¶
func New() *Client
New returns a new Client for the www.whatismyip.com with default values.
type Response ¶
Response is the structure of JSON to hold info from www.whatismyip.com.
func GetResponse ¶
GetResponse returns the Response object parsed from the www.whatismyip.com's content body.