|
|
|
@ -53,6 +53,24 @@ func (m *Zones) ForEachZone(fn func(*Zone) bool) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GetMachineByName looks for a machine with the specified
|
|
|
|
|
// name on any zone
|
|
|
|
|
func (m *Zones) GetMachineByName(name string) (*Machine, bool) { |
|
|
|
|
var out *Machine |
|
|
|
|
|
|
|
|
|
if name != "" { |
|
|
|
|
m.ForEachMachine(func(p *Machine) bool { |
|
|
|
|
if p.Name == name { |
|
|
|
|
out = p |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return out != nil |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return out, out != nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// NewFS builds a [Zones] tree using the given directory
|
|
|
|
|
func NewFS(dir fs.FS, domain string) (*Zones, error) { |
|
|
|
|
lockuper := resolver.NewCloudflareLookuper() |
|
|
|
|