probe

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package probe provides utilities for checking the internet connectivity of TCP and UDP clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPProbe

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

TCPProbe tests the connectivity of a TCP client by sending an HTTP GET request to the configured endpoint. The response status code must be 204 No Content.

func (TCPProbe) Probe

func (p TCPProbe) Probe(ctx context.Context, client netio.StreamClient) error

Probe runs the connectivity test.

type TCPProbeConfig

type TCPProbeConfig struct {
	// Addr is the address of the HTTP test endpoint.
	Addr conn.Addr

	// EscapedPath is the escaped URL path of the HTTP test endpoint.
	EscapedPath string

	// Host specifies the value of the Host header field in the HTTP request.
	Host string
}

TCPProbeConfig is the configuration for a TCP probe.

func (TCPProbeConfig) NewProbe

func (c TCPProbeConfig) NewProbe() TCPProbe

NewProbe creates a new TCP probe from the configuration.

type UDPProbe

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

UDPProbe tests the connectivity of a UDP client by sending a DNS query to the configured server. The DNS server must support the HTTPS RR type and return a response indicating success.

func (UDPProbe) Probe

func (p UDPProbe) Probe(ctx context.Context, client zerocopy.UDPClient) error

Probe runs the connectivity test.

type UDPProbeConfig

type UDPProbeConfig struct {
	// Addr is the address of the UDP DNS server.
	Addr conn.Addr

	// Logger is the logger to use for the probe.
	Logger *zap.Logger
}

UDPProbeConfig is the configuration for a UDP probe.

func (UDPProbeConfig) NewProbe

func (c UDPProbeConfig) NewProbe() UDPProbe

NewProbe creates a new UDP probe from the configuration.

Jump to

Keyboard shortcuts

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