Documentation
¶
Index ¶
Constants ¶
View Source
const ( LibraryName = "scriptling.net.resolve" LibraryDesc = "DNS resolution utilities for IP lookup, SRV record resolution, and srv+http URL resolution" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Resolver ¶
type Resolver interface {
// LookupIP resolves a hostname to a list of IP address strings.
LookupIP(host string) ([]string, error)
// LookupSRV resolves an SRV service name to a list of TCP addresses.
LookupSRV(service string) ([]*net.TCPAddr, error)
// ResolveSRVHttp resolves a srv+http(s):// URI to a concrete URL,
// preserving the original hostname for SNI/TLS while substituting the SRV-resolved port.
ResolveSRVHttp(uri string) string
}
Resolver defines the interface for DNS resolution. Each consumer must provide its own implementation when calling Register.
func GetResolver ¶
func GetResolver() Resolver
GetResolver returns a snapshot of the current global resolver.
Click to show internal directories.
Click to hide internal directories.