rt

package
v0.0.0-...-b694cab Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoundTrippers

func RoundTrippers(base http.RoundTripper, parents ...RoundTripper) http.RoundTripper

RoundTrippers will collect many RoundTripper interfaces and return one that contains them all.

Types

type Debugger

type Debugger struct {
	http.RoundTripper
	SkipBody bool
	// contains filtered or unexported fields
}

Debugger is a RoundTripper that prints debug info about http requests and responses.

func (*Debugger) RoundTrip

func (d *Debugger) RoundTrip(req *http.Request) (*http.Response, error)

func (*Debugger) Unwrap

func (d *Debugger) Unwrap() http.RoundTripper

func (*Debugger) Wrap

func (d *Debugger) Wrap(rt http.RoundTripper) RoundTripper

type HttpMock

type HttpMock struct {
	// contains filtered or unexported fields
}

func (*HttpMock) Inject

func (m *HttpMock) Inject(client *http.Client)

func (*HttpMock) RoundTrip

func (m *HttpMock) RoundTrip(req *http.Request) (*http.Response, error)

func (*HttpMock) Unwrap

func (m *HttpMock) Unwrap() http.RoundTripper

func (*HttpMock) Wrap

func (m *HttpMock) Wrap(rt http.RoundTripper) RoundTripper

type RoundTripper

type RoundTripper interface {
	http.RoundTripper
	Wrap(http.RoundTripper) RoundTripper
	Unwrap() http.RoundTripper
}

type RoundTripperFunc

type RoundTripperFunc func(*http.Request) (*http.Response, error)

func (RoundTripperFunc) RoundTrip

func (fn RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)

type UserAgent

type UserAgent struct {
	UserAgent string
	// contains filtered or unexported fields
}

func NewUserAgent

func NewUserAgent(ua string) *UserAgent

func (*UserAgent) RoundTrip

func (uat *UserAgent) RoundTrip(req *http.Request) (*http.Response, error)

func (*UserAgent) Unwrap

func (uat *UserAgent) Unwrap() http.RoundTripper

func (*UserAgent) Wrap

func (uat *UserAgent) Wrap(rt http.RoundTripper) RoundTripper

Jump to

Keyboard shortcuts

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