httptesting

package
v0.0.0-...-9107137 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 6 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

RoundTripFunc .

func BuildJSONRoundTrip

func BuildJSONRoundTrip(payload interface{}) RoundTripFunc

BuildJSONRoundTrip creates a round trip function that return

func (RoundTripFunc) RoundTrip

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

RoundTrip .

Jump to

Keyboard shortcuts

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