Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSinglePort ¶
ConvertToSinglePort converts a string to port.
Types ¶
type PortsList ¶
type PortsList []int64
PortsList holds a list of ports
func ConvertToPortsList ¶
ConvertToPortsList convert a , separated string to a list of port.
func (*PortsList) HasOverlapWithPort ¶
HasOverlapWithPort returns true if the list has one overlap with the given port.
func (*PortsList) HasOverlapWithPortsList ¶
HasOverlapWithPortsList returns true if the list has one overlap with the given ports.
func (*PortsList) HasOverlapWithPortsRanges ¶
func (p *PortsList) HasOverlapWithPortsRanges(portRanges *PortsRangeList) bool
HasOverlapWithPortsRanges returns true if the list has one overlap with the given ranges.
type PortsRange ¶
PortsRange holds a range of ports.
func ConvertToPortsRange ¶
func ConvertToPortsRange(ports string) (*PortsRange, error)
ConvertToPortsRange converts a :-separated string to a min and max port.
func ExtractPortsAndProtocolFromHostService ¶
func ExtractPortsAndProtocolFromHostService(service string) (*PortsRange, string, error)
ExtractPortsAndProtocolFromHostService extracts the port range and the protocol from a host service like tcp/80:100. If the prefix is neither tcp or udp it will return an error.
func (*PortsRange) HasOverlapWithPort ¶
func (p *PortsRange) HasOverlapWithPort(port int64) bool
HasOverlapWithPort returns true if the range overlaps the given port.
func (*PortsRange) HasOverlapWithPortsList ¶
func (p *PortsRange) HasOverlapWithPortsList(ports *PortsList) bool
HasOverlapWithPortsList returns true if the range overlaps one of the given ports.
func (*PortsRange) HasOverlapWithPortsRange ¶
func (p *PortsRange) HasOverlapWithPortsRange(otherRange *PortsRange) bool
HasOverlapWithPortsRange returns true if the range overlaps one of the port ranges.
func (*PortsRange) HasOverlapWithPortsRanges ¶
func (p *PortsRange) HasOverlapWithPortsRanges(otherRanges *PortsRangeList) bool
HasOverlapWithPortsRanges returns true if the range has overlaps with the given ports.