ports

package
v0.0.0-...-8fd811e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListBusyPorts

func ListBusyPorts(protocol string) (mapset.Set, error)

func TryParsePortRanges

func TryParsePortRanges(portRanges []string) (mapset.Set, error)

Types

type PortDistributor

type PortDistributor struct {
	// contains filtered or unexported fields
}

func NewPortDistributor

func NewPortDistributor(allowedPorts mapset.Set) *PortDistributor

func NewPortDistributorForTests

func NewPortDistributorForTests(allowedPorts, tcpPortsPool, udpPortsPool mapset.Set) *PortDistributor

NewPortDistributorForTests is used only for unit-testing.

func (*PortDistributor) GetRandomPort

func (d *PortDistributor) GetRandomPort(protocol string) (int, error)

func (*PortDistributor) IsPortAllowed

func (d *PortDistributor) IsPortAllowed(port int) bool

func (*PortDistributor) IsPortBusy

func (d *PortDistributor) IsPortBusy(protocol string, port int) bool

func (*PortDistributor) Refresh

func (d *PortDistributor) Refresh() error

Jump to

Keyboard shortcuts

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