fshttp

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package fshttp contains the common http parts of the config, Transport and Client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ci *fs.ConfigInfo) *http.Client

NewClient returns an http.Client with the correct timeouts

func NewDialer

func NewDialer(ci *fs.ConfigInfo) *net.Dialer

NewDialer creates a net.Dialer structure with Timeout, Keepalive and LocalAddr set from rclone flags.

func NewTransport

func NewTransport(ci *fs.ConfigInfo) http.RoundTripper

NewTransport returns an http.RoundTripper with the correct timeouts

func ResetTransport added in v1.48.0

func ResetTransport()

ResetTransport resets the existing transport, allowing it to take new settings. Should only be used for testing.

func StartHTTPTokenBucket

func StartHTTPTokenBucket()

StartHTTPTokenBucket starts the token bucket if necessary

Types

type Transport

type Transport struct {
	*http.Transport
	// contains filtered or unexported fields
}

Transport is a our http Transport which wraps an http.Transport * Sets the User Agent * Does logging

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip implements the RoundTripper interface.

func (*Transport) SetRequestFilter

func (t *Transport) SetRequestFilter(f func(req *http.Request))

SetRequestFilter sets a filter to be used on each request

Jump to

Keyboard shortcuts

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