mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* Drop thanos-io/thanos and ugprade a few modules Signed-off-by: Zach Leslie <[email protected]> * Update changelog Signed-off-by: Zach Leslie <[email protected]> * Update serverless vendor Signed-off-by: Zach Leslie <[email protected]> * Update changelog Signed-off-by: Zach Leslie <[email protected]> Signed-off-by: Zach Leslie <[email protected]>
27 lines
585 B
Go
27 lines
585 B
Go
// Provenance-includes-location: https://github.com/thanos-io/thanos/blob/main/pkg/discovery/dns/godns/resolver.go
|
|
// Provenance-includes-license: Apache-2.0
|
|
// Provenance-includes-copyright: The Thanos Authors.
|
|
|
|
package godns
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// Resolver is a wrapper for net.Resolver.
|
|
type Resolver struct {
|
|
*net.Resolver
|
|
}
|
|
|
|
// IsNotFound checkout if DNS record is not found.
|
|
func (r *Resolver) IsNotFound(err error) bool {
|
|
if err == nil {
|
|
return false
|
|
}
|
|
err = errors.Cause(err)
|
|
dnsErr, ok := err.(*net.DNSError)
|
|
return ok && dnsErr.IsNotFound
|
|
}
|