Auto-updater plugin for the Pilot Protocol daemon. Polls the GitHub releases endpoint hourly, hot-swaps the daemon, pilotctl, and gateway binaries when a newer SemVer tag appears, and exits so the supervisor restarts the new copy.
import "github.com/pilot-protocol/updater"u := updater.New(updater.Config{
Repo: "TeoSlayer/pilotprotocol",
InstallDir: "/home/user/.pilot/bin",
Version: "v1.10.5",
CheckInterval: 1 * time.Hour,
})
u.Start()Set PinnedVersion to lock the updater to a specific release tag. When
set, the updater fetches the exact release (via
/releases/tags/{tag}), applies it if it differs from the current
install, then idles — it will not chase the latest release. Clear
PinnedVersion (set to "") to resume auto-updating.
u := updater.New(updater.Config{
Repo: "TeoSlayer/pilotprotocol",
InstallDir: "/home/user/.pilot/bin",
PinnedVersion: "v1.10.5", // stay on this version
})
u.Start()The in-process Service adapter is used when embedding into the
daemon; a standalone sidecar binary built from this package is also
supported.
| File | What it does |
|---|---|
updater.go |
Updater — GitHub release polling, download, SHA verify, atomic rename. |
version.go |
SemVer parsing and comparison. |
service.go |
*Service — coreapi.Service adapter. Build tag !no_updater. |
service_disabled.go |
Stub when build tag no_updater is set. |
| Tag | Effect |
|---|---|
no_updater |
Compiles a stub whose Start is a no-op. |
AGPL-3.0-or-later. See LICENSE.