update

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 11 Imported by: 0

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

func ApplyUpdate(newBinaryPath string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL