zones: introduce MachineIterator interface

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-26 00:09:45 +00:00
parent 609f48a2d1
commit 07b4a22752
2 changed files with 33 additions and 29 deletions
+10
View File
@@ -10,6 +10,16 @@ import (
"darvaza.org/resolver"
)
var (
_ MachineIterator = (*Zone)(nil)
_ MachineIterator = (*Zones)(nil)
)
// A MachineIterator is a set of Machines we can iterate on
type MachineIterator interface {
ForEachMachine(func(*Machine) bool)
}
// Zone represents one zone in a cluster
type Zone struct {
zones *Zones