Browse Source

zones: introduce ZoneIterator, implemented by Zones

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/1/head
Alejandro Mery 1 year ago
parent
commit
d38c909b0b
  1. 6
      pkg/zones/zones.go

6
pkg/zones/zones.go

@ -13,6 +13,7 @@ import (
var ( var (
_ MachineIterator = (*Zone)(nil) _ MachineIterator = (*Zone)(nil)
_ MachineIterator = (*Zones)(nil) _ MachineIterator = (*Zones)(nil)
_ ZoneIterator = (*Zones)(nil)
) )
// A MachineIterator is a set of Machines we can iterate on // A MachineIterator is a set of Machines we can iterate on
@ -20,6 +21,11 @@ type MachineIterator interface {
ForEachMachine(func(*Machine) bool) ForEachMachine(func(*Machine) bool)
} }
// A ZoneIterator is a set of Zones we can iterate on
type ZoneIterator interface {
ForEachZone(func(*Zone) bool)
}
// Zone represents one zone in a cluster // Zone represents one zone in a cluster
type Zone struct { type Zone struct {
zones *Zones zones *Zones

Loading…
Cancel
Save