|
|
|
@ -27,7 +27,7 @@ type ScanOptions struct {
|
|
|
|
|
// the DNS resolver to get PublicAddresses of nodes.
|
|
|
|
|
// Default is true
|
|
|
|
|
func ResolvePublicAddresses(resolve bool) ScanOption { |
|
|
|
|
return func(m *Cluster, opt *ScanOptions) error { |
|
|
|
|
return func(_ *Cluster, opt *ScanOptions) error { |
|
|
|
|
opt.DontResolvePublicAddresses = !resolve |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
@ -36,7 +36,7 @@ func ResolvePublicAddresses(resolve bool) ScanOption {
|
|
|
|
|
// WithLookuper specifies what resolver.Lookuper to use to
|
|
|
|
|
// find public addresses
|
|
|
|
|
func WithLookuper(h resolver.Lookuper) ScanOption { |
|
|
|
|
return func(m *Cluster, opt *ScanOptions) error { |
|
|
|
|
return func(m *Cluster, _ *ScanOptions) error { |
|
|
|
|
if h == nil { |
|
|
|
|
return fs.ErrInvalid |
|
|
|
|
} |
|
|
|
@ -49,7 +49,7 @@ func WithLookuper(h resolver.Lookuper) ScanOption {
|
|
|
|
|
// public addresses. if nil is passed, the [net.Resolver] will be used.
|
|
|
|
|
// The default is using Cloudflare's 1.1.1.1.
|
|
|
|
|
func WithResolver(h resolver.Resolver) ScanOption { |
|
|
|
|
return func(m *Cluster, opt *ScanOptions) error { |
|
|
|
|
return func(m *Cluster, _ *ScanOptions) error { |
|
|
|
|
if h == nil { |
|
|
|
|
h = resolver.SystemResolver(true) |
|
|
|
|
} |
|
|
|
|