cluster: use rings.ZoneID and rings.NodeID types

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2024-06-02 22:04:54 +00:00
parent 6d89e0ea3c
commit 99dece1e43
10 changed files with 64 additions and 73 deletions
+4 -2
View File
@@ -3,6 +3,8 @@ package cluster
import (
"net/netip"
"strings"
"git.jpi.io/amery/jpictl/pkg/rings"
)
// revive:disable:line-length-limit
@@ -12,7 +14,7 @@ type Machine struct {
zone *Zone
logger `json:"-" yaml:"-"`
ID int
ID rings.NodeID
Name string `json:"-" yaml:"-"`
Inactive bool `json:"inactive,omitempty" yaml:"inactive,omitempty"`
@@ -74,7 +76,7 @@ func (m *Machine) SetGateway(enabled bool) error {
}
// Zone indicates the [Zone] this machine belongs to
func (m *Machine) Zone() int {
func (m *Machine) Zone() rings.ZoneID {
return m.zone.ID
}