IsRelativeSessionRef reports whether ref is a relative session reference (e.g., "-1", "-2"). Explicit IDs (anything else, including UUIDs) return false. Callers use this to distinguish a user-supplied concrete ID — which may legitimately not exist yet — from a relative offset that must resolve again
(ref string)
| 30 | // may legitimately not exist yet — from a relative offset that must resolve |
| 31 | // against existing sessions. |
| 32 | func IsRelativeSessionRef(ref string) bool { |
| 33 | _, isRelative := parseRelativeSessionRef(ref) |
| 34 | return isRelative |
| 35 | } |
| 36 | |
| 37 | // parseRelativeSessionRef checks if ref is a relative session reference (e.g., "-1", "-2") |
| 38 | // and returns the offset and whether it's a relative reference. |