Documentation
¶
Index ¶
- Constants
- func DefaultDownload(url string) ([]byte, error)
- func IsOutdated(current, latest string) bool
- func ResolveLatestVersion(source string, download func(string) ([]byte, error)) (string, error)
- func Rollback(targetPath, backupPath string) error
- func Swap(targetPath, newFilePath string) (string, error)
- func VerifyChecksum(asset string, data []byte, sums []byte) error
Constants ¶
const ( EnvGitHubToken = "GITHUB_TOKEN" EnvGHToken = "GH_TOKEN" )
Variables ¶
This section is empty.
Functions ¶
func DefaultDownload ¶ added in v0.0.2
DefaultDownload was MOVED verbatim from tinywasm/installer (mode_binary.go).
func IsOutdated ¶ added in v0.0.2
IsOutdated reports whether current is strictly older than latest (MAJOR.MINOR.PATCH, leading "v" optional, pre-release/build suffix ignored). Any parse failure -> false, so "dev"/empty builds are never reported as outdated.
func ResolveLatestVersion ¶ added in v0.0.2
ResolveLatestVersion was MOVED from tinywasm/installer (mode_binary.go: resolveLatestVersion). The only change is decoupling: the *installer.Deps parameter was replaced by an injected download func so the proven logic lives here without depending on the installer package.
func Rollback ¶ added in v0.0.2
Rollback restores backupPath over targetPath (used after a post-swap failure, e.g. the new process failed its health check).
func Swap ¶ added in v0.0.2
Swap backs up targetPath (if it exists) to targetPath+".old" and renames newFilePath into its place. It returns the backup path ("" when targetPath did not exist). On install failure it restores the backup before returning the error.
func VerifyChecksum ¶ added in v0.0.2
VerifyChecksum was MOVED verbatim from tinywasm/installer (mode_binary.go: verifyChecksum) — only the name was exported. It verifies data's SHA256 against the entry for asset in a checksums.txt body ("<hex> <asset>" per line).
Types ¶
This section is empty.