traceroute

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSError added in v1.0.12

type DNSError struct {
	Host string
	Err  error
}

DNSError is a sentinel wrapper for DNS resolution failures so they can be classified at the HTTP boundary.

func (*DNSError) Error added in v1.0.12

func (e *DNSError) Error() string

func (*DNSError) Unwrap added in v1.0.12

func (e *DNSError) Unwrap() error

type ErrorCode added in v1.0.12

type ErrorCode string

ErrorCode represents a classifiable error code aligned with synthetics-worker APIFailureCode.

const (
	// ErrCodeDNS indicates a DNS resolution failure.
	ErrCodeDNS ErrorCode = "DNS"
	// ErrCodeTimeout indicates the operation timed out.
	ErrCodeTimeout ErrorCode = "TIMEOUT"
	// ErrCodeConnRefused indicates the target actively refused the connection.
	ErrCodeConnRefused ErrorCode = "CONNREFUSED"
	// ErrCodeHostUnreach indicates the target host is unreachable.
	ErrCodeHostUnreach ErrorCode = "HOSTUNREACH"
	// ErrCodeNetUnreach indicates the target network is unreachable.
	ErrCodeNetUnreach ErrorCode = "NETUNREACH"
	// ErrCodeDenied indicates a permission error or unsupported configuration.
	ErrCodeDenied ErrorCode = "DENIED"
	// ErrCodeInvalidRequest indicates bad parameters from the caller.
	ErrCodeInvalidRequest ErrorCode = "INVALID_REQUEST"
	// ErrCodeFailedEncoding indicates a failure to encode the response.
	ErrCodeFailedEncoding ErrorCode = "FAILED_ENCODING"
	// ErrCodeUnknown is the catch-all for unclassified errors.
	ErrCodeUnknown ErrorCode = "UNKNOWN"
)

type ErrorResponse added in v1.0.12

type ErrorResponse struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

ErrorResponse is the JSON body returned on error from the HTTP API.

type InvalidTargetError added in v1.0.12

type InvalidTargetError struct {
	Err error
}

InvalidTargetError represents an invalid target specification (bad port, malformed address).

func (*InvalidTargetError) Error added in v1.0.12

func (e *InvalidTargetError) Error() string

func (*InvalidTargetError) Unwrap added in v1.0.12

func (e *InvalidTargetError) Unwrap() error

type Protocol

type Protocol string

Protocol defines supported network protocols Please define new protocols based on the Keyword from: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"
	// ProtocolUDP is the UDP protocol.
	ProtocolUDP Protocol = "UDP"
	// ProtocolICMP is the ICMP protocol.
	ProtocolICMP Protocol = "ICMP"
)

type TCPMethod

type TCPMethod string

TCPMethod is the method used to run a TCP traceroute.

const (
	// TCPConfigSYN means to only perform SYN traceroutes
	TCPConfigSYN TCPMethod = "syn"
	// TCPConfigSACK means to only perform SACK traceroutes
	TCPConfigSACK TCPMethod = "sack"
	// TCPConfigPreferSACK means to try SACK, and fall back to SYN if the remote doesn't support SACK
	TCPConfigPreferSACK TCPMethod = "prefer_sack"
	// TCPConfigSYNSocket means to use a SYN with TCP socket options to perform the traceroute (windows only)
	TCPConfigSYNSocket TCPMethod = "syn_socket"
)

type Traceroute added in v0.1.32

type Traceroute struct {
	// contains filtered or unexported fields
}

func NewTraceroute added in v0.1.32

func NewTraceroute() *Traceroute

func (Traceroute) RunTraceroute added in v0.1.32

func (t Traceroute) RunTraceroute(ctx context.Context, params TracerouteParams) (*result.Results, error)

type TracerouteError added in v1.0.12

type TracerouteError struct {
	Code    ErrorCode
	Message string
	Err     error
}

TracerouteError is a classified error from a traceroute operation.

func ClassifyError added in v1.0.12

func ClassifyError(err error) *TracerouteError

ClassifyError inspects an error chain and returns a TracerouteError with the appropriate code.

func (*TracerouteError) Error added in v1.0.12

func (e *TracerouteError) Error() string

func (*TracerouteError) Unwrap added in v1.0.12

func (e *TracerouteError) Unwrap() error

type TracerouteParams added in v0.1.32

type TracerouteParams struct {
	Hostname                  string
	Port                      int
	Protocol                  string
	MinTTL                    int
	MaxTTL                    int
	Delay                     int
	Timeout                   time.Duration
	TCPMethod                 TCPMethod
	WantV6                    bool
	TCPSynParisTracerouteMode bool
	ReverseDns                bool
	CollectSourcePublicIP     bool
	TracerouteQueries         int
	E2eQueries                int
	UseWindowsDriver          bool
	SkipPrivateHops           bool
}

Jump to

Keyboard shortcuts

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