Documentation ¶
Overview ¶
Package net contains network-related helpers for integration testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePort ¶
GeneratePort takes the address in the string provided and updates the port to one that is open. Returns the complete address, the chosen port, and the error, if any.
func GetAvailablePort ¶
GetAvailablePort retrieves an available port on the host machine. This delegates the port selection to the golang net library by starting a server and then checking the port that the server is using.
func MaybeGeneratePort ¶
MaybeGeneratePort takes an address and generates a new version of that address with the port replaced with an open port if the original port was 0. Otherwise, the address is returned unchanged. This method returns the potentially updated address, the potentially updated port, a boolean indicating if the address was changed, and an error in case the method failed
Types ¶
This section is empty.