testutils

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortChooser

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

PortChooser does not store any port information. It was created only for API purposes.

func Port

func Port() *PortChooser

Port creates a chaining API structure

func (*PortChooser) Acquire

func (pc *PortChooser) Acquire() int

Acquire applies all filters defined before and returns a port number.

func (*PortChooser) NonRoot

func (pc *PortChooser) NonRoot() *PortChooser

NonRoot enables the non-root port requirement: min port will be 1025 to ensure anything is ok.

func (*PortChooser) Root

func (pc *PortChooser) Root() *PortChooser

Root enables root-only port requirement: max port will be 1024.

func (*PortChooser) Unused

func (pc *PortChooser) Unused() *PortChooser

Unused enables a check that port is free.

func (*PortChooser) Used

func (pc *PortChooser) Used() *PortChooser

Used enables a check that port is not free.

Jump to

Keyboard shortcuts

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