cleanup(netx): remove subpackages and unnecessary code (#788)
This pull request consists of several small and obvious cleanups in the netx directory. See https://github.com/ooni/probe/issues/2121
This commit is contained in:
parent
9354191b85
commit
1cb820b19d
17 changed files with 201 additions and 815 deletions
|
|
@ -1,39 +0,0 @@
|
|||
// Package httptransport contains HTTP transport extensions.
|
||||
package httptransport
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
// Config contains the configuration required for constructing an HTTP transport
|
||||
type Config struct {
|
||||
Dialer model.Dialer
|
||||
QUICDialer model.QUICDialer
|
||||
TLSDialer model.TLSDialer
|
||||
TLSConfig *tls.Config
|
||||
}
|
||||
|
||||
// NewHTTP3Transport creates a new HTTP3Transport instance.
|
||||
//
|
||||
// Deprecation warning
|
||||
//
|
||||
// New code should use netxlite.NewHTTP3Transport instead.
|
||||
func NewHTTP3Transport(config Config) model.HTTPTransport {
|
||||
// Rationale for using NoLogger here: previously this code did
|
||||
// not use a logger as well, so it's fine to keep it as is.
|
||||
return netxlite.NewHTTP3Transport(model.DiscardLogger,
|
||||
config.QUICDialer, config.TLSConfig)
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewSystemTransport(config Config) model.HTTPTransport {
|
||||
return netxlite.NewOOHTTPBaseTransport(config.Dialer, config.TLSDialer)
|
||||
}
|
||||
Loading…
Reference in a new issue