netutils

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotATCPListener = errors.New("is not a TCP listener")

Functions

func IPToInt32 added in v0.8.0

func IPToInt32(ip net.IP) uint32

func ListenTCP added in v0.9.2

func ListenTCP(addr *net.TCPAddr) (listener net.Listener, err error)

func MustParseMAC added in v0.8.0

func MustParseMAC(rawMac string) net.HardwareAddr

func RandomPort added in v0.9.0

func RandomPort() (port int, err error)

func Uint32ToIP added in v0.8.0

func Uint32ToIP(i uint32) net.IP

func WrapToManaged added in v0.9.2

func WrapToManaged(listener net.Listener) (net.Listener, error)

Types

type IPPort

type IPPort struct {
	IP   net.IP
	Port int
}

func IPPortFromAddress

func IPPortFromAddress(addr net.Addr) (ipPort *IPPort, err error)

func (IPPort) String

func (i IPPort) String() string

Jump to

Keyboard shortcuts

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