httpclient_test

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClientSpy

type HttpClientSpy[T any] struct {
	Results  []*HttpClientSpyResponse[T]
	Requests []*http.Request
}

func NewHttpClientSpy

func NewHttpClientSpy[T any](responses ...*HttpClientSpyResponse[T]) *HttpClientSpy[T]

func (*HttpClientSpy[T]) DoWithContext

func (h *HttpClientSpy[T]) DoWithContext(ctx context.Context, request *http.Request) (T, error)

DoWithContext implements httpclient.HttpClient.

type HttpClientSpyResponse

type HttpClientSpyResponse[T any] struct {
	Response T
	Error    error
}

func NewHttpClientSpyResponse

func NewHttpClientSpyResponse[T any](response T, err error) *HttpClientSpyResponse[T]

Jump to

Keyboard shortcuts

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