transport

package
v0.0.0-...-98b9f36 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDialTimeout when connecting to a backend server.
	DefaultDialTimeout = 30 * time.Second

	// DefaultIdleConnsPerHost the default value set for http.Transport.MaxIdleConnsPerHost.
	DefaultIdleConnsPerHost = 64

	// DefaultIdleConnTimeout is the default value for the the maximum amount of time an idle
	// (keep-alive) connection will remain idle before closing itself.
	DefaultIdleConnTimeout = 90 * time.Second
)

Variables

This section is empty.

Functions

func New

func New(opts ...Option) *http.Transport

New creates a new instance of Transport with the given params

Types

type Option

type Option func(*transport)

Option represents the transport options

func WithDialTimeout

func WithDialTimeout(d time.Duration) Option

WithDialTimeout sets the dial context timeout

func WithIdleConnTimeout

func WithIdleConnTimeout(d time.Duration) Option

WithIdleConnTimeout sets the maximum amount of time an idle (keep-alive) connection will remain idle before closing itself.

func WithInsecureSkipVerify

func WithInsecureSkipVerify(value bool) Option

WithInsecureSkipVerify sets tls config insecure skip verify

func WithResponseHeaderTimeout

func WithResponseHeaderTimeout(d time.Duration) Option

WithResponseHeaderTimeout sets the response header timeout

Jump to

Keyboard shortcuts

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