Documentation
¶
Overview ¶
Package sysresolv provides cross-platform functionality to discover DNS resolvers currently used by the system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostGenFunc ¶
type HostGenFunc func() (host string)
HostGenFunc is a function used for generating hostnames to check the system DNS. Implementations must be safe for concurrent use.
type Resolvers ¶
type Resolvers interface {
// Addrs returns the local resolvers' addresses. It must be safe for
// concurrent use.
Addrs() (addrs []string)
// Refresh refreshes the local resolvers' addresses cache. It must be safe
// for concurrent use.
Refresh() (err error)
}
Resolvers helps to work with local resolvers' addresses provided by OS.
func NewSystemResolvers ¶
func NewSystemResolvers(f HostGenFunc) (r Resolvers, err error)
NewSystemResolvers returns a Resolvers instance that uses f to generate fake hosts for checking. If f is nil, a default generator is used.
Click to show internal directories.
Click to hide internal directories.