|
|
|
@ -12,7 +12,22 @@ import (
|
|
|
|
|
type ScanOption func(*Zones, *ScanOptions) error |
|
|
|
|
|
|
|
|
|
// ScanOptions contains flags used by the initial scan
|
|
|
|
|
type ScanOptions struct{} |
|
|
|
|
type ScanOptions struct { |
|
|
|
|
// DontResolvePublicAddresses indicates we shouldn't
|
|
|
|
|
// pre-populate Machine.PublicAddresses during the
|
|
|
|
|
// initial scan
|
|
|
|
|
DontResolvePublicAddresses bool |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// ResolvePublicAddresses instructs the scanner to use
|
|
|
|
|
// the DNS resolver to get PublicAddresses of nodes.
|
|
|
|
|
// Default is true
|
|
|
|
|
func ResolvePublicAddresses(resolve bool) ScanOption { |
|
|
|
|
return func(m *Zones, opt *ScanOptions) error { |
|
|
|
|
opt.DontResolvePublicAddresses = !resolve |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WithLookuper specifies what resolver.Lookuper to use to
|
|
|
|
|
// find public addresses
|
|
|
|
|