resolver

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBlocked indicates that the resolved IP is blocked in the blocklist.
	ErrBlocked = errors.New("ip is blocked")
	// ErrNotIPv4Address indicates that the resolved IP address is not IPv4.
	ErrNotIPv4Address = errors.New("not ipv4 address")
	// ErrInvalidPort indicates that the port number in the address is invalid.
	ErrInvalidPort = errors.New("invalid port number")
)

Functions

func Resolve

func Resolve(ctx context.Context, hostport string, timeout time.Duration, bl *blocklist.Blocklist) (net.IP, int, error)

Resolve `hostport` to an IPv4 address.

func ResolveIPv4

func ResolveIPv4(ctx context.Context, timeout time.Duration, host string) (net.IP, error)

ResolveIPv4 resolves `host` to and IPv4 address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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