dialer

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &net.Dialer{}

Used by wrappers of standard library network types.

Functions

This section is empty.

Types

type T

type T interface {
	Dial(_ context.Context, addr string) (net.Conn, error)
	DialerNetwork() string
}

Dialers have the network locked in.

type WithContext

type WithContext interface {
	DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}

An interface to ease wrapping dialers that explicitly include a network parameter.

type WithNetwork

type WithNetwork struct {
	Network string
	Dialer  WithContext
}

Adapts a WithContext to the Dial interface in this package.

func (WithNetwork) Dial

func (me WithNetwork) Dial(ctx context.Context, addr string) (_ net.Conn, err error)

func (WithNetwork) DialerNetwork

func (me WithNetwork) DialerNetwork() string

Jump to

Keyboard shortcuts

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