Documentation
¶
Index ¶
Constants ¶
View Source
const ( // GitHubRepo is the repository for releases GitHubRepo = "tamtom/play-console-cli" // BinaryName is the name of the binary BinaryName = "gplay" // CheckInterval is how often to check for updates CheckInterval = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func ApplyUpdate ¶
ApplyUpdate replaces the current binary with the new one
func DownloadUpdate ¶
func DownloadUpdate(ctx context.Context, info *UpdateInfo) (string, error)
DownloadUpdate downloads the latest binary
func PrintUpdateMessage ¶
func PrintUpdateMessage(info *UpdateInfo)
PrintUpdateMessage prints an update notification if one is available
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
}
Asset represents a release asset
type Options ¶
type Options struct {
// SkipCheck disables update checking
SkipCheck bool
// ForceCheck ignores the check interval cache
ForceCheck bool
// AutoUpdate enables automatic updating
AutoUpdate bool
}
Options configures update behavior
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
PublishedAt time.Time `json:"published_at"`
Assets []Asset `json:"assets"`
HTMLURL string `json:"html_url"`
}
Release represents a GitHub release
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string
LatestVersion string
ReleaseURL string
DownloadURL string
IsNewer bool
}
UpdateInfo contains information about an available update
func CheckForUpdate ¶
func CheckForUpdate(ctx context.Context, opts Options) (*UpdateInfo, error)
CheckForUpdate checks if a newer version is available
Click to show internal directories.
Click to hide internal directories.