xnet

package
v0.4.15 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenLoopback

func ListenLoopback(network string, port uint16) ([]net.Listener, error)

Listen announces on the loopback network address.

The network must be "tcp", "tcp4" or "tcp6".

func LookupLoopbackIP

func LookupLoopbackIP() ([]net.IP, error)

LookupLoopbackIP looks up loopback interfaces on the host using the local resolver. It returns a slice of that host's IPv6 and IPv4 addresses.

Types

type ExternalPublicIPResolver added in v0.4.15

type ExternalPublicIPResolver struct {
	// contains filtered or unexported fields
}

ExternalPublicIPResolver is a helper struct that allows to resolve caller's public IP address.

func NewExternalPublicIPResolver added in v0.4.15

func NewExternalPublicIPResolver(url string) *ExternalPublicIPResolver

NewExternalPublicIPResolver constructs a new external public IP resolver.

An optional "url" argument specifies the server URL, which can give the caller's public IP in a body as a string.

func (*ExternalPublicIPResolver) PublicIP added in v0.4.15

func (m *ExternalPublicIPResolver) PublicIP() (net.IP, error)

Jump to

Keyboard shortcuts

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