resolver

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIPNotFound   = errors.New("couldn't find ip")
	ErrIPVersion    = errors.New("ip version error")
	ErrIPv6Disabled = errors.New("ipv6 disabled")
)

Functions

func ResolveIP

func ResolveIP(host string) (net.IP, error)

func ResolveIPv4

func ResolveIPv4(host string) (net.IP, error)

ResolveIPv4 with a host, return ipv4

func ResolveIPv6

func ResolveIPv6(host string) (net.IP, error)

ResolveIPv6 with a host, return ipv6

Types

type Resolver

type Resolver interface {
	ResolveIP(host string) (ip net.IP, err error)
	ResolveIPv4(host string) (ip net.IP, err error)
	ResolveIPv6(host string) (ip net.IP, err error)
}
var (
	// DefaultResolver aim to resolve ip
	DefaultResolver Resolver

	// DisableIPv6 means don't resolve ipv6 host
	// default value is true
	DisableIPv6 = true
)

Jump to

Keyboard shortcuts

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