Browse Source

zones: adds ForEachZone iterator

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/1/head
Alejandro Mery 1 year 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 // 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{

Loading…
Cancel
Save