package
3.25.0-alpha
Repository: https://github.com/ooni/probe-cli.git
Documentation: pkg.go.dev

# Functions

ClassifyGenericError maps an error occurred during an operation to an OONI failure string.
ClassifyQUICHandshakeError maps errors during a QUIC handshake to OONI failure strings.
ClassifyResolverError maps DNS resolution errors to OONI failure strings.
ClassifyTLSHandshakeError maps an error occurred during the TLS handshake to an OONI failure string.
ClonedTLSConfigOrNewEmptyConfig returns a clone of the provided config, if not nil, or a fresh and completely empty *tls.Config.
ConfigureTLSVersion configures the correct TLS version into a *tls.Config or returns ErrInvalidTLSVersion.
ContextTraceOrDefault retrieves the trace bound to the context or returns a default implementation of the trace in case no tracing was configured.
ContextWithTrace returns a new context that binds to the given trace.
CopyContext is like io.Copy but may terminate earlier when the context expires.
ErrorToGetaddrinfoRetvalOrZero converts an arbitrary error to the return value of getaddrinfo.
HTTPTransportOptionDisableCompression configures the .DisableCompression field, which otherwise is set to true, so that this code is ready for measuring out of the box.
HTTPTransportOptionMaxConnsPerHost configures the .MaxConnPerHosts field, which otherwise uses the default set in github.com/ooni/oohttp.
HTTPTransportOptionProxyURL configures the transport to use the given proxyURL or disables proxying (already the default) if the proxyURL is nil.
HTTPTransportOptionTLSClientConfig configures the .TLSClientConfig field, which otherwise is nil, to imply using the default config.
IsBogon returns whether an IP address is bogon.
IsIPv6 returns true if the given candidate is a valid IP address representation and such representation is IPv6.
IsLoopback returns whether an IP address is loopback.
MaybeNewErrWrapper is like NewErrWrapper except that this function won't panic if passed a nil error.
MaybeTLSConnectionState is a convenience function that returns an empty [tls.ConnectionState] when the [model.TLSConn] is nil.
MaybeWrapWithBogonResolver wraps the given resolver with a BogonResolver iff the provided boolean flag is true.
MaybeWrapWithCachingResolver wraps the provided resolver with a resolver that remembers the result of previous successful resolutions, if the enabled argument is true.
MaybeWrapWithProxyDialer returns the original dialer if the proxyURL is nil and otherwise returns a wrapped dialer that implements proxying.
MaybeWrapWithStaticDNSCache wraps the provided resolver with a resolver that checks the given cache before issuing queries to the underlying DNS resolver.
NewDialerWithStdlibResolver is equivalent to creating a system resolver using NewStdlibResolver and then a dialer using [Netx.NewDialerWithResolver] with the default [Netx] where the resolver argument is the previously created resolver.
NewDNSOverGetaddrinfoTransport creates a new dns-over-getaddrinfo transport.
NewDNSOverHTTPSTransport is like NewUnwrappedDNSOverHTTPSTransport but returns an already wrapped DNSTransport.
NewDNSOverHTTPSTransportWithHTTPTransport is like NewDNSOverHTTPSTransport but takes in input an HTTPTransport rather than an HTTPClient.
NewErrGetaddrinfo creates a new instance of the ErrGetaddrinfo type.
NewErrWrapper creates a new ErrWrapper using the given classifier, operation name, and underlying error.
NewHTTP3ClientWithResolver creates a new HTTP3Transport using the given resolver and then from that builds an HTTPClient.
NewHTTP3Transport creates a new HTTPTransport using http3.
NewHTTPTransportWithResolver creates a new HTTPTransport using http3 that uses the given logger and the given resolver.
NewHTTPClient creates a new, wrapped HTTPClient using the given transport.
NewHTTPClientStdlib creates a new HTTPClient that uses the standard library for TLS and DNS resolutions.
NewHTTPClientWithResolver creates a new HTTPTransport using the given resolver and then from that builds an HTTPClient.
NewHTTPTransport returns a wrapped HTTP transport for HTTP2 and HTTP/1.1 using the given dialer and logger.
NewHTTPTransport is the high-level factory to create a [model.HTTPTransport] using github.com/ooni/oohttp as the HTTP library with HTTP/1.1 and HTTP2 support.
NewHTTPTransportWithResolver creates a new HTTP transport using the stdlib for everything but the given resolver.
NewMaybeShapingDialer takes in input a model.Dialer and returns in output another model.Dialer that MAY dial connections with I/O shaping, depending on whether the user builds with or without the `-tags shaping` CLI flag.
NewMozillaCertPool returns the default x509 certificate pool that we bundle from Mozilla.
NewNullDialer returns a dialer that always fails with ErrNoDialer.
NewNullTLSDialer returns a TLS dialer that always fails with ErrNoTLSDialer.
NewSerialUDPResolver creates a new Resolver using DNS-over-UDP that performs serial A/AAAA lookups during LookupHost.
NewSingleUseDialer returns a "single use" dialer.
NewSingleUseQUICDialer is like NewSingleUseDialer but for QUIC.
NewSingleUseTLSDialer is like NewSingleUseDialer but takes in input a TLSConn rather than a net.Conn.
NewTLSDialer creates a new TLS dialer using the given dialer and handshaker.
NewTLSDialerWithConfig is like NewTLSDialer with an optional config.
NewTopLevelGenericErrWrapper wraps an error occurring at top level using a generic classifier as classifier.
NewUnwrappedDNSOverHTTPSTransport creates a new DNSOverHTTPSTransport instance that has not been wrapped yet.
NewUnwrappedDNSOverHTTPSTransportWithHostOverride creates a new DNSOverHTTPSTransport with the given Host header override.
NewUnwrappedDNSOverTCPTransport creates a new DNSOverTCPTransport that has not been wrapped yet.
NewUnwrappedDNSOverTLSTransport creates a new DNSOverTLS transport that has not been wrapped yet.
NewUnwrappedDNSOverUDPTransport creates a DNSOverUDPTransport instance that has not been wrapped yet.
UnwrappedParallelResolver creates a new ParallelResolver instance.
NewUnwrappedSerialResolver creates a new, and unwrapped, SerialResolver instance.
NewUnwrappedStdlibResolver returns a new, unwrapped resolver using the standard library (i.e., getaddrinfo if possible and &net.Resolver{} otherwise).
NewUTLSConn creates a new connection with the given client hello ID.
ParseUDPAddr maps the string representation of an UDP endpoint to the corresponding *net.UDPAddr representation.
ReadAllContext is like io.ReadAll but reads r in a background goroutine.
StreamAllContext streams from the given reader [r] until interrupted by [ctx] or when [r] hits the EOF.
TLSCipherSuiteString returns the TLS cipher suite as a string.
TLSVersionString returns a TLS version string.
WithCustomTProxy runs the given function with a different UnderlyingNetwork and restores the previous UnderlyingNetwork before returning.
WrapDialer wraps an existing Dialer to add extra functionality such as separting DNS lookup and connecting, error wrapping, logging, etc.
WrapHTTPClient wraps an HTTP client to add error wrapping capabilities.
WrapHTTPTransport creates an HTTPTransport using the given logger and guarantees that returned errors are wrapped.
WrapResolver creates a new resolver that wraps an existing resolver to add these properties: 1.

