zones: adds ForEachZone iterator
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -40,6 +40,13 @@ func (m *Zones) ForEachMachine(fn func(*Machine)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ForEachZone calls a function for each Zone in the cluster
|
||||||
|
func (m *Zones) ForEachZone(fn func(*Zone)) {
|
||||||
|
for _, p := range m.Zones {
|
||||||
|
fn(p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NewFS builds a [Zones] tree using the given directory
|
// NewFS builds a [Zones] tree using the given directory
|
||||||
func NewFS(dir fs.FS, domain string) (*Zones, error) {
|
func NewFS(dir fs.FS, domain string) (*Zones, error) {
|
||||||
z := &Zones{
|
z := &Zones{
|
||||||
|
|||||||
Reference in New Issue
Block a user