MCPcopy Index your code
hub / github.com/docker/docker-agent / IsRelativeSessionRef

Function IsRelativeSessionRef

pkg/session/store.go:32–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

30// may legitimately not exist yet — from a relative offset that must resolve
31// against existing sessions.
32func 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.

Callers 2

TestIsRelativeSessionRefFunction · 0.85

Calls 1

parseRelativeSessionRefFunction · 0.85

Tested by 1

TestIsRelativeSessionRefFunction · 0.68