Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyProviders = errors.New("provider list is empty") ErrInvalidURL = errors.New("invalid URL") ErrNoResponse = errors.New("failed to get response from provider") ErrStatusCode = errors.New("provider returned a non OK status code") ErrInvalidResponse = errors.New("failed to read IP from provider") ErrParseResponse = errors.New("failed to parse IP from provider") )
View Source
var DEFAULT_PROVIDERS = []string{
"https://checkip.amazonaws.com",
"https://ipconfig.io",
"https://icanhazip.com",
"https://ifconfig.me",
}
Functions ¶
This section is empty.
Types ¶
type IPDiscover ¶
type IPDiscover struct {
// contains filtered or unexported fields
}
func NewIPDiscover ¶
func NewIPDiscover() (*IPDiscover, error)
func NewIPDiscoverWithProviders ¶
func NewIPDiscoverWithProviders(providers []string) (*IPDiscover, error)
func (*IPDiscover) Providers ¶
func (ipd *IPDiscover) Providers() []string
Click to show internal directories.
Click to hide internal directories.