netutils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func ResolveNS

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

func ResolveNetip

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

func SystemDns

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

func TryUpdateSystemDns

func TryUpdateSystemDns() (err error)

func TryUpdateSystemDns1s

func TryUpdateSystemDns1s() (err error)

TryUpdateSystemDns1s will update system DNS if 1 second 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, tcp bool, 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