# Constants

CloseOperation is when we close a socket.
ConnectOperation is the operation where we do a TCP connect.
We use these strings to string-match errors in the standard library and map such errors to OONI failures.
We use these strings to string-match errors in the standard library and map such errors to OONI failures.
DNSRoundTripOperation is the DNS round trip.
We use these strings to string-match errors in the standard library and map such errors to OONI failures.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration provides a canonical name for every system-call error we support.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
FailureUnknown is the prefix used for unknown failures.
This enumeration lists the failures defined at https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md.
HTTPRoundTripOperation is the HTTP round trip.
QUICHandshakeOperation is the handshake to setup a QUIC connection.
QUICListenOperation is when we open a listening UDP conn for QUIC.
ReadFromOperation is when we read from an UDP socket.
ReadOperation is when we read from a socket.
ResolveOperation is the operation where we resolve a domain name.
Name of the resolver we use when we link with libc and use getaddrinfo directly.
Name of the resolver we use when we don't link with libc and use net.Resolver.
Legacy name of the resolver we use when we're don't know whether we're using getaddrinfo, but we're using net.Resolver, and we're splitting the answer in two A and AAAA queries.
TLSHandshakeOperation is the TLS handshake.
TopLevelOperation is used when the failure happens at top level.
UnknownOperation is when we cannot determine the operation.
WriteOperation is when we write to a socket.
WriteToOperation is when we write to an UDP socket.

