Documentation ¶
Overview ¶
Package fshttp contains the common http parts of the config, Transport and Client
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultMetrics = (*Metrics)(nil)
DefaultMetrics specifies metrics used for new Transports.
Functions ¶
func NewTransport ¶
func NewTransport(ctx context.Context) http.RoundTripper
NewTransport returns an http.RoundTripper with the correct timeouts
func NewTransportCustom ¶ added in v1.6.1
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 ¶ added in v1.6.1
func ResetTransport()
ResetTransport resets the existing transport, allowing it to take new settings. Should only be used for testing.
Types ¶
type Dialer ¶ added in v1.55.0
Dialer structure contains default dialer and timeout, tclass support
func NewDialer ¶
NewDialer creates a Dialer structure with Timeout, Keepalive, LocalAddr and DSCP set from rclone flags.
type Metrics ¶ added in v1.57.1
type Metrics struct {
StatusCode *prometheus.CounterVec
}
Metrics provide Transport HTTP level metrics.
func NewMetrics ¶ added in v1.57.1
NewMetrics creates a new metrics instance, the instance shall be assigned to DefaultMetrics before any processing takes place.
func (*Metrics) Collectors ¶ added in v1.57.1
func (m *Metrics) Collectors() []prometheus.Collector
Collectors returns all prometheus metrics as collectors for registration.
type Transport ¶
Transport is our http Transport which wraps an http.Transport * Sets the User Agent * Does logging * Updates metrics
func (*Transport) SetRequestFilter ¶
SetRequestFilter sets a filter to be used on each request