Documentation ¶
Index ¶
Constants ¶
const ( MinPort uint32 = 1 MaxPort uint32 = 65535 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PortRange ¶
type PortRange struct {
// contains filtered or unexported fields
}
PortRange reprensents a closed interval of TCP ports constrained by the Lowest and the Highest limits.
E.g., PortRange{8080, 8080} is a range consisting of a single port 8080, PortRange{8080, 8081} is a range consisting of 2 ports: 8080 and 8081, PortRange{0, 0} is an empty range (which is as a convenient way to indicate that no TCP port is necessary).
func MustExactPort ¶
func MustPortRange ¶
func NewPortRange ¶
func ParsePortRange ¶
ParsePortRange parses a string representation of the PortRange.
Valid values include: "8080" - represents a PortRange{8080, 8080} "8080-8081" - represents a PortRange{8080, 8081} "8080-" - represents a PortRange{8080, 65535} "-8080" - represents a PortRange{1, 8080} "" - represents an empty port range "-" - represents an empty port range