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
Click to show internal directories.
Click to hide internal directories.