types

package
v0.0.0-...-7b34d14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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 MustExactPort(port uint32) PortRange

func MustPortRange

func MustPortRange(lowest, highest uint32) PortRange

func NewPortRange

func NewPortRange(lowest, highest uint32) (*PortRange, error)

func ParsePortRange

func ParsePortRange(text string) (*PortRange, error)

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

func (PortRange) Empty

func (r PortRange) Empty() bool

func (PortRange) Highest

func (r PortRange) Highest() uint32

func (PortRange) Lowest

func (r PortRange) Lowest() uint32

func (*PortRange) Set

func (r *PortRange) Set(value string) error

func (PortRange) String

func (r PortRange) String() string

func (PortRange) Type

func (PortRange) Type() string

func (*PortRange) UnmarshalText

func (r *PortRange) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL