Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoIPFound = errors.New("no IP address found") ErrTooManyIPs = errors.New("too many IP addresses") ErrBanned = errors.New("we got banned") )
View Source
var ( ErrUnknownProvider = errors.New("unknown public IP echo HTTP provider") ErrProviderIPVersion = errors.New("provider does not support IP version") )
Functions ¶
Types ¶
type Option ¶
type Option func(s *settings) error
func SetProvidersIP ¶
func SetProvidersIP4 ¶
func SetProvidersIP6 ¶
func SetTimeout ¶
type Provider ¶
type Provider string
const ( Ifconfig Provider = "ifconfig" Ipify Provider = "ipify" Ipinfo Provider = "ipinfo" Spdyn Provider = "spdyn" Ipleak Provider = "ipleak" Icanhazip Provider = "icanhazip" Ident Provider = "ident" Nnev Provider = "nnev" Wtfismyip Provider = "wtfismyip" Seeip Provider = "seeip" Changeip Provider = "changeip" )
func CustomProvider ¶
CustomProvider creates a provider with a custom HTTP(s) URL. It is the responsibility of the caller to make sure it is a valid URL and that it supports the desired IP version(s) as no further check is done on it.
func ListProviders ¶
func ListProviders() []Provider
func ListProvidersForVersion ¶
Click to show internal directories.
Click to hide internal directories.