Documentation ¶
Index ¶
- func ParseIPv4FromBody(in io.Reader) (net.IP, error)
- func PrivateIPv4DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
- func PublicHostnameDiscovererOption(f func() (string, error)) func(*DiscovererOptions)
- func PublicIPv4DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
- func PublicIPv6DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
- func StandardHostnameFromHTTP(url string, headers map[string]string) (string, error)
- func StandardIPFromHTTP(url string, headers map[string]string) (net.IP, error)
- type Discoverer
- type DiscovererOption
- type DiscovererOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseIPv4FromBody ¶
ParseIPv4FromBody reads from a reader (such as an http.Body) and tries to parse the IPv4 IP address contained therein.
func PrivateIPv4DiscovererOption ¶
func PrivateIPv4DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
PrivateIPv4DiscovererOption retuns a DiscovererOption which sets the Private IPv4 address discovery function.
func PublicHostnameDiscovererOption ¶
func PublicHostnameDiscovererOption(f func() (string, error)) func(*DiscovererOptions)
PublicHostnameDiscovererOption returns a DiscovererOption which sets the Public Hostname discovery function.
func PublicIPv4DiscovererOption ¶
func PublicIPv4DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
PublicIPv4DiscovererOption returns a DiscovererOption which sets the Public IPv4 address discovery function.
func PublicIPv6DiscovererOption ¶
func PublicIPv6DiscovererOption(f func() (net.IP, error)) func(*DiscovererOptions)
PublicIPv6DiscovererOption returns a DiscovererOption which sets the Public IPv6 address discovery function.
func StandardHostnameFromHTTP ¶
StandardHostnameFromHTTP queries an HTTP URL and returns the hostname contained within its response. Headers are optional.
Types ¶
type Discoverer ¶
type Discoverer interface { // Hostname returns the public hostname. Hostname() (string, error) // PrivateIPv4 returns the private IPv4 address. PrivateIPv4() (net.IP, error) // PublicIPv4 returns the public IPv4 address. PublicIPv4() (net.IP, error) // PublicIPv6 returns the public IPv6 address. PublicIPv6() (net.IP, error) }
Discoverer describes an interface by which network details may be discovered
func NewAWSDiscoverer ¶
func NewAWSDiscoverer() Discoverer
NewAWSDiscoverer returns a new Amazon Web Services network discoverer
func NewAzureDiscoverer ¶
func NewAzureDiscoverer() Discoverer
NewAzureDiscoverer returns a new Google Cloud Platform network discoverer
func NewDigitalOceanDiscoverer ¶
func NewDigitalOceanDiscoverer() Discoverer
NewDigitalOceanDiscoverer returns a new Digital Ocean network discoverer
func NewDiscoverer ¶
func NewDiscoverer(opts ...DiscovererOption) Discoverer
NewDiscoverer creates a new network discoverer
func NewGCPDiscoverer ¶
func NewGCPDiscoverer() Discoverer
NewGCPDiscoverer returns a new Google Cloud Platform network discoverer
type DiscovererOption ¶
type DiscovererOption func(o *DiscovererOptions)
DiscovererOption is a function which configures a GenericDiscoverer.
type DiscovererOptions ¶
type DiscovererOptions struct {
// contains filtered or unexported fields
}
DiscovererOptions describes the options used to construct a generic discoverer.