netutils

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadDnsAns = fmt.Errorf("bad dns answer")

	BootstrapDns = netip.MustParseAddrPort("208.67.222.222:5353")
)

Functions

func ResolveNS

func ResolveNS(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host string, network string) (records []string, err error)

func ResolveNetip

func ResolveNetip(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host string, typ uint16, network string) (addrs []netip.Addr, err error)

func SystemDns

func SystemDns() (dns netip.AddrPort, err error)

func TryUpdateSystemDns

func TryUpdateSystemDns() (err error)

func TryUpdateSystemDnsElapse added in v0.1.6

func TryUpdateSystemDnsElapse(k time.Duration) (err error)

TryUpdateSystemDnsElapse will update system DNS if duration has elapsed since the last TryUpdateSystemDns1s call.

Types

type ContextDialer

type ContextDialer struct {
	Dialer net.Dialer
}

func (*ContextDialer) DialContext

func (d *ContextDialer) DialContext(ctx context.Context, network, addr string) (c net.Conn, err error)

type Ip46

type Ip46 struct {
	Ip4 netip.Addr
	Ip6 netip.Addr
}

func ResolveIp46

func ResolveIp46(ctx context.Context, dialer netproxy.Dialer, dns netip.AddrPort, host string, network string, race bool) (ipv46 *Ip46, err error)

type URL

type URL struct {
	*url.URL
}

func (*URL) Port

func (u *URL) Port() string

Jump to

Keyboard shortcuts

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