Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllProviders ¶
AllProviders returns all supported IP providers.
Types ¶
type GoogleIPProvider ¶
GoogleIPProvider is IP provider.
func NewGoogleIPProvider ¶
func NewGoogleIPProvider() *GoogleIPProvider
NewGoogleIPProvider instantiate an IP provider.
func (GoogleIPProvider) ExtractIP ¶
func (p GoogleIPProvider) ExtractIP(data []byte) (net.IP, error)
ExtractIP extracts IP address from provider data.
func (GoogleIPProvider) GetName ¶
func (p GoogleIPProvider) GetName() string
GetName gets the provider name.
func (GoogleIPProvider) GetURL ¶
func (p GoogleIPProvider) GetURL() *url.URL
GetURL gets the provider url.
type HTTPClient ¶
HTTPClient is an interface for http client.
type IP ¶
type IP struct { Client HTTPClient Provider Provider Address net.IP }
IP is struct for IP address.
type NotSupported ¶
type NotSupported struct {
Name string
}
NotSupported errors when a given provider is not supported.
func (*NotSupported) Error ¶
func (e *NotSupported) Error() string
Click to show internal directories.
Click to hide internal directories.