Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinHostPort ¶
JoinHostPort 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".
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address contains a host part, and an optional port part. This struct is designed to be immutable
func NewAddressWithoutPort ¶
Create new address without port
func ParseAddress ¶
Parse address from string
func (*Address) Port ¶
Return the port of address, if does not has a port, return false as second value
func (*Address) PortOrDefault ¶
Return the port of address, if does not has a port, return default port
func (*Address) WithPortIfMissing ¶
If port is missing, return a new Address with port specified; else return original address.
Click to show internal directories.
Click to hide internal directories.