cluster: introduce NodeID and ZoneID types

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2024-05-28 19:40:18 +00:00
parent f45a8f21f3
commit 9307f08559
11 changed files with 71 additions and 31 deletions
+24
View File
@@ -0,0 +1,24 @@
package cluster
import "strconv"
type (
// ZoneID is the identifier of a [Zone]
ZoneID int
// NodeID is the identifier of a [Machine]
NodeID int
)
func (z ZoneID) String() string {
if z > 0 {
return strconv.Itoa(int(z))
}
return ""
}
func (n NodeID) String() string {
if n > 0 {
return strconv.Itoa(int(n))
}
return ""
}