testing

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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
}

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{}

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

	// Response to non-probe requests
	RequestResponse *FakeResponse
	// 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