testutils

package
v0.0.0-...-de55299 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDummyResponse

func MakeDummyResponse() *http.Response

MakeDummyResponse returns a dummy http response

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

RoundTripFunc is the function type to use for request verification

func (RoundTripFunc) RoundTrip

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

RoundTrip is the wrapper to use as the http function tester

Jump to

Keyboard shortcuts

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