util

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

AutoTransport uses h2c for HTTP2 requests and falls back to `http.DefaultTransport` for all others

Functions

func NewHTTPTransport

func NewHTTPTransport(v1 http.RoundTripper, v2 http.RoundTripper) http.RoundTripper

NewHttpTransport will use the appropriate transport for the request's HTTP protocol version

func NewRetryRoundTripper

func NewRetryRoundTripper(rt http.RoundTripper, l *zap.SugaredLogger, b wait.Backoff, conditions ...RetryCond) http.RoundTripper

RetryRoundTripper retries a request on error or retry condition, using the given `retry` strategy

func NewRewinder

func NewRewinder(rc io.ReadCloser) io.ReadCloser

rewinder wraps a single-use `ReadCloser` into a `ReadCloser` that can be read multiple times

func SetupHeaderPruning

func SetupHeaderPruning(p *httputil.ReverseProxy)

SetupHeaderPruning will cause the http.ReverseProxy to not forward activator headers

Types

type RetryCond

type RetryCond func(*http.Response) bool

func RetryStatus

func RetryStatus(status int) RetryCond

RetryStatus will filter responses matching `status`

type RoundTripperFunc

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

func (RoundTripperFunc) RoundTrip

func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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