Documentation
¶
Index ¶
- func DownloadAndExtractRelease(releaseURL, platform, arch string) (string, error)
- func GetNightlyReleaseAPIURL() string
- func GetProdReleaseAPIURL() string
- func GetReleaseAPIURL(owner string) string
- func GetReleaseTagAPIURL(owner, tag string) string
- func NewUpdateCommand(binaryName string) *cobra.Command
- func UpdateSelf(programName string) error
- func UpdateSelfFromRelease(releaseURL, platform, arch, programName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAndExtractRelease ¶
DownloadAndExtractRelease downloads a release archive (or uses a direct asset URL) and extracts it to a temporary directory. It returns the extraction directory on success. If releaseURL is empty, the latest release of the current project is used. platform/arch can be used to select the correct asset (e.g. "linux", "amd64").
func GetNightlyReleaseAPIURL ¶
func GetNightlyReleaseAPIURL() string
GetNightlyReleaseAPIURL returns the nightly release API URL for the production repo.
func GetProdReleaseAPIURL ¶
func GetProdReleaseAPIURL() string
GetProdReleaseAPIURL returns the production release API URL (upstream).
func GetReleaseAPIURL ¶
GetReleaseAPIURL returns the GitHub Releases API URL for the given repo owner. Example: owner="sky5454" -> https://api.github.com/repos/sky5454/picoclaw/releases/latest
func GetReleaseTagAPIURL ¶
GetReleaseTagAPIURL returns the GitHub Releases API URL for a specific tag. Example: owner="sipeed", tag="nightly" -> https://api.github.com/repos/sipeed/picoclaw/releases/tags/nightly
func NewUpdateCommand ¶
NewUpdateCommand returns a cobra command that triggers UpdateSelfFromRelease.
func UpdateSelf ¶
UpdateSelf updates the running executable by fetching the latest release and applying the binary matching programName.
func UpdateSelfFromRelease ¶
UpdateSelfFromRelease downloads the release matching the given parameters, extracts it and applies the binary named programName to update the currently running executable using minio/selfupdate. If releaseURL is empty, the latest release is used. If platform or arch is empty, runtime values are used.
Types ¶
This section is empty.