net

package
v1.0.56 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDialTimeout = 30 * time.Second

Variables

View Source
var DefaultClient *http.Client
View Source
var DefaultDNSServers = []string{
	"ns0.agentuity.com:53",
	"ns1.agentuity.com:53",
	"ns2.agentuity.com:53",
}

Functions

This section is empty.

Types

type DialOption

type DialOption func(*dialerOptions)

func WithDNS

func WithDNS(dnsServers ...string) DialOption

WithDNS sets the DNS servers to use for the dialer instead of the default ones.

type Dialer

type Dialer struct {
	Timeout       time.Duration
	Deadline      time.Time
	LocalAddr     net.Addr
	DualStack     bool
	FallbackDelay time.Duration
	KeepAlive     time.Duration
	Control       func(network, address string, c syscall.RawConn) error
	// contains filtered or unexported fields
}
var DefaultDialer *Dialer

func New

func New(opts ...DialOption) (*Dialer, error)

func (*Dialer) Dial

func (d *Dialer) Dial(network, address string) (net.Conn, error)

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

Jump to

Keyboard shortcuts

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