Compare commits

..

2 Commits

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