NewDefaultLookupLib() now returns (Lookup, error).
It also adds a few niceties around resolv.conf, namely:
The lookup libs will now lookup records against all nameservers in a parsed resolv.conf sequentially. The first successful result will be returned. If all nameservers fail the last error will be returned.
Wraps the call to dns.ClientConfigFromFile() in an interface so tests don't have to parse a real resolv.conf
Thanks for this great little library! As a heavy user of SRV records it's nice to not have to reinvent the wheel.
This PR addresses https://github.com/benschw/srv-lb/issues/2, and thus slightly alters the API:
DefaultConfig()
now returns(*Config, error)
NewDefaultLookupLib()
now returns(Lookup, error)
.It also adds a few niceties around
resolv.conf
, namely:resolv.conf
sequentially. The first successful result will be returned. If all nameservers fail the last error will be returned.dns.ClientConfigFromFile()
in an interface so tests don't have to parse a realresolv.conf