resolver

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 3 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resolver defines the Resolver interface for DNS resolution.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid is returned when a resolver is not properly configured.
	ErrInvalid = errors.New("invalid resolver")
)

Functions

This section is empty.

Types

type Option

type Option func(opts *Options)

Option is a functional option for configuring Options.

type Options

type Options struct{}

Options holds the initialization parameters for a Resolver.

type Resolver

type Resolver interface {
	// Resolve returns the IPv4 and IPv6 addresses for the given host.
	// The network parameter should be "ip", "ip4", or "ip6"; the default
	// network "ip" returns both IPv4 and IPv6 addresses.
	Resolve(ctx context.Context, network, host string, opts ...Option) ([]net.IP, error)
}

Resolver resolves hostnames to IP addresses. It is used by the Router to resolve destination addresses before dialing through the proxy chain. Implementations may use standard DNS, DNS-over-HTTPS, or custom resolution logic.

Jump to

Keyboard shortcuts

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