Browse Source

zones: adds ForEachZone iterator

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/1/head
Alejandro Mery 10 months ago
parent
commit
979324f151
  1. 7
      pkg/zones/zones.go

7
pkg/zones/zones.go

@ -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
func NewFS(dir fs.FS, domain string) (*Zones, error) {
z := &Zones{

Loading…
Cancel
Save