Documentation
¶
Overview ¶
Package hosts defines the HostMapper interface for static host-to-IP mappings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostMapper ¶
type HostMapper interface {
// Lookup resolves a hostname to a list of IP addresses. The boolean
// return value indicates whether a matching mapping was found — if
// false, the caller should fall back to DNS resolution.
Lookup(ctx context.Context, network, host string, opts ...Option) ([]net.IP, bool)
}
HostMapper maps hostnames to IP addresses. It acts as a local hosts file, providing static resolution that overrides DNS for matched hostnames.