netutil

package
v1.4.0-nextgen.202510.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDRContainsIP

func CIDRContainsIP(cidrList []*net.IPNet, ip net.IP) (bool, error)

func IsPrivate

func IsPrivate(ip net.IP) bool

func NetAddr2IP

func NetAddr2IP(addr net.Addr) (net.IP, error)

func ParseCIDRList

func ParseCIDRList(strList []string) ([]*net.IPNet, error)

Types

type DNSDialer

type DNSDialer struct {
	// contains filtered or unexported fields
}

DNSDialer routes DNS lookups to configured name servers and caches lookup results briefly. If no name servers are configured, it falls back to the system resolver and dialer.

func NewDNSDialer

func NewDNSDialer(nameServers []string) *DNSDialer

func (*DNSDialer) DialContext

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

Jump to

Keyboard shortcuts

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