httpclient

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewThrottledTransport added in v0.43.0

func NewThrottledTransport(limitPeriod time.Duration, requestCount int, transportWrap http.RoundTripper) http.RoundTripper

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient interface to define the contract of ALL http client to be used (http package or mocks)

type MockClient added in v0.19.0

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

MockClient is a stub implementation of an http.Client with a custom `Do` method

func (*MockClient) Do added in v0.19.0

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

Do is the mock client's `Do` function that you can customize

type ThrottledTransport added in v0.43.0

type ThrottledTransport struct {
	// contains filtered or unexported fields
}

func (*ThrottledTransport) RoundTrip added in v0.43.0

func (c *ThrottledTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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