rclone: github.com/ncw/rclone/fs/fshttp Index | Files

package fshttp

import "github.com/ncw/rclone/fs/fshttp"

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


Package Files


func NewClient Uses

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

NewClient returns an http.Client with the correct timeouts

func NewDialer Uses

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

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

func NewTransport Uses

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

NewTransport returns an http.RoundTripper with the correct timeouts

func NewTransportCustom Uses

func NewTransportCustom(ci *fs.ConfigInfo, customize func(*http.Transport)) http.RoundTripper

NewTransportCustom returns an http.RoundTripper with the correct timeouts. The customize function is called if set to give the caller an opportunity to customize any defaults in the Transport.

func ResetTransport Uses

func ResetTransport()

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

func StartHTTPTokenBucket Uses

func StartHTTPTokenBucket()

StartHTTPTokenBucket starts the token bucket if necessary

type Transport Uses

type Transport struct {
    // contains filtered or unexported fields

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

func (*Transport) RoundTrip Uses

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

RoundTrip implements the RoundTripper interface.

func (*Transport) SetRequestFilter Uses

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

SetRequestFilter sets a filter to be used on each request

Package fshttp imports 16 packages (graph) and is imported by 38 packages. Updated 2020-08-19. Refresh now. Tools for package owners.