Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockClient ¶
NewMockClient returns an *http.Client that uses a mocked transport to avoid real http calls. The mocked transport is able to handle multiple responses.
Types ¶
type MockRoundTripper ¶
type MockRoundTripper struct {
Responses []*Response
// contains filtered or unexported fields
}
MockRoundTripper implements http.RoundTripper and returns a pair of an http.Response and error when the RoundTrip method is invoked.
func NewMockRoundTripper ¶
func NewMockRoundTripper(r ...*Response) *MockRoundTripper
NewMockRoundTripper initializes a new RoundTripper with the given list of Response.
Click to show internal directories.
Click to hide internal directories.