Documentation
¶
Index ¶
Constants ¶
const RefreshCommand = "__refresh-update-cache"
RefreshCommand is an internal helper that survives the client's exec handoff.
const RefreshForkCommand = "__refresh-update-cache-fork"
RefreshForkCommand is the short-lived intermediate that detaches the refresh helper. StartCacheRefresh waits for the intermediate rather than the helper, so the helper is reparented before al replaces itself with the client.
const ReleasesBaseURL = "https://github.com/" + Repo + "/releases"
ReleasesBaseURL is the base URL for release downloads.
const Repo = "conn-castle/agent-layer"
Repo identifies the GitHub repository used for release checks.
Variables ¶
This section is empty.
Functions ¶
func IsRateLimitError ¶ added in v0.8.0
IsRateLimitError reports whether err represents a GitHub API rate-limit condition.
func RefreshCache ¶ added in v1.0.0
RefreshCache has one short deadline shared by all requests and retry waits. Launch callers gate update suppression and version overrides before spawning.
func SpawnDetachedRefresh ¶ added in v1.0.0
func SpawnDetachedRefresh()
SpawnDetachedRefresh starts the real refresh helper and returns immediately without waiting for it. It runs in the short-lived fork intermediate: the helper reparents to init when the intermediate exits, so no Wait goroutine must survive the client's exec handoff.
func StartCacheRefresh ¶ added in v1.0.0
func StartCacheRefresh()
StartCacheRefresh starts a silent, isolated helper without waiting for GitHub. A goroutine alone cannot finish after al replaces itself with the client, and a direct child would stay a zombie once exec destroys the waiting goroutine. The helper is therefore double-forked: this process waits only for a short-lived intermediate that detaches the real helper before the exec handoff, and concurrent launches share one attempt claim from before the spawn. The wait covers the intermediate only, never the helper's network I/O.
Types ¶
type CheckResult ¶
CheckResult captures the latest release check outcome.
func CachedCheck ¶ added in v1.0.0
func CachedCheck(_ context.Context, currentVersion string) (CheckResult, error)
CachedCheck never performs network I/O. Stale data remains usable for a notice while a detached helper refreshes it for subsequent launches.
type RateLimitError ¶ added in v0.8.0
RateLimitError indicates GitHub's API rate limit was hit while checking for updates.
Callers should generally treat this as a best-effort failure and suppress/minimize output.
func (*RateLimitError) Error ¶ added in v0.8.0
func (e *RateLimitError) Error() string