updater

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNewer

func IsNewer(latest, current string) bool

IsNewer returns true if latest version is newer than current

func PerformUpdate added in v0.3.0

func PerformUpdate(currentVersion string) error

PerformUpdate performs the update using the detected installation method

Types

type InstallMethod added in v0.3.0

type InstallMethod string

InstallMethod represents how octrafic was installed

const (
	MethodHomebrew InstallMethod = "homebrew"
	MethodYay      InstallMethod = "yay"
	MethodParu     InstallMethod = "paru"
	MethodDeb      InstallMethod = "deb"
	MethodRPM      InstallMethod = "rpm"
	MethodScript   InstallMethod = "script"
	MethodManual   InstallMethod = "manual"
	MethodUnknown  InstallMethod = "unknown"
)

func DetectInstallationMethod added in v0.3.0

func DetectInstallationMethod() InstallMethod

DetectInstallationMethod detects how octrafic was installed

type ReleaseEntry added in v0.4.0

type ReleaseEntry struct {
	TagName string
	Body    string
	HTMLURL string
}

ReleaseEntry holds information about a single release

func FetchReleaseNotes

func FetchReleaseNotes(count int) ([]ReleaseEntry, error)

FetchReleaseNotes fetches the latest `count` releases, returned oldest-first

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion string
	LatestVersion  string
	ReleaseNotes   string
	HTMLURL        string
	IsNewer        bool
}

UpdateInfo holds information about available updates

func CheckLatestVersion

func CheckLatestVersion(currentVersion string) (*UpdateInfo, error)

CheckLatestVersion checks GitHub for the latest release and compares with current version

Jump to

Keyboard shortcuts

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