netutil

package
v0.0.0-...-4402e7d Latest Latest
Warning

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

Go to latest
Published: May 27, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostIPDependency

func HostIPDependency(slot *net.IP) daemon.DependencySlot

func NormalizeHostPort

func NormalizeHostPort(hostPort string, network string, emptyHostOk bool) (string, error)

Check that a "host:port" string looks reasonable, and resolve the port. network is a go net pkg network type identifier.

func SplitHostPort

func SplitHostPort(hostPort string, network string, emptyHostOk bool) (string, int, error)

Check that a "host:port" string looks reasonable, and split it into and host and port, resolving the port. network is a go net pkg network type identifier.

Types

type IPPort

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

IPPort is opaque, to allow a representation that works as a map key

func NewIPPort

func NewIPPort(ip net.IP, port int) IPPort

func ParseIPPort

func ParseIPPort(addrPort string) (IPPort, error)

Check that a string can be parsed as "ipaddress:port", and return the IPPort made from those parts if so.

func ParseIPPortPtr

func ParseIPPortPtr(addrPort string) *IPPort

For use in testing

func (IPPort) Equal

func (a IPPort) Equal(b IPPort) bool

func (IPPort) IP

func (ipPort IPPort) IP() net.IP

func (IPPort) LessThan

func (a IPPort) LessThan(b IPPort) bool

func (IPPort) MarshalText

func (ipPort IPPort) MarshalText() ([]byte, error)

func (IPPort) Port

func (ipPort IPPort) Port() int

func (IPPort) String

func (ipPort IPPort) String() string

func (*IPPort) TCPAddr

func (ipPort *IPPort) TCPAddr() *net.TCPAddr

func (*IPPort) UnmarshalText

func (ipPort *IPPort) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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