refactor: merge dnsx and errorsx into netxlite (#517)
When preparing a tutorial for netxlite, I figured it is easier to tell people "hey, this is the package you should use for all low-level networking stuff" rather than introducing people to a set of packages working together where some piece of functionality is here and some other piece is there. Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
de130d249c
commit
6d3a4f1db8
169 changed files with 575 additions and 671 deletions
45
internal/netxlite/operations.go
Normal file
45
internal/netxlite/operations.go
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package netxlite
|
||||
|
||||
// Operations that we measure. They are the possibly values of
|
||||
// the ErrWrapper.Operation field.
|
||||
const (
|
||||
// ResolveOperation is the operation where we resolve a domain name.
|
||||
ResolveOperation = "resolve"
|
||||
|
||||
// ConnectOperation is the operation where we do a TCP connect.
|
||||
ConnectOperation = "connect"
|
||||
|
||||
// TLSHandshakeOperation is the TLS handshake.
|
||||
TLSHandshakeOperation = "tls_handshake"
|
||||
|
||||
// QUICHandshakeOperation is the handshake to setup a QUIC connection.
|
||||
QUICHandshakeOperation = "quic_handshake"
|
||||
|
||||
// QUICListenOperation is when we open a listening UDP conn for QUIC.
|
||||
QUICListenOperation = "quic_listen"
|
||||
|
||||
// HTTPRoundTripOperation is the HTTP round trip.
|
||||
HTTPRoundTripOperation = "http_round_trip"
|
||||
|
||||
// CloseOperation is when we close a socket.
|
||||
CloseOperation = "close"
|
||||
|
||||
// ReadOperation is when we read from a socket.
|
||||
ReadOperation = "read"
|
||||
|
||||
// WriteOperation is when we write to a socket.
|
||||
WriteOperation = "write"
|
||||
|
||||
// ReadFromOperation is when we read from an UDP socket.
|
||||
ReadFromOperation = "read_from"
|
||||
|
||||
// WriteToOperation is when we write to an UDP socket.
|
||||
WriteToOperation = "write_to"
|
||||
|
||||
// UnknownOperation is when we cannot determine the operation.
|
||||
UnknownOperation = "unknown"
|
||||
|
||||
// TopLevelOperation is used when the failure happens at top level. This
|
||||
// happens for example with urlgetter with a cancelled context.
|
||||
TopLevelOperation = "top_level"
|
||||
)
|
||||
Loading…
Reference in a new issue