connectivity

package
v0.0.0-...-bb564d6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectivityError

type ConnectivityError struct {
	// Which operation in the test that failed: "connect", "send" or "receive"
	Op string
	// The POSIX error, when available
	PosixError string
	// The error observed for the action
	Err error
}

ConnectivityError captures the observed error of the connectivity test.

func TestConnectivityWithResolver

func TestConnectivityWithResolver(ctx context.Context, resolver dns.Resolver, testDomain string) (*ConnectivityError, error)

TestConnectivityWithResolver tests weather we can get a response from the given [Resolver]. It can be used to test connectivity of its underlying [transport.StreamDialer] or [transport.PacketDialer]. Invalid tests that cannot assert connectivity will return (nil, error). Valid tests will return (*ConnectivityError, nil), where *ConnectivityError will be nil if there's connectivity or a structure with details of the error found.

func (*ConnectivityError) Error

func (err *ConnectivityError) Error() string

func (*ConnectivityError) Unwrap

func (err *ConnectivityError) Unwrap() error

Jump to

Keyboard shortcuts

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