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 ¶
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 ¶
func ResetTransport()
ResetTransport resets the existing transport, allowing it to take new settings. Should only be used for testing.
Types ¶
type Dialer ¶
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 ¶
type Metrics struct {
StatusCode *prometheus.CounterVec
}
Metrics provide Transport HTTP level metrics.
func NewMetrics ¶
NewMetrics creates a new metrics instance, the instance shall be assigned to DefaultMetrics before any processing takes place.
func (*Metrics) Collectors ¶
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