Documentation
¶
Overview ¶
Package update reads the latest GitHub Release tag for sartoopjj/thefeed and proxies the asset bytes when the user clicks Download. Separate from /api/version-check, which reads the version over the DNS protocol.
Index ¶
Constants ¶
const ( // Repo is the GitHub repo serving releases. Repo = "sartoopjj/thefeed" // LatestReleaseURL redirects to /releases/tag/{V}; HEAD it and // parse the Location header. LatestReleaseURL = "https://github.com/" + Repo + "/releases/latest" // BaseURL is the per-release asset directory. BaseURL = "https://github.com/" + Repo + "/releases/download" )
Variables ¶
This section is empty.
Functions ¶
func AssetFilename ¶ added in v0.20.0
AssetFilename returns just the asset name for the running platform at the given version (e.g. "thefeed-client-v0.19.1-darwin-arm64"). Falls back to a runtime-derived template if AssetTemplate wasn't injected at build time (e.g., `go run`).
func AssetURL ¶
AssetURL builds the github.com download URL for the running platform at the requested version.
func IsNewer ¶
IsNewer compares semver-ish version strings, tolerating the "v" prefix and numeric pre-release suffixes. Returns false if either side is "dev".
func StreamAsset ¶ added in v0.20.0
func StreamAsset(ctx context.Context, version, asset string, dst http.ResponseWriter, logf func(string)) error
StreamAsset downloads version+asset from GitHub Releases and writes the body to dst with attachment Content-Disposition.