util

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileNames

func FileNames(t *testing.T, num int) []string

func HTTPClient

func HTTPClient(t *testing.T) *http.Client

HTTPClient returns a Go http.Client which has a default timeout of 10 seconds, and separate connection pool to the default allowing tests to be properly isolated when running in parallel. The returned client will call CloseIdleConnections on test cleanup.

Types

type FreePort

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

FreePort reserves a network ports, and then frees them when the test is ready to run.

func ReservePorts

func ReservePorts(t *testing.T, count int) *FreePort

func (*FreePort) Free

func (f *FreePort) Free(t *testing.T)

func (*FreePort) Port

func (f *FreePort) Port(t *testing.T, n int) int

Jump to

Keyboard shortcuts

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