Compare commits

..

2 Commits

Author SHA1 Message Date
amery 0fa2c4f5c8 rings: DecodeRingZeroAddress() and DecodeRingOneAddress()
Signed-off-by: Alejandro Mery <amery@jpi.io>
2024-05-28 15:34:11 +00:00
amery 52a768f929 rings: DecodeAddress() [WIP]
Signed-off-by: Alejandro Mery <amery@jpi.io>
2024-05-28 15:34:11 +00:00
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
// DecodeAddress ... TODO // DecodeAddress ... TODO
// //
// revive:disable:function-result-limit // revive:disable:function-result-limit
func DecodeAddress(addr netip.Addr) (Ring, RegionID, ZoneID, uint) { func DecodeAddress(addr netip.Addr) (RingID, RegionID, ZoneID, uint) {
// revive:enable:function-result-limit // revive:enable:function-result-limit
if addr.IsValid() { if addr.IsValid() {
if addr.Is4In6() { if addr.Is4In6() {
@@ -26,7 +26,7 @@ func DecodeAddress(addr netip.Addr) (Ring, RegionID, ZoneID, uint) {
} }
// revive:disable:function-result-limit // revive:disable:function-result-limit
func unsafeDecodeAddress(a, b, c, d byte) (Ring, RegionID, ZoneID, uint) { func unsafeDecodeAddress(a, b, c, d byte) (RingID, RegionID, ZoneID, uint) {
// revive:enable:function-result-limit // revive:enable:function-result-limit
switch { switch {
case a != 10: case a != 10:
+3 -3
View File
@@ -8,12 +8,12 @@ import (
"darvaza.org/core" "darvaza.org/core"
) )
// Ring ... TODO // RingID ... TODO
type Ring int type RingID int
const ( const (
// InvalidRing ... TODO // InvalidRing ... TODO
InvalidRing Ring = iota - 1 InvalidRing RingID = iota - 1
// RingZero ... TODO // RingZero ... TODO
RingZero RingZero
// RingOne ... TODO // RingOne ... TODO