zones: introduce ZoneIterator, implemented by Zones

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-26 16:16:38 +00:00
parent 7dd3ea8f96
commit d38c909b0b
+6
View File
@@ -13,6 +13,7 @@ import (
var (
_ MachineIterator = (*Zone)(nil)
_ MachineIterator = (*Zones)(nil)
_ ZoneIterator = (*Zones)(nil)
)
// A MachineIterator is a set of Machines we can iterate on
@@ -20,6 +21,11 @@ type MachineIterator interface {
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
type Zone struct {
zones *Zones