Documentation ¶
Index ¶
- type PortSpec
- func (s *PortSpec) Intersects(p *PortSpec) bool
- func (s *PortSpec) IsIncluded(port int) bool
- func (s *PortSpec) IsMultiPort() bool
- func (s *PortSpec) Overlaps(p *PortSpec) bool
- func (s *PortSpec) Range() (uint16, uint16)
- func (s *PortSpec) SinglePort() (uint16, error)
- func (s *PortSpec) String() string
- func (s *PortSpec) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PortSpec ¶
type PortSpec struct { Min uint16 `json:"Min,omitempty"` Max uint16 `json:"Max,omitempty"` // contains filtered or unexported fields }
PortSpec is the specification of a port or port range
func NewPortSpec ¶
NewPortSpec creates a new port spec
func NewPortSpecFromString ¶
NewPortSpecFromString creates a new port spec
func (*PortSpec) Intersects ¶
Intersects returns true if the provided port spec intersect with the given one.
func (*PortSpec) IsIncluded ¶
IsIncluded returns trues if a port is within the range of the portspec
func (*PortSpec) IsMultiPort ¶
IsMultiPort returns true if the spec is for multiple ports.
func (*PortSpec) Overlaps ¶
Overlaps returns true if the provided port spec overlaps with the given one.
func (*PortSpec) SinglePort ¶
SinglePort returns the port of a non multi-port spec
Click to show internal directories.
Click to hide internal directories.