upgrader

package
v1.9.10-0...-ff2253c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpgradeStatusInfo     = "info"
	UpgradeStatusError    = "error"
	UpgradeStatusProgress = "progress"
)

Variables

View Source
var (
	ErrDownloadUrlEmpty            = e.New(52001, "upgrader core downloadUrl is empty")
	ErrDigestEmpty                 = e.New(52002, "upgrader core digest is empty")
	ErrDigestFileEmpty             = e.New(52003, "digest file content is empty")
	ErrExecutableBinaryEmpty       = e.New(52004, "executable binary file is empty")
	ErrUpdateInProgress            = e.New(52005, "update already in progress")
	ErrSignatureEmpty              = e.New(52006, "release signature is missing")
	ErrSignatureInvalid            = e.New(52007, "release signature is invalid")
	ErrSignatureKeyUnknown         = e.New(52008, "release signature key is not trusted")
	ErrTrustedSignatureKeysEmpty   = e.New(52009, "no trusted release signing keys are embedded")
	ErrTrustedSignatureKeysInvalid = e.New(52010, "embedded release signing keys are invalid")
	ErrDigestMismatch              = e.New(52011, "release archive digest does not match")
	ErrReleaseAssetEmpty           = e.New(52012, "upgrader core release asset is missing")
	ErrUnsupportedPlatform         = e.New(52013, "upgrader core platform is unsupported")
)

Functions

func BinaryUpgrade

func BinaryUpgrade(ws *helper.SafeWebSocketWriter, control *Control)

BinaryUpgrade Upgrade the binary

func DockerUpgrade

func DockerUpgrade(ws *helper.SafeWebSocketWriter, control *Control)

DockerUpgrade Upgrade the Docker container

Types

type Control

type Control struct {
	DryRun               bool   `json:"dry_run"`
	TestCommitAndRestart bool   `json:"test_commit_and_restart"`
	Channel              string `json:"channel"`
}

type CoreUpgradeResp

type CoreUpgradeResp struct {
	Status   string  `json:"status"`
	Progress float64 `json:"progress"`
	Message  string  `json:"message"`
}

type ProgressWriter

type ProgressWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*ProgressWriter) Write

func (pw *ProgressWriter) Write(p []byte) (int, error)

type Upgrader

type Upgrader struct {
	Channel string
	Release version.TRelease
	version.RuntimeInfo
}

func NewUpgrader

func NewUpgrader(channel string) (u *Upgrader, err error)

func (*Upgrader) DownloadLatestRelease

func (u *Upgrader) DownloadLatestRelease(progressChan chan float64) (tarName string, err error)

func (*Upgrader) PerformCoreUpgrade

func (u *Upgrader) PerformCoreUpgrade(tarPath string) (err error)

func (*Upgrader) TestCommitAndRestart

func (u *Upgrader) TestCommitAndRestart() error

Jump to

Keyboard shortcuts

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