httpmock

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package httpmock provides stretchr/testify/mock integration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseIdler

type CloseIdler struct {
	RoundTripper
}

CloseIdler is a mocked httpaux.CloseIdler that also mocks http.RoundTripper

func (*CloseIdler) CloseIdleConnections

func (m *CloseIdler) CloseIdleConnections()

CloseIdleConnections implements httpaux.CloseIdler and is driven by this mock's expectations

func (*CloseIdler) OnCloseIdleConnections

func (m *CloseIdler) OnCloseIdleConnections() *mock.Call

OnCloseIdleConnections starts a fluent chain for defining a CloseIdleConnections expectation

type RoundTripCall

type RoundTripCall struct {
	*mock.Call
}

RoundTripCall is syntactic sugar around a RoundTrip *mock.Call

func (RoundTripCall) Return

func (rtc RoundTripCall) Return(r *http.Response, err error) RoundTripCall

Return establishes the return values for this RoundTrip invocation

type RoundTripper

type RoundTripper struct {
	mock.Mock
}

RoundTripper is a mocked http.RoundTripper

func (*RoundTripper) OnRoundTrip

func (m *RoundTripper) OnRoundTrip(expected interface{}) RoundTripCall

OnRoundTrip starts a *mock.Call fluent chain to define an expectation

func (*RoundTripper) RoundTrip

func (m *RoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper and is driven by the mock's expectations

Jump to

Keyboard shortcuts

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