publicip

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

README

publicip

golang module which can be used to find your public (internet facing ip).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug requests

View Source
var DefaultUserAgent = "curl/7.58.0"

DefaultUserAgent is the user agent which will be used for connection. Note: changing this value may affect the result with some providers.

View Source
var HttpClient *resty.Client

HttpClient is a placehold for alternative http client. If it's not set (equal nil), then new client instance is generated for every request

Functions

func Get

func Get() (string, error)

func SetMirrors

func SetMirrors(newUrls []string)

SetMirrors permit to override 3d party ip resolvers used in this library (if for some reason you want to use your own)

Types

type DownloadError

type DownloadError struct {
	StatusCode int
	Body       []byte
	Url        string
}

func (DownloadError) Error

func (DownloadError) Error() string

type InvalidResponseError

type InvalidResponseError struct {
	Response string
}

InvalidResponseError is returned when a mirrir is replying an invalid response (not an ip)

func (InvalidResponseError) Error

func (InvalidResponseError) Error() string

type MirrorsExausted

type MirrorsExausted struct {
}

func (MirrorsExausted) Error

func (MirrorsExausted) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL