testing

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeResponse added in v0.7.0

type FakeResponse struct {
	Err   error
	Code  int
	Body  string
	Delay time.Duration
}

FakeResponse is a response given by the FakeRoundTripper

type FakeRoundTripper added in v0.7.0

type FakeRoundTripper struct {
	// Return an error if host header does not match this
	ExpectHost string

	// LockerCh blocks responses being sent until a struct is written to the channel
	LockerCh chan struct{}

	// ProbeHostResponses are popped when a probe request is made to a given host. If
	// no host is matched then this falls back to the behavior or ProbeResponses
	ProbeHostResponses map[string][]FakeResponse

	// Responses to probe requests are popped from this list until it is size 1 then
	// that response is returned indefinitely
	ProbeResponses []FakeResponse

	// Response to non-probe requests
	RequestResponse *FakeResponse

	NumProbes atomic.Int32
	// contains filtered or unexported fields
}

FakeRoundTripper is a roundtripper emulator useful in testing

func (*FakeRoundTripper) RT added in v0.7.0

func (rt *FakeRoundTripper) RT(req *http.Request) (*http.Response, error)

RT is a RoundTripperFunc

Jump to

Keyboard shortcuts

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