updater

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Overview

Package updater manages GitHub Release checks and in-place application upgrades.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyUpdate

func ApplyUpdate(c *gin.Context)

ApplyUpdate 下载并应用应用更新 @Summary 下载并应用应用更新 @Description 下载当前平台对应的 GitHub Actions Release 资产,替换当前二进制并重启进程 @Tags admin @Produce json @Security SessionCookie @Success 200 {object} response.Any "升级已准备并即将重启" @Failure 400 {object} response.Any "当前版本不可升级" @Failure 401 {object} response.Any "未登录" @Failure 403 {object} response.Any "无管理员权限" @Failure 500 {object} response.Any "升级准备失败" @Router /api/v1/admin/update/apply [post]

func GetUpdateStatus

func GetUpdateStatus(c *gin.Context)

GetUpdateStatus 获取应用更新状态 @Summary 获取应用更新状态 @Description 从系统配置指定的 GitHub 上游仓库查询最新兼容 Release,并与当前服务版本比较 @Tags admin @Produce json @Security SessionCookie @Success 200 {object} response.Any{data=updater.Status} "更新状态" @Failure 401 {object} response.Any "未登录" @Failure 403 {object} response.Any "无管理员权限" @Failure 500 {object} response.Any "查询失败" @Router /api/v1/admin/update [get]

Types

type Status

type Status struct {
	CurrentVersion     string `json:"current_version"`
	BuildTime          string `json:"build_time"`
	LatestVersion      string `json:"latest_version"`
	UpdateAvailable    bool   `json:"update_available"`
	CanUpgrade         bool   `json:"can_upgrade"`
	Prerelease         bool   `json:"prerelease"`
	ReleaseName        string `json:"release_name"`
	ReleaseNotes       string `json:"release_notes"`
	ReleaseURL         string `json:"release_url"`
	PublishedAt        string `json:"published_at"`
	UpstreamRepository string `json:"upstream_repository"`
	AssetName          string `json:"asset_name"`
	Platform           string `json:"platform"`
}

Status describes the current build and the newest compatible upstream release.

Jump to

Keyboard shortcuts

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