updater

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package updater provides functionality to check for and apply updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubRelease

type GitHubRelease struct {
	TagName     string    `json:"tag_name"`
	Name        string    `json:"name"`
	Body        string    `json:"body"`
	HTMLURL     string    `json:"html_url"`
	PublishedAt time.Time `json:"published_at"`
	Prerelease  bool      `json:"prerelease"`
	Draft       bool      `json:"draft"`
}

GitHubRelease represents a GitHub release from the API.

type Service

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

Service handles version checking and updates.

func NewService

func NewService(currentVersion, githubRepo string, logger *slog.Logger) *Service

NewService creates a new updater service.

func (*Service) ApplyUpdate

func (s *Service) ApplyUpdate(ctx context.Context, version string) error

ApplyUpdate performs the update by pulling new container images and restarting services. This is designed to work in containerized deployments using Podman/Docker Compose.

func (*Service) CheckForUpdates

func (s *Service) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)

CheckForUpdates queries GitHub for the latest release and compares with current version.

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version"`
	UpdateAvailable bool   `json:"update_available"`
	ReleaseURL      string `json:"release_url,omitempty"`
	ReleaseNotes    string `json:"release_notes,omitempty"`
	PublishedAt     string `json:"published_at,omitempty"`
}

UpdateInfo contains information about available updates.

Jump to

Keyboard shortcuts

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