httptransport

package
v3.15.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package httptransport contains HTTP transport extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTP3Transport

func NewHTTP3Transport(config Config) model.HTTPTransport

NewHTTP3Transport creates a new HTTP3Transport instance.

Deprecation warning

New code should use netxlite.NewHTTP3Transport instead.

func NewSystemTransport

func NewSystemTransport(config Config) model.HTTPTransport

NewSystemTransport creates a new "system" HTTP transport. That is a transport using the Go standard library with custom dialer and TLS dialer.

Deprecation warning

New code should use netxlite.NewHTTPTransport instead.

Types

type ByteCountingTransport

type ByteCountingTransport struct {
	model.HTTPTransport
	Counter *bytecounter.Counter
}

ByteCountingTransport is a RoundTripper that counts bytes.

func (ByteCountingTransport) RoundTrip

func (txp ByteCountingTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements RoundTripper.RoundTrip

type Config

type Config struct {
	Dialer     model.Dialer
	QUICDialer model.QUICDialer
	TLSDialer  model.TLSDialer
	TLSConfig  *tls.Config
}

Config contains the configuration required for constructing an HTTP transport

type NoLogger added in v3.13.0

type NoLogger struct{}

func (*NoLogger) Debug added in v3.13.0

func (*NoLogger) Debug(message string)

func (*NoLogger) Debugf added in v3.13.0

func (*NoLogger) Debugf(format string, v ...interface{})

type SaverBodyHTTPTransport

type SaverBodyHTTPTransport struct {
	model.HTTPTransport
	Saver        *trace.Saver
	SnapshotSize int
}

SaverBodyHTTPTransport is a RoundTripper that saves body events occurring during the round trip

func (SaverBodyHTTPTransport) RoundTrip

func (txp SaverBodyHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements RoundTripper.RoundTrip

type SaverMetadataHTTPTransport

type SaverMetadataHTTPTransport struct {
	model.HTTPTransport
	Saver *trace.Saver
}

SaverMetadataHTTPTransport is a RoundTripper that saves events related to HTTP request and response metadata

func (SaverMetadataHTTPTransport) CloneHeaders added in v3.13.0

func (txp SaverMetadataHTTPTransport) CloneHeaders(req *http.Request) http.Header

CloneHeaders returns a clone of the headers where we have also set the host header, which normally is not set by golang until it serializes the request itself.

func (SaverMetadataHTTPTransport) RoundTrip

func (txp SaverMetadataHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements RoundTripper.RoundTrip

type SaverTransactionHTTPTransport

type SaverTransactionHTTPTransport struct {
	model.HTTPTransport
	Saver *trace.Saver
}

SaverTransactionHTTPTransport is a RoundTripper that saves events related to the HTTP transaction

func (SaverTransactionHTTPTransport) RoundTrip

func (txp SaverTransactionHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements RoundTripper.RoundTrip

type SystemTransportWrapper added in v3.14.0

type SystemTransportWrapper struct {
	*http.Transport
}

SystemTransportWrapper adapts *http.Transport to have the .Network method

func (*SystemTransportWrapper) Network added in v3.14.0

func (txp *SystemTransportWrapper) Network() string

Jump to

Keyboard shortcuts

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