roundtripper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(client *http.Client, tripper ...RoundTripper) *http.Client

Use appends RoundTripper to the transport layer of a http.Client.

Types

type Func

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

Func transforms a function into a http.RoundTripper.

func (Func) RoundTrip

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

type RoundTripper

type RoundTripper func(next http.RoundTripper) http.RoundTripper

RoundTripper represents an equivalent to a server middleware for a http client.

func Dump

func Dump(logFunc func(a ...interface{})) RoundTripper

Dump creates a round tripper to dump outgoing HTTP requests and incoming responses of a http.Client for analysing purpose.

func Logger

func Logger(logFunc func(*http.Request, *http.Response)) RoundTripper

Log creates a round tripper to log outgoing HTTP requests and incoming responses of a http.Client.

Jump to

Keyboard shortcuts

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