Documentation
¶
Index ¶
- Variables
- type PortRange
- type PortRangeSet
- type PortSet
- func (s *PortSet) Add(port uint16)
- func (s *PortSet) AddRange(from, to uint16)
- func (s *PortSet) Contains(port uint16) bool
- func (s *PortSet) Count() (count uint)
- func (s *PortSet) First() uint16
- func (s *PortSet) Parse(portSetString string) error
- func (s *PortSet) RangeCount() (count uint)
- func (s *PortSet) RangeSet() PortRangeSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrZeroPort = errors.New("port number cannot be zero")
Functions ¶
This section is empty.
Types ¶
type PortRangeSet ¶
type PortRangeSet struct {
// contains filtered or unexported fields
}
PortRangeSet is a set of port ranges.
func (PortRangeSet) Contains ¶
func (s PortRangeSet) Contains(port uint16) bool
Contains returns whether the given port is in the set.
type PortSet ¶
type PortSet struct {
// contains filtered or unexported fields
}
PortSet is a bit set for ports.
func (*PortSet) Parse ¶
Parse parses the given string as a comma-separated list of ports and port ranges, and adds them to the set on success, or returns an error.
func (*PortSet) RangeCount ¶
RangeCount returns the number of port ranges in the set.
func (*PortSet) RangeSet ¶
func (s *PortSet) RangeSet() PortRangeSet
RangeSet returns the ports in the set as a port range set.
Click to show internal directories.
Click to hide internal directories.