updateutil

package
v0.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUpdateSources = []*UpdateSource{
	NewUpdateSource(
		UpdateSourceKindAzure,
		"autobutlerrelease",
		"releases/autobutler",
	),
	NewUpdateSource(
		UpdateSourceKindGithub,
		"autobutler-org",
		"autobutler.org",
	),
	NewUpdateSource(
		UpdateSourceKindGithub,
		"autobutler-org",
		"autobutler",
	),
}

Functions

func ConstructArchiveName

func ConstructArchiveName() string

func GetLatestVersion

func GetLatestVersion(source *UpdateSource) (string, error)

func GetLatestVersionFromDefaultSources

func GetLatestVersionFromDefaultSources() (string, error)

func IsDevelopmentVersion

func IsDevelopmentVersion(version string) bool

func Update

func Update(source *UpdateSource, version string) error

Update downloads and installs a new version of the application

func UpdateFromDefaultSources

func UpdateFromDefaultSources(version string) error

UpdateFromDefaultSources tries to update from all default sources until one succeeds

Types

type ListPossibleUpdatesResult

type ListPossibleUpdatesResult struct {
	Versions []*UpdateVersion
}

ListPossibleUpdatesResult contains the result of listing possible updates

func ListPossibleUpdates

func ListPossibleUpdates(source *UpdateSource, allVersions bool) (*ListPossibleUpdatesResult, error)

ListPossibleUpdates retrieves all available releases that are newer than the current version

func ListPossibleUpdatesFromDefaultSources

func ListPossibleUpdatesFromDefaultSources(allVersions bool) (*ListPossibleUpdatesResult, error)

ListPossibleUpdatesFromDefaultSources lists possible updates from all default sources

type UpdateSource

type UpdateSource struct {
	Kind    UpdateSourceKind `json:"kind"`
	Account string           `json:"account"`
	Path    string           `json:"path"`
}

func NewUpdateSource

func NewUpdateSource(kind UpdateSourceKind, account string, path string) *UpdateSource

NewUpdateSource creates a new UpdateSource with the specified kind, account, and path

func (*UpdateSource) BaseUrl

func (s *UpdateSource) BaseUrl() string

func (*UpdateSource) BlobPrefix

func (s *UpdateSource) BlobPrefix() *string

func (*UpdateSource) Container

func (s *UpdateSource) Container() string

func (*UpdateSource) UpdateUrl

func (s *UpdateSource) UpdateUrl() string

type UpdateSourceKind

type UpdateSourceKind string
const (
	UpdateSourceKindAzure  UpdateSourceKind = "azure"
	UpdateSourceKindGithub UpdateSourceKind = "github"
)

type UpdateVersion

type UpdateVersion struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

Jump to

Keyboard shortcuts

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