Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortPortRanges ¶
func SortPortRanges(portRanges []PortRange)
SortPortRanges sorts the given ports, first by protocol, then by number.
Types ¶
type Port ¶
Port identifies a network port number for a particular protocol.
NOTE(dimitern): This is deprecated and should be removed, use PortRange instead. There are a few places which still use Port, especially in apiserver/params, so it can't be removed yet.
type PortRange ¶
PortRange represents a single range of ports.
func CollapsePorts ¶
CollapsePorts collapses a slice of ports into port ranges.
NOTE(dimitern): This is deprecated and should be removed when possible. It still exists, because in a few places slices of Ports are converted to PortRanges internally.
func CombinePortRanges ¶
CombinePortRanges groups together all port ranges according to protocol, and then combines then into contiguous port ranges. NOTE: Juju only allows its model to contain non-overlapping port ranges. This method operates on that assumption.
func MustParsePortRange ¶
MustParsePortRange converts a raw port-range string into a PortRange. If the string is invalid, the function panics.
func ParsePortRange ¶
ParsePortRange builds a PortRange from the provided string. If the string does not include a protocol then "tcp" is used. Validate() gets called on the result before returning. If validation fails the invalid PortRange is still returned. Example strings: "80/tcp", "443", "12345-12349/udp", "icmp".
func (PortRange) ConflictsWith ¶
ConflictsWith determines if the two port ranges conflict.