# Variables

ErrAndroidDNSCacheNoData is the kind of error returned by our getaddrinfo code on Android when we see EAI_NODATA, an error condition that could mean anything as explained in getaddrinfo_linux.go.
ErrDNSBogon indicates that we found a bogon address.
ErrDNSIPAddress indicates that you passed an IP address to a DNS function that only works with domain names.
ErrDNSIsQuery indicates that we were passed a DNS query.
ErrDNSReplyWithWrongQueryID indicates we have got a DNS reply with the wrong queryID.
ErrInvalidIP indicates that a string is not a valid IP.
ErrInvalidTLSVersion indicates that you passed us a string that does not represent a valid TLS version.
ErrNoConnReuse is the type of error returned when you create a "single use" dialer or a "single use" TLS dialer and you dial more than once, which is not supported by such a dialer.
ErrNoDialer is the type of error returned by "null" dialers when you attempt to dial with them.
ErrNoDNSTransport is the error returned when you attempt to perform a DNS operation that requires a custom DNSTransport (e.g., DNSOverHTTPSTransport) but you are using the "stdlib" resolver instead.
ErrNoResolver is the type of error returned by "without resolver" dialer when asked to dial for and endpoint containing a domain name, since they can only dial for endpoints containing IP addresses.
ErrNoTLSDialer is the type of error returned by "null" TLS dialers when you attempt to dial with them.
ErrNotTLSConn occur when an interface accepts a net.Conn but internally needs a TLSConn and you pass a net.Conn that doesn't implement TLSConn to such an interface.
ErrOODNSMisbehaving is the error typically returned by the `netgo`resolver when it cannot really make sense of the error.
ErrOODNSNoAnswer means that we've got a valid DNS response that did not contain any answer for the original query.
ErrOODNSNoSuchHost means NXDOMAIN.
ErrOODNSRefused indicates that the response's Rcode was "refused".
ErrOODNSServfail indicates that the response's Rcode was "servfail".
ErrProxyUnsupportedScheme indicates we don't support the proxy scheme.
ErrUnknown is an error you may want to return when you don't known what exactly happened.
ErrUTLSHandshakePanic indicates that there was panic handshaking when we were using the yawning/utls library for parroting.

# Structs

DefaultTProxy is the default UnderlyingNetwork implementation.
DNSDecoderMiekg uses github.com/miekg/dns to implement the Decoder.
DNSEncoderMiekg uses github.com/miekg/dns to implement the Encoder.
DNSOverHTTPSTransport is a DNS-over-HTTPS DNSTransport.
DNSOverTCPTransport is a DNS-over-{TCP,TLS} DNSTransport.
DNSOverUDPTransport is a DNS-over-UDP DNSTransport.
ErrGetaddrinfo represents a getaddrinfo failure.
ErrWrapper is our error wrapper for Go errors.
MaybeCustomUnderlyingNetwork is a nil-safe [model.UnderlyingNetwork] provider.
NetemUnderlyingNetworkAdapter adapts [netem.UnderlyingNetwork] to [model.UnderlyingNetwork].
Netx allows constructing netxlite data types using a specific [model.UnderlyingNetwork].
NullResolver is a resolver that is not capable of resolving domain names to IP addresses and always returns ErrNoResolver.
ParallelResolver uses a transport and performs a LookupHost operation in a parallel fashion, hence its name.
ResolverShortCircuitIPAddr recognizes when the input hostname is an IP address and returns it immediately to the caller.
SerialResolver uses a transport and performs a LookupHost operation in a serial fashion (query for A first, wait for response, then query for AAAA, and wait for response), hence its name.
UTLSConn implements TLSConn and uses a utls UConn as its underlying connection.

# Type aliases

DialContextFunc is the type of net.Dialer.DialContext.
HTTPTransportOption is an initialization option for [NewHTTPTransport].
The TLSConn alias was originally defined here in [netxlite] and we want to keep it available to other packages for now.