test

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestClient

func NewTestClient(fn RoundTripFunc) *http.Client

NewTestClient returns *http.Client with Transport replaced to avoid making real calls

Types

type RoundTripFunc

type RoundTripFunc func(req *http.Request) (*http.Response, error)

func (RoundTripFunc) RoundTrip

func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip .

type TestReadCloser

type TestReadCloser struct {
	ReadError  error
	CloseError error
}

func (*TestReadCloser) Close

func (r *TestReadCloser) Close() error

func (*TestReadCloser) Read

func (r *TestReadCloser) Read(p []byte) (n int, err error)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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