testhelpers

package
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMockServer

func CreateMockServer(t *testing.T, contentType, responseBody string, responseStatus int) *httptest.Server

Types

type MockBodyWithReadError

type MockBodyWithReadError struct{}

func (*MockBodyWithReadError) Close

func (b *MockBodyWithReadError) Close() error

func (*MockBodyWithReadError) Read

func (b *MockBodyWithReadError) Read(p []byte) (n int, err error)

type MockTransportWithReadError

type MockTransportWithReadError struct{}

MockTransportWithReadError is a custom transport to simulate an error during reading

func (*MockTransportWithReadError) RoundTrip

func (t *MockTransportWithReadError) 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