updater

package
v0.0.0-...-1f00af5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package updater checks for updates to Doodle.

Index

Constants

View Source
const (
	Major int = iota
	Minor
	Patch
)

Some semantic version indexing constants, to parse the result of ParseSemver with more semantic code.

Variables

This section is empty.

Functions

func ParseSemver

func ParseSemver(versionString string) ([3]int, error)

ParseSemver parses a Project: Doodle semantic version number into its three integer parts. Historical versions of the game looked like either "0.1.0-alpha" or "0.7.0" and the given version string is expected to match that pattern.

Types

type VersionInfo

type VersionInfo struct {
	LatestVersion string `json:"latestVersion"`
	DownloadURL   string `json:"downloadUrl"`
}

VersionInfo holds the version.json data for self-update check.

func Check

func Check() (VersionInfo, error)

Check for new updates.

func CheckNow

func CheckNow() (VersionInfo, error)

CheckNow forces a re-check of the update info.

func (VersionInfo) IsNewerVersionThan

func (i VersionInfo) IsNewerVersionThan(versionString string) bool

IsNewerVersionThan checks if the version.json houses a newer game version than the currently running game's version string.

Jump to

Keyboard shortcuts

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