54e434c03e
Signed-off-by: Alejandro Mery <amery@jpi.io>
26 lines
361 B
Go
26 lines
361 B
Go
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 {
|
|
return idString(int(z))
|
|
}
|
|
|
|
func (n NodeID) String() string {
|
|
return idString(int(n))
|
|
}
|
|
|
|
func idString(v int) string {
|
|
if v > 0 {
|
|
return strconv.Itoa(v)
|
|
}
|
|
return ""
|
|
}
|