Files
ddns-updater-qdm12-3/pkg/publicip/dns/dns.go
Quentin McGaw 320d91d8e3 change(publicip/dns): use DNS over TLS only
- Fix critical issue #492
- Remove `google` dns provider since it does not support DNS over TLS
2023-06-17 13:57:41 +00:00

33 lines
589 B
Go

package dns
import "time"
type Fetcher struct {
ring ring
timeout time.Duration
}
type ring struct {
// counter is used to get an index in the providers slice
counter *uint32 // uint32 for 32 bit systems atomic operations
providers []Provider
}
func New(options ...Option) (f *Fetcher, err error) {
settings := newDefaultSettings()
for _, option := range options {
err = option(&settings)
if err != nil {
return nil, err
}
}
return &Fetcher{
ring: ring{
counter: new(uint32),
providers: settings.providers,
},
timeout: settings.timeout,
}, nil
}