mock

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeResponse

type FakeResponse struct {
	StatusCodeProperty int
	BodyProperty       []byte
	StatusProperty     string
	HeaderProperty     http.Header
	CookiesProperty    []*http.Cookie
}

FakeResponse is a fake http.Response

func (*FakeResponse) Body

func (m *FakeResponse) Body() []byte

Body returns the body of the response

func (*FakeResponse) Cookies

func (m *FakeResponse) Cookies() []*http.Cookie

Cookies returns cookies

func (*FakeResponse) Header

func (m *FakeResponse) Header() http.Header

Header returns the http.Header

func (*FakeResponse) Status

func (m *FakeResponse) Status() string

Status returns the response status

func (*FakeResponse) StatusCode

func (m *FakeResponse) StatusCode() int

StatusCode returns the StatusCodeProperty

type HTTPClient

type HTTPClient struct {
	mock.Mock
}

HTTPClient is a mock of http.Client

func (*HTTPClient) Delete

func (m *HTTPClient) Delete(url string, body interface{}, header map[string]string) (httpClient.Response, error)

Delete is a mocking a method

func (*HTTPClient) Get

func (m *HTTPClient) Get(url string, query interface{}, header map[string]string) (httpClient.Response, error)

Get is a mocking a method

func (*HTTPClient) Patch

func (m *HTTPClient) Patch(url string, body interface{}, header map[string]string) (httpClient.Response, error)

Patch is a mocking a method

func (*HTTPClient) Post

func (m *HTTPClient) Post(url string, body interface{}, header map[string]string) (httpClient.Response, error)

Post is a mocking a method

func (*HTTPClient) Put

func (m *HTTPClient) Put(url string, body interface{}, header map[string]string) (httpClient.Response, error)

Put is a mocking a method

func (*HTTPClient) Request

func (m *HTTPClient) Request(method, url string, body interface{}, header map[string]string) (httpClient.Response, error)

Request is a mocking a method

Jump to

Keyboard shortcuts

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