mocks

package
v0.0.0-...-f680a4f Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetDoFunc fetches the mock client's `Do` func
	GetDoFunc func(req *http.Request) (*http.Response, error)
)

Functions

This section is empty.

Types

type GoQuestMock

type GoQuestMock struct {
	mock.Mock
}

GoQuestMock is an autogenerated mock type for the IGoQuest type

func NewGoQuestMock

func NewGoQuestMock(t mockConstructorTestingTNewGoQuestMock) *GoQuestMock

NewGoQuestMock creates a new instance of GoQuestMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*GoQuestMock) AddHeader

func (_m *GoQuestMock) AddHeader(key string, value string) goquest.IGoQuest

AddHeader provides a mock function with given fields: key, value

func (*GoQuestMock) Delete

func (_m *GoQuestMock) Delete(ctx context.Context, endpoint string, option *goquest.RequestOption) (*goquest.Response, error)

Delete provides a mock function with given fields: ctx, endpoint, option

func (*GoQuestMock) Get

func (_m *GoQuestMock) Get(ctx context.Context, endpoint string, option *goquest.RequestOption) (*goquest.Response, error)

Get provides a mock function with given fields: ctx, endpoint, option

func (*GoQuestMock) Patch

func (_m *GoQuestMock) Patch(ctx context.Context, endpoint string, option *goquest.RequestOption) (*goquest.Response, error)

Patch provides a mock function with given fields: ctx, endpoint, option

func (*GoQuestMock) Post

func (_m *GoQuestMock) Post(ctx context.Context, endpoint string, option *goquest.RequestOption) (*goquest.Response, error)

Post provides a mock function with given fields: ctx, endpoint, option

func (*GoQuestMock) Put

func (_m *GoQuestMock) Put(ctx context.Context, endpoint string, option *goquest.RequestOption) (*goquest.Response, error)

Put provides a mock function with given fields: ctx, endpoint, option

func (*GoQuestMock) Send

func (_m *GoQuestMock) Send(ctx context.Context, method string, endpoint string, requestOption *goquest.RequestOption) (*goquest.Response, error)

Send provides a mock function with given fields: ctx, method, endpoint, requestOption

type HttpClientMock

type HttpClientMock struct {
	mock.Mock
}

HttpClientMock is an autogenerated mock type for the IHttpClient type

func NewHttpClientMock

func NewHttpClientMock(t mockConstructorTestingTNewHttpClientMock) *HttpClientMock

NewHttpClientMock creates a new instance of HttpClientMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*HttpClientMock) Do

func (_m *HttpClientMock) Do(req *http.Request) (*http.Response, error)

Do provides a mock function with given fields: req

type MockClient

type MockClient struct {
	DoFunc func(req *http.Request) (*http.Response, error)
}

MockClient is the mock client

func MockResponse

func MockResponse(statusCode int, body string) *MockClient

func MockResponseError

func MockResponseError(statusCode int, body string, err error) *MockClient

func (*MockClient) Do

func (m *MockClient) Do(req *http.Request) (*http.Response, error)

Do is the mock client's `Do` func

type MockReadCloser

type MockReadCloser struct {
	mock.Mock
}

func NewMockReadCloser

func NewMockReadCloser() *MockReadCloser

func (*MockReadCloser) Close

func (m *MockReadCloser) Close() error

func (*MockReadCloser) Read

func (m *MockReadCloser) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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