version

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package version provides version information and update checking.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "v0.36.1"
	Commit  = "none"
	Date    = "unknown"
)

Build info set via ldflags during build.

Functions

func IsDev

func IsDev() bool

IsDev returns true if running a development build.

func IsNewerRelease

func IsNewerRelease(otherVersion string) bool

IsNewerRelease reports whether otherVersion is newer than current version.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"goVersion"`
}

Info holds current version information.

func GetInfo

func GetInfo() Info

GetInfo returns current version information.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles version checking with caching.

func New

func New() *Manager

New creates a new version manager.

func (*Manager) CheckUpdate

func (m *Manager) CheckUpdate() (*UpdateInfo, error)

CheckUpdate checks for available updates from GitHub releases.

func (*Manager) ClearCache

func (m *Manager) ClearCache()

ClearCache invalidates the cached version info.

func (*Manager) GetResponse

func (m *Manager) GetResponse() (*Response, error)

GetResponse returns combined version and update info.

func (*Manager) GetResponseFallback

func (m *Manager) GetResponseFallback() *Response

GetResponseFallback returns basic version info without update check.

type Response

type Response struct {
	Info
	UpdateInfo
}

Combined version and update response.

type UpdateInfo

type UpdateInfo struct {
	LatestVersion   string    `json:"latestVersion"`
	UpdateAvailable bool      `json:"updateAvailable"`
	ReleaseURL      string    `json:"releaseUrl"`
	PublishedAt     time.Time `json:"publishedAt,omitempty"`
	ReleaseNotes    string    `json:"releaseNotes,omitempty"`
	InstallCommand  string    `json:"installCommand,omitempty"`
}

UpdateInfo holds information about available updates.

Jump to

Keyboard shortcuts

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