func (p *PublicIPResolver) Resolve() string {
	res, err := http.Get("https://api.meineip.eu/?format=json")
	if err != nil || res.StatusCode != http.StatusOK {
		return p.Fallback.Resolve()
	}
	ipResponse := &struct {
		IP      string `json:"ipaddress"`
		Version string `json:"ipversion"`
	}{}
	err = json.NewDecoder(res.Body).Decode(ipResponse)
	if err != nil {
		return p.Fallback.Resolve()
	}

	return ipResponse.IP
}
// Resolve gets your public ip from a remote server. Defaults to fallback resolver on errors
Resolve gets your public ip from a remote server. Defaults to fallback resolver on errors
// Resolve gets your public ip from a remote server . Defaults to fallback resolver on errors
func (p *PublicIPResolver) Resolve() string {
	res, err := http.Get("https://api.meineip.eu/?format=json")
	if err != nil || res.StatusCode != http.StatusOK {
		return p.Fallback.Resolve()
	}
	ipResponse := &struct {
		IP      string `json:"ipaddress"`
		Version string `json:"ipversion"`
	}{}
	err = json.NewDecoder(res.Body).Decode(ipResponse)
	if err != nil {
		return p.Fallback.Resolve()
	}
	return ipResponse.IP
}
func ( p * PublicIPResolver ) Resolve ( ) string { res , err := http . Get ( " " ) if err != nil || res . StatusCode != http . StatusOK { return p . Fallback . Resolve ( ) } ipResponse := & struct { IP string `json:"ipaddress"` Version string `json:"ipversion"` } { } err = json . NewDecoder ( res . Body ) . Decode ( ipResponse ) if err != nil { return p . Fallback . Resolve ( ) } return ipResponse . IP }
Resolve gets your public ip from a remote server.
Resolve gets your public ip from a remote server .