refactor(netx): reorganize by topic (#800)
Before finishing the ongoing refactoring and leaving whatever is left of netx in tree, I would like to restructure it so that we'll have an easy time next time we need to modify it. Currently, every functionality lives into the `netx.go` file and we have a support file called `httptransport.go`. I would like to reorganize by topic, instead. This would allow future me to more easily perform topic-specific changes. While there, improve `netx`'s documentation and duplicate some of this documentation inside `internal/README.md` to provide pointers to previous documentation, historical context, and some help to understand the logic architecture of network extensions (aka `netx`). Part of https://github.com/ooni/probe-cli/pull/396
This commit is contained in:
parent
5d54aa9c5f
commit
64bffbd941
17 changed files with 703 additions and 528 deletions
35
internal/engine/netx/config.go
Normal file
35
internal/engine/netx/config.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package netx
|
||||
|
||||
//
|
||||
// Config struct.
|
||||
//
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net/url"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/bytecounter"
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/tracex"
|
||||
)
|
||||
|
||||
// Config contains configuration for creating new transports, dialers, etc. When
|
||||
// any field of Config is nil/empty, we will use a suitable default.
|
||||
type Config struct {
|
||||
BaseResolver model.Resolver // default: system resolver
|
||||
BogonIsError bool // default: bogon is not error
|
||||
ByteCounter *bytecounter.Counter // default: no explicit byte counting
|
||||
CacheResolutions bool // default: no caching
|
||||
ContextByteCounting bool // default: no implicit byte counting
|
||||
DNSCache map[string][]string // default: cache is empty
|
||||
Dialer model.Dialer // default: dialer.DNSDialer
|
||||
FullResolver model.Resolver // default: base resolver + goodies
|
||||
QUICDialer model.QUICDialer // default: quicdialer.DNSDialer
|
||||
HTTP3Enabled bool // default: disabled
|
||||
Logger model.Logger // default: no logging
|
||||
ProxyURL *url.URL // default: no proxy
|
||||
ReadWriteSaver *tracex.Saver // default: not saving I/O events
|
||||
Saver *tracex.Saver // default: not saving non-I/O events
|
||||
TLSConfig *tls.Config // default: attempt using h2
|
||||
TLSDialer model.TLSDialer // default: dialer.TLSDialer
|
||||
}
|
||||
Loading…
Reference in a new issue