utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HackableRoundTripper

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

HackableRoundTripper is a round tripper that allows for interceptor injection.

func NewHackableRoundTripper

func NewHackableRoundTripper(inner http.RoundTripper) *HackableRoundTripper

func (*HackableRoundTripper) RoundTrip

func (h *HackableRoundTripper) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip implements http.RoundTripper.

func (*HackableRoundTripper) SetInterceptor

func (h *HackableRoundTripper) SetInterceptor(rt http.RoundTripper)

SetInterceptor sets an interceptor, requests are directed to the interceptor instead of the inner round tripper. If interceptor RoundTrip returns nil for both response and error the process falls back to inner round tripper.

Jump to

Keyboard shortcuts

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