netutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: AGPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

	FallbackDns netip.AddrPort
)

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 ResolveSOA added in v1.0.0

func ResolveSOA(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host string, network string) (records []string, 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 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, err4, err6 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