std/net
import "github.com/eugenioenko/goalchemy/std/net"Package net provides the host and port helpers of Go’s net package: JoinHostPort, SplitHostPort and AddrError. Dialing, listening and name resolution are not provided.
JoinHostPort
Section titled “JoinHostPort”func JoinHostPort(host, port string) stringJoinHostPort combines host and port into a network address of the form “host:port”. If host contains a colon, as found in literal IPv6 addresses, then JoinHostPort returns “[host]:port”.
SplitHostPort
Section titled “SplitHostPort”func SplitHostPort(hostport string) (host, port string, err error)SplitHostPort splits a network address of the form “host:port”, “host%zone:port”, “[host]:port” or “[host%zone]:port” into host or host%zone and port. A literal IPv6 address in hostport must be enclosed in square brackets, as in “[::1]:80”, “[::1%lo0]:80”.
type AddrError
Section titled “type AddrError”type AddrError struct { Err string Addr string}AddrError reports an error with an address, as net.AddrError does.
AddrError.Error
Section titled “AddrError.Error”func (e *AddrError) Error() stringAddrError.Temporary
Section titled “AddrError.Temporary”func (e *AddrError) Temporary() boolAddrError.Timeout
Section titled “AddrError.Timeout”func (e *AddrError) Timeout() bool