httpclient

package
v0.0.0-...-9cf9cea Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TimeoutClientInSeconds = 30

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClientInterface

type HttpClientInterface interface {
	Do(*http.Request) (*http.Response, error)
	Get(url string) (resp *http.Response, err error)
	PostForm(url string, data url.Values) (resp *http.Response, err error)
}

func DefaultClient

func DefaultClient() HttpClientInterface

DefaultClient returns a default HTTP client with a timeout.

type HttpClientMock

type HttpClientMock struct {
	mock.Mock
}

func (*HttpClientMock) Do

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

func (*HttpClientMock) Get

func (h *HttpClientMock) Get(url string) (*http.Response, error)

func (*HttpClientMock) PostForm

func (h *HttpClientMock) PostForm(url string, data url.Values) (*http.Response, error)

Jump to

Keyboard shortcuts